Index: lldb/trunk/test/api/multithreaded/Makefile =================================================================== --- lldb/trunk/test/api/multithreaded/Makefile +++ lldb/trunk/test/api/multithreaded/Makefile @@ -1,6 +1,6 @@ LEVEL = ../../make -ENABLE_THREADS := YES +ENABLE_STD_THREADS := YES CXX_SOURCES := main.cpp include $(LEVEL)/Makefile.rules Index: lldb/trunk/test/make/Makefile.rules =================================================================== --- lldb/trunk/test/make/Makefile.rules +++ lldb/trunk/test/make/Makefile.rules @@ -120,9 +120,23 @@ LDFLAGS ?= $(CFLAGS) LDFLAGS += $(LD_EXTRAS) ifneq "$(OS)" "Windows_NT" - ifeq "$(ENABLE_THREADS)" "YES" - LDFLAGS += -lpthread - endif + ifeq "$(ENABLE_THREADS)" "YES" + LDFLAGS += -lpthread + else + ifeq "$(ENABLE_STD_THREADS)" "YES" + # with the specific combination of Linux, g++, std=c++11, adding the + # linker flag -lpthread, will cause a program to hang when a std::conditional_variable + # is used in a program that links lldb (see bugzilla 21553) + ifeq "$(OS)" "Linux" + ifeq (,$(findstring gcc,$(CC))) + # Linux, but not gcc + LDFLAGS += -lpthread + endif + else + LDFLAGS += -lpthread + endif + endif + endif endif OBJECTS = EXE ?= a.out