================
@@ -386,6 +386,11 @@ ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP)
$(USE_SYSTEM_STDLIB)))
ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" ""
CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR)
endif
+
+ # If `-nostdlib++` is not passed, clang will link to the system's
stdlib.
+ ifeq ($(LDC), clang)
+ LDFLAGS += -nostdlib++ -nostdinc++
----------------
Michael137 wrote:
So it seems like `nostdlib++` is undocumented:
https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-nostdlib
But there is also
[`-nostdlib`/`--no-standard-libraries`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang1-nostdlib).
Which is also not documented.
>From my reading, looks like the two are synonymous. When specified, Clang
>won't add the `-lc++`/`-lstdc++` flags.
But you're saying we need `-lnostdlib++`? That sounds like it is the underlying
linker that Clang ends up invoking that needs this. I see GNU LD supports
these: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html. Is that why we
need them on Linux?
https://github.com/llvm/llvm-project/pull/164462
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits