Index: lldb/packages/Python/lldbsuite/test/make/Makefile.rules =================================================================== --- lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -392,12 +392,13 @@ # Nothing to do, this is already handled in # Android.rules. else - CXXFLAGS += -stdlib=libc++ - LDFLAGS += -stdlib=libc++ - endif - ifneq (,$(filter $(OS), FreeBSD Linux NetBSD)) ifneq (,$(LLVM_LIBS_DIR)) - LDFLAGS += -Wl,-rpath,$(LLVM_LIBS_DIR) + # Use the libc++ from the build dir + CXXFLAGS += -nostdlib++ + LDFLAGS += -L$(LLVM_LIBS_DIR) -Wl,-rpath,$(LLVM_LIBS_DIR) -lc++ + else + CXXFLAGS += -stdlib=libc++ + LDFLAGS += -stdlib=libc++ endif endif endif