[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)

Vladislav Dzhidzhoev via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 25 07:26:57 PDT 2024


================
@@ -378,11 +387,28 @@ ifeq (1, $(USE_SYSTEM_STDLIB))
 	endif
 endif
 
+# No C++ library has been specifieed. Use libstdc++ by default.
+ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB)))
+  # If no explicit request was made, but we have paths to a custom libcxx, use
+  # them.
+  ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),)
+    CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR)
+    ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" ""
+      CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR)
+    endif
+    LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++
+  # Otherwise no C++ library has been specified. Use stdc++ by default.
+  else
+    USE_SYSTEM_STDLIB := 1
+  endif
+endif
+
 ifeq (1,$(USE_LIBSTDCPP))
 	# Clang requires an extra flag: -stdlib=libstdc++
 	ifneq (,$(findstring clang,$(CC)))
-		CXXFLAGS += -stdlib=libstdc++
-		LDFLAGS += -stdlib=libstdc++
+    # Force clang looking for the gcc's headers at specific rootfs folder.
----------------
dzhidzhoev wrote:

Fixed.

https://github.com/llvm/llvm-project/pull/99266


More information about the lldb-commits mailing list