Hi,
I am not sure ports@ is the better place to report this, as my problem
may not be directly in touch with one port. It could be:
- problem with my command-line (probable)
- problem with binutils in base (but not sure about the interaction between
port/base when compiling)
- problem with libgcc.a from gcc-4.9
I am working on llvm 3.6.1 with libc++, and when running the regress
part of libc++abi, the builded programs don't seems to be correctly
linked.
Short version: with libgcc.a from base: ok, with libgcc.a from gcc-4.9
the program is compiled, but it fails running ("lazy binding failed!").
Long version:
The full command line for building a test from testsuite is:
$ eg++ \
-o /tmp/tmpj3yLhWexe \
/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxxabi/test/catch_class_01.cpp
\
-nostdinc++ \
-std=c++11 \
-DLIBCXXABI_NO_TIMER \
-I/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxxabi/include \
-I/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxx/include \
-nodefaultlibs \
-L/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib \
-lc++ -lc++abi \
-lc -lm -lgcc -lpthread -v
Using built-in specs.
COLLECT_GCC=eg++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-openbsd5.7/4.9.2/lto-wrapper
Target: x86_64-unknown-openbsd5.7
Configured with: /usr/obj/gcc-4.9.2/gcc-4.9.2/configure --enable-libgcj
--without-jar --verbose --program-transform-name='s,^,e,' --disable-nls
--with-system-zlib --disable-libmudflap --disable-libgomp --disable-tls
--with-as=/usr/bin/as --with-ld=/usr/bin/ld --with-gnu-ld --with-gnu-as
--enable-threads=posix --enable-wchar_t --with-gmp=/usr/local
--enable-languages=c,c++,fortran,objc,java,ada --disable-libstdcxx-pch
--enable-cpp --enable-shared --prefix=/usr/local --sysconfdir=/etc
--mandir=/usr/local/man --infodir=/usr/local/info --localstatedir=/var
--disable-silent-rules --disable-gtk-doc
Thread model: posix
gcc version 4.9.2 (GCC)
COLLECT_GCC_OPTIONS='-o' '/tmp/tmpj3yLhWexe' '-nostdinc++' '-std=c++11' '-D'
'LIBCXXABI_NO_TIMER' '-I'
'/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxxabi/include' '-I'
'/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxx/include'
'-nodefaultlibs' '-L/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib' '-v'
'-mtune=generic' '-march=x86-64'
/usr/local/libexec/gcc/x86_64-unknown-openbsd5.7/4.9.2/cc1plus -quiet
-nostdinc++ -v -I
/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxxabi/include -I
/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxx/include -D
LIBCXXABI_NO_TIMER
/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxxabi/test/catch_class_01.cpp
-quiet -dumpbase catch_class_01.cpp -mtune=generic -march=x86-64 -auxbase
catch_class_01 -std=c++11 -version -o /tmp//ccXVv3iO.s
GNU C++ (GCC) version 4.9.2 (x86_64-unknown-openbsd5.7)
compiled by GNU C version 4.9.2, GMP version 5.0.2, MPFR version
3.1.0-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/local/lib/gcc/x86_64-unknown-openbsd5.7/4.9.2/../../../../x86_64-unknown-openbsd5.7/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxxabi/include
/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxx/include
/usr/local/lib/gcc/x86_64-unknown-openbsd5.7/4.9.2/include
/usr/local/include
/usr/local/lib/gcc/x86_64-unknown-openbsd5.7/4.9.2/include-fixed
/usr/include
End of search list.
GNU C++ (GCC) version 4.9.2 (x86_64-unknown-openbsd5.7)
compiled by GNU C version 4.9.2, GMP version 5.0.2, MPFR version
3.1.0-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 5093d79d51ca8b570b9ebc907e9a7e16
COLLECT_GCC_OPTIONS='-o' '/tmp/tmpj3yLhWexe' '-nostdinc++' '-std=c++11' '-D'
'LIBCXXABI_NO_TIMER' '-I'
'/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxxabi/include' '-I'
'/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxx/include'
'-nodefaultlibs' '-L/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib' '-v'
'-mtune=generic' '-march=x86-64'
/usr/bin/as -v -I
/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxxabi/include -I
/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxx/include -o
/tmp//cc6yfQpy.o /tmp//ccXVv3iO.s
GNU assembler version 2.17 (amd64-unknown-openbsd5.7) using BFD version 2.17
COMPILER_PATH=/usr/local/libexec/gcc/x86_64-unknown-openbsd5.7/4.9.2/:/usr/local/libexec/gcc/x86_64-unknown-openbsd5.7/4.9.2/:/usr/local/libexec/gcc/x86_64-unknown-openbsd5.7/:/usr/local/lib/gcc/x86_64-unknown-openbsd5.7/4.9.2/:/usr/local/lib/gcc/x86_64-unknown-openbsd5.7/
LIBRARY_PATH=/usr/local/lib/gcc/x86_64-unknown-openbsd5.7/4.9.2/:/usr/local/lib/gcc/x86_64-unknown-openbsd5.7/4.9.2/../../../:/usr/lib/
COLLECT_GCC_OPTIONS='-o' '/tmp/tmpj3yLhWexe' '-nostdinc++' '-std=c++11' '-D'
'LIBCXXABI_NO_TIMER' '-I'
'/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxxabi/include' '-I'
'/usr/ports/pobj/llvmorg-3.6.1/llvm-3.6.1.src/projects/libcxx/include'
'-nodefaultlibs' '-L/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib' '-v'
'-mtune=generic' '-march=x86-64'
/usr/local/libexec/gcc/x86_64-unknown-openbsd5.7/4.9.2/collect2 --eh-frame-hdr
-e __start -Bdynamic -dynamic-linker /usr/libexec/ld.so -o /tmp/tmpj3yLhWexe
/usr/lib/crt0.o /usr/lib/crtbegin.o
-L/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib
-L/usr/local/lib/gcc/x86_64-unknown-openbsd5.7/4.9.2
-L/usr/local/lib/gcc/x86_64-unknown-openbsd5.7/4.9.2/../../.. /tmp//cc6yfQpy.o
-lc++ -lc++abi -lc -lm -lgcc -lpthread /usr/lib/crtend.o
The failing run:
$ LD_LIBRARY_PATH=/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib
/tmp/tmpj3yLhWexe
/tmp/tmpj3yLhWexe:/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib/libc++abi.so.0.0:
undefined symbol '_Unwind_RaiseException'
lazy binding failed!
Segmentation fault (core dumped)
If I ask ld.so to bind all symbols at startup:
$ LD_LIBRARY_PATH=/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib LD_BIND_NOW=yes
/tmp/tmpj3yLhWexe
/tmp/tmpj3yLhWexe:/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib/libc++abi.so.0.0:
undefined symbol '_Unwind_GetIP'
/tmp/tmpj3yLhWexe:/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib/libc++abi.so.0.0:
undefined symbol '_Unwind_GetRegionStart'
/tmp/tmpj3yLhWexe:/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib/libc++abi.so.0.0:
undefined symbol '_Unwind_Resume'
/tmp/tmpj3yLhWexe:/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib/libc++abi.so.0.0:
undefined symbol '_Unwind_DeleteException'
/tmp/tmpj3yLhWexe:/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib/libc++abi.so.0.0:
undefined symbol '_Unwind_RaiseException'
/tmp/tmpj3yLhWexe:/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib/libc++abi.so.0.0:
undefined symbol '_Unwind_SetIP'
/tmp/tmpj3yLhWexe:/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib/libc++abi.so.0.0:
undefined symbol '_Unwind_GetLanguageSpecificData'
/tmp/tmpj3yLhWexe:/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib/libc++abi.so.0.0:
undefined symbol '_Unwind_SetGR'
/tmp/tmpj3yLhWexe:/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib/libc++.so.0.0:
undefined symbol '_Unwind_Resume'
Segmentation fault (core dumped)
These symbols normally comes with libgcc.a. The compile command-line use -lgcc,
and with eg++ the file is:
$ eg++ -print-libgcc-file-name
/usr/local/lib/gcc/x86_64-unknown-openbsd5.7/4.9.2/libgcc.a
Replacing '-lgcc' with complete path have the same result.
The final program don't include the symbol.
$ nm -g /tmp/tmpj3yLhWexe | grep _Unwind_RaiseException
$
whereas it exists in 4.9.2/libgcc.a:
$ nm -g /usr/local/lib/gcc/x86_64-unknown-openbsd5.7/4.9.2/libgcc.a | grep
_Unwind_RaiseException
000025b0 T _Unwind_RaiseException
But, if I use libgcc.a from base
(/usr/lib/gcc-lib/amd64-unknown-openbsd5.7/4.2.1/libgcc.a)
the program haven't problem, the symbols are correctly binded, and the
test program works well.
$ eg++ ... -lc -lm /usr/lib/gcc-lib/amd64-unknown-openbsd5.7/4.2.1/libgcc.a
-lpthread
$ LD_LIBRARY_PATH=/usr/ports/pobj/llvmorg-3.6.1/build-amd64/lib LD_BIND_NOW=yes
/tmp/tmpj3yLhWexe && echo ok
ok
$ nm -g /tmp/tmpj3yLhWexe | grep _Unwind_RaiseException
00003bc0 T _Unwind_RaiseException
Any clues would be welcome.
Thanks.
--
Sébastien Marie