Index: SingleSource/UnitTests/C++11/CMakeLists.txt =================================================================== --- SingleSource/UnitTests/C++11/CMakeLists.txt +++ SingleSource/UnitTests/C++11/CMakeLists.txt @@ -1,3 +1,3 @@ list(APPEND CXXFLAGS -std=c++11 -pthread) -list(APPEND LDFLAGS -lstdc++ -pthread) +list(APPEND LDFLAGS -lstdc++ -pthread -Wl,--whole-archive -lpthread -Wl,--no-whole-archive) llvm_singlesource() Index: SingleSource/UnitTests/C++11/Makefile =================================================================== --- SingleSource/UnitTests/C++11/Makefile +++ SingleSource/UnitTests/C++11/Makefile @@ -8,5 +8,5 @@ PROGRAMS_TO_SKIP += stdthreadbug endif -LDFLAGS += -lstdc++ -pthread +LDFLAGS += -lstdc++ -pthread -Wl,--whole-archive -lpthread -Wl,--no-whole-archive include $(LEVEL)/SingleSource/Makefile.singlesrc