powerpc64 10.0-STABLE's math/gmp gets "too few operands for instruction" under clang 3.4.1

Mark Millard markmi at dsl-only.net
Mon Jun 30 08:26:58 UTC 2014


clang did not finish the prerequisites for devel/boost-libs...

/usr/ports/math/gmp/work/gmp-5.1.3/mpn/ gets

divrem-2.lo
tmp-divrem-2.s error: too few operands for instruction
rlwinm 0, 0, 30, 1

and so clang stopped there.

An IBM web page reports ( http://www-01.ibm.com/support/knowledgecenter/?lang=en#!/ssw_aix_53/com.ibm.aix.aixassem/doc/alangref/rlwinm.htm%23iw480ken )...

rlwinm RA,RS,SH,MB,ME
rlwinm. RA,RS,SH,MB,ME
rlwinm RA,RS,SH,BM
rlwinm. RA,RS,SH,BM

The rlwinm and rlinm instructions rotate left the contents of the source general-purpose register (GPR) RS by the number of bits specified by the SH parameter, logically AND the rotated data with a 32-bit generated mask defined by the values in Mask Begin (MB) and Mask End (ME), and store the result in GPR RA.

Consider the following when using the rlwinm and rlinm instructions:

If the MB value is less than the ME value + 1, then the mask bits between and including the starting point and the end point are set to ones. All other bits are set to zeros.
If the MB value is the same as the ME value + 1, then all 32 mask bits are set to ones.
If the MB value is greater than the ME value + 1, then all of the mask bits between and including the ME value +1 and the MB value -1 are set to zeros. All other bits are set to ones.

The BM parameter can also be used to specify the mask for these instructions. The assembler will generate the MB and ME parameters from the BM value.



===
Mark Millard
markmi at dsl-only.net

On Jun 30, 2014, at 12:55 AM, Mark Millard <markmi at dsl-only.net> wrote:

buildworld uses -mlongcall for /usr/src/lib/csu/powerpc64/ and so clang 3.4.1 stops there.

buildkernel uses -mcall-aixdesc and -Wa,-many for /usr/obj/usr/src/sys/GENERIC64/ and so clang stops there as well.


Technique of discovery: Starting from

FreeBSD-10.0-STABLE-powerpc-powerpc64-20140622-r267746-disk1.iso

[with /usr/ports/Mk/Uses/compiler.mk still reverted so it does not avoid clang so much --but I'v not gotten to devel/boost-all testing yet]

and with /etc/make.conf being:

CPP=clang-cpp
CC=clang
CXX=clang++

then following script tries buildworld and buildkernel:

#!/bin/sh
rm -fr /usr/obj/*
#
# Presume a free-standing clang c++ is available for bootstrapping:
# One is in 10.0-STABLE for the specifics here.
#
# Convert to having hosted implementation material in place.
#
cd /usr/src/lib/libcxxrt
make clean
make
make install
#
cd /usr/src/lib/libc++
make clean
make
make install
#
# Then with the hosted implementation in place...
#
make buildworld
make buildkernel

In essence: it bootstraps from a freestanding clang based c++ implementation to a hosted c++ implementation before any other possible other uses of the c++ compiler (including before llvm and/or clang are rebuilt: They require a hosted implementation.).

libcxxrt and libc++ built without reporting errors. The lack of && between make buildworld and make buildkernel allowed the script file to show where both stopped: I was more interested in that information than continuing to build without starting over.

I will probably see what happens if I repeat my boost-all experiment: rebuild all the prerequisites in this context and then retry boost-all (if it it gets that far). That would mean that icu had been built by clang (if it is successful).

===
Mark Millard
markmi at dsl-only.net




More information about the freebsd-ppc mailing list