Can't use gcc in a clang built world

Kevin Day toasty at dragondata.com
Thu Jun 27 00:02:07 UTC 2013


Are you supposed to be able to use gcc to build userland binaries if you built world with clang?

I'm on -CURRENT as of a few days ago (using armv6 but i'm not sure if that matters). If I buildworld with clang, then attempt to compile some userland binaries with gcc, I'll get missing symbols like:

  CCLD     pcretest
./.libs/libpcre.so: undefined reference to `__clear_cache'
*** [pcretest] Error code 1

If I look at /lib/libgcc that symbol isn't there:

# readelf -a /lib/libgcc_s.so.1 | grep clear
#

If I rebuild /usr/src/gnu/libgcc with gcc, then try again it works. The symbol is now there:

# readelf -a /lib/libgcc_s.so.1 | grep clear
    94: 00003b94    48 FUNC    GLOBAL DEFAULT   12 __clear_cache@@GCC_3.0
#

I can build pcre correctly. I thought one of the goals was to be able to use both interchangeably on the same system. Is this broken, or one of the casualties of making clang default now? Do we need two different versions of some libraries depending on which compiler is being used?

-- Kevin



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4891 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20130626/cf2b309c/attachment.bin>


More information about the freebsd-hackers mailing list