JDevlieghere created this revision.
JDevlieghere added reviewers: labath, dblaikie, clayborg, aprantl, mib.
Herald added a project: All.
JDevlieghere requested review of this revision.

Make sure we use the libc++ from the build dir. Currently, by passing 
`-stdlib=libc++`, we might pick up the system libc++ on macOS. This change 
ensures that if `LLVM_LIBS_DIR` is set, we try to use the libc++ from there.


https://reviews.llvm.org/D129166

Files:
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules


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


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
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to