[Lldb-commits] [PATCH] remove CREATE_THREADS:=yes from api/multithreaded Makefile

Ed Maste emaste at freebsd.org
Fri Oct 17 05:53:50 PDT 2014


On FreeBSD the test fails to link without `-lpthread`:
```
os command: gmake clean LD_EXTRAS='-L/tank/emaste/src/llvm/build-nodebug/bin/../lib/python2.7/site-packages/../.. -llldb' EXE='test_listener_event_description' CFLAGS_EXTRAS='-std=c++11 -stdlib=libc++ -I/tank/emaste/src/llvm/tools/lldb/test/../include' CXX_SOURCES='driver.cpp listener_test.cpp test_listener_event_description.cpp'; gmake ARCH=amd64 CC="/usr/bin/clang" LD_EXTRAS='-L/tank/emaste/src/llvm/build-nodebug/bin/../lib/python2.7/site-packages/../.. -llldb' EXE='test_listener_event_description' CFLAGS_EXTRAS='-std=c++11 -stdlib=libc++ -I/tank/emaste/src/llvm/tools/lldb/test/../include' CXX_SOURCES='driver.cpp listener_test.cpp test_listener_event_description.cpp'
with pid: 92054
stdout: rm -f "test_listener_event_description"  driver.o listener_test.o test_listener_event_description.o driver.d listener_test.d test_listener_event_description.d  
rm -f -r 
rm -rf *.o *.d *.dSYM
/usr/bin/clang++ -std=c++11 -g -O0 -m64  -std=c++11 -stdlib=libc++ -I/tank/emaste/src/llvm/tools/lldb/test/../include -I/tank/emaste/src/llvm/tools/lldb/test/make/../../include   -c -o driver.o driver.cpp
/usr/bin/clang++ -std=c++11 -g -O0 -m64  -std=c++11 -stdlib=libc++ -I/tank/emaste/src/llvm/tools/lldb/test/../include -I/tank/emaste/src/llvm/tools/lldb/test/make/../../include   -c -o listener_test.o listener_test.cpp
/usr/bin/clang++ -std=c++11 -g -O0 -m64  -std=c++11 -stdlib=libc++ -I/tank/emaste/src/llvm/tools/lldb/test/../include -I/tank/emaste/src/llvm/tools/lldb/test/make/../../include   -c -o test_listener_event_description.o test_listener_event_description.cpp
/usr/bin/clang++  driver.o listener_test.o test_listener_event_description.o -g -O0 -m64  -std=c++11 -stdlib=libc++ -I/tank/emaste/src/llvm/tools/lldb/test/../include -I/tank/emaste/src/llvm/tools/lldb/test/make/../../include -L/tank/emaste/src/llvm/build-nodebug/bin/../lib/python2.7/site-packages/../.. -llldb  -o "test_listener_event_description"

stderr: /usr/bin/ld: G: invalid DSO for symbol `pthread_create@@FBSD_1.0' definition
//lib/libthr.so.3: could not read symbols: Bad value
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
```

What do you think about an ENABLE_STD_THREADS := YES for these tests, and then a system-dependent library addition?  My quick Google search suggests linking requirements for std::thread are quite system-dependent; AFAICT some Linuxes also need -lpthread -- perhaps a combination of the specific libc, libpthread, and libc++.

http://reviews.llvm.org/D5838






More information about the lldb-commits mailing list