Relocatable linking with relocations from format elf64-x86-64-freebsd (crt1_s.o) to format elf32-i386-freebsd (gcrt1.o) is not supported

Dimitry Andric dim at FreeBSD.org
Thu Aug 18 19:54:42 UTC 2011


On 2011-08-18 19:35, Alexander Best wrote:
...
>>> ld: Relocatable linking with relocations from format elf64-x86-64-freebsd
>>> (crt1_s.o) to format elf32-i386-freebsd (gcrt1.o) is not supported
>> Most likely, this is because you are forcing CC=clang, which does not
>> work as expected.  Can you please post your /etc/make.conf and
>> /etc/src.conf files, and show us any environment variables related to
>> buildworld?  Also, how exactly are you running make buildworld?
>
> i've attached my src.conf, my make.conf and the output of 'env'. nothing
> special, i'm using a simple 'make buildworld'.

The problem is in your make.conf. Effectively, you are doing:

CC = clang
CXX = clang++

which will not work, at least not for the 32-bit compat stage on amd64.
Please use the following fragment instead, which is recommended on
<http://wiki.freebsd.org/BuildingFreeBSDWithClang>:

.if !defined(CC) || ${CC} == "cc"
CC=clang
.endif
.if !defined(CXX) || ${CXX} == "c++"
CXX=clang++
.endif
.if !defined(CPP) || ${CPP} == "cpp"
CPP=clang -E
.endif


More information about the freebsd-toolchain mailing list