[cfe-dev] relocation R_386_GOTOFF against undefined symbol (was: Clang on Ubuntu 11.04 (natty) 32 bits)

Óscar Fuentes ofv at wanadoo.es
Fri Apr 29 12:55:11 PDT 2011


Óscar Fuentes <ofv at wanadoo.es> writes:

> pageexec at freemail.hu writes:
>
>> On 29 Apr 2011 at 5:35, Óscar Fuentes wrote:
>>
>>> Any pointers on how to configure clang for matching gcc's directory
>>> search list appreciated.
>>
>> to avoid related problems on gentoo (i have an amd64 cross compiler
>> installed on a i386
>> userland) i configure with these:
>>
>> --with-cxx-include-root=/usr/lib/gcc/i686-pc-linux-gnu/4.5.2/include/g++-v4
>> --with-cxx-include-arch=i686-pc-linux-gnu
>> --with-binutils-include=/usr/lib/binutils/i686-pc-linux-gnu/2.21/include
>
> Thanks. Will try using those configuration options.

Compiling works after configuring the cmake build using the
C_INCLUDE_DIRS variable with the same directories listed by "g++ -v".

Building some toy programs works but while linking one of my projects:

oscar at acer:~/home/oscar/bin/clang++ -v -fPIC -O3 -DNDEBUG  -shared -Wl,-soname,liblp0core.so -o liblp0core.so <object-files> -L/home/oscar/lib -lboost_thread-mt -lboost_date_time-mt -ldl -Wl,-rpath,/home/oscar/lib
clang version 3.0 ()
Target: i386-pc-linux-gnu
Thread model: posix

 "/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m
 elf_i386 -shared -o liblp0core.so /usr/lib/../lib/crti.o
 /usr/lib/gcc/i686-linux-gnu/4.5.2/crtbeginS.o -L/home/oscar/lib
 -L/usr/lib/gcc/i686-linux-gnu/4.5.2
 -L/usr/lib/gcc/i686-linux-gnu/4.5.2/../../../../lib -L/lib/../lib
 -L/usr/lib/../lib
 -L/usr/lib/gcc/i686-linux-gnu/4.5.2/../../.. -L/usr/lib/i686-linux-gnu
 -soname liblp0core.so <object-files> -lboost_thread-mt -lboost_date_time-mt -ldl -rpath /home/oscar/lib -lstdc++ -lm -lgcc_s -lc -lgcc_s /usr/lib/gcc/i686-linux-gnu/4.5.2/crtendS.o /usr/lib/../lib/crtn.o
/usr/bin/ld: CMakeFiles/lp0core.dir/basicops.cpp.o: relocation R_386_GOTOFF against undefined symbol `cosf@@GLIBC_2.0' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
clang-3: error: linker command failed with exit code 1 (use -v to see invocation)


There is PR8713 about this same error message but related to
libstdc++. Is this a bug?




More information about the cfe-dev mailing list