[PATCH] D139938: [clang] Re-apply change to avoid passing -stdlib=libc++ spuriously to CC1 on Darwin

Louis Dionne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 20 15:28:27 PST 2022


ldionne added inline comments.


================
Comment at: compiler-rt/test/profile/lit.cfg.py:45-51
+# TODO: target_cflags can sometimes contain C++ only flags like -stdlib=<FOO>, which are
+#       ignored when compiling as C code. Passing this flag when compiling as C results in
+#       warnings that break tests that use -Werror.
+#       We remove -stdlib= from the cflags here to avoid problems, but the interaction between
+#       CMake and compiler-rt's tests should be reworked so that cflags don't contain C++ only
+#       flags.
+clang_cflags = [flag.replace('-stdlib=libc++', '').replace('-stdlib=libstdc++', '') for flag in clang_cflags]
----------------
This is not great, but I think this is OK as a stopgap. I don't want to remove `-stdlib=libc++` from `target_cflags` in this patch since it may cause other issues in the test suite.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139938/new/

https://reviews.llvm.org/D139938



More information about the cfe-commits mailing list