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

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 26 01:37:40 PDT 2024


================
@@ -456,21 +492,15 @@ ifeq (1, $(USE_SYSTEM_STDLIB))
         endif
         CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(SDKROOT)/usr/include/c++/v1
         LDFLAGS += -L$(SDKROOT)/usr/lib -Wl,-rpath,$(SDKROOT)/usr/lib -lc++
+    else
+        ifneq (,$(findstring clang,$(CC)))
+            # Force clang looking for the gcc's headers at specific rootfs folder.
+            CXXFLAGS += -stdlib=libstdc++ $(GCC_TOOLCHAIN_FLAGS)
----------------
labath wrote:

Okay, but that is a clang configuration thing (`CLANG_DEFAULT_CXX_STDLIB` cmake option), right? Can't you set it to the actual c++ library that you intend to use instead of overriding it here? Or use a clang wrapper or a [configuration file](https://clang.llvm.org/docs/UsersManual.html#configuration-files) to override it externally? (FWIW, that's what we do internally to adapt the test suite to our (strange) internal infrastructure)

It's nice (maybe) that `-lstdc++` is ignored on windows, but I still this this is the wrong thing to do. `libstdc++` is definitely not the system default everywhere.

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


More information about the lldb-commits mailing list