Skip to content

Conversation

@ldionne
Copy link
Member

@ldionne ldionne commented Dec 2, 2025

When libc++ is bootstrapped with clang, the resulting clang uses the just-built libc++ headers from /bin/../include/c++/v1. However, before this patch, clang would still use the system-provided libc++.dylib (usually in the Apple SDK) because it would fail to add the corresponding linker flag to find the just-built libc++. After this patch, Clang will instead link against the toolchain provided libc++.dylib in <install>/lib if it exists, which will result in programs being linked against corresponding libc++ headers and dylib.

Fixes #77653
rdar://107060541

…s one

When libc++ is bootstrapped with clang, the resulting clang uses the
just-built libcxx headers from <install>/bin/../include/c++/v1. However,
before this patch, clang would still use the system-provided libc++.dylib
(usually in the Apple SDK) because it would fail to add the corresponding
linker flag to find the just-built libc++. After this patch, Clang will
also add `-L <install>/bin/../lib` to the linker search paths, which will
allow the just-built libc++.dylib to be found.

Fixes llvm#77653
rdar://107060541
Copy link
Collaborator

@tstellar tstellar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this with a multi-target runtime build? My fix was slightly different so maybe you won't have the same problem, but I ran into an issue where clang would pick up the libc++ build for watchos instead of the one build for macOS. Here is an example of the error: https://github.com/llvm/llvm-project/actions/runs/18506722806/job/52742884609?pr=163026

@ian-twilightcoder
Copy link
Contributor

Where does this resolve in Xcode? If it goes to Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib or Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/lib/darwin then I don't think we want to be adding this, as the libraries in there don't have a usable install name.

@ldionne
Copy link
Member Author

ldionne commented Dec 2, 2025

Have you tested this with a multi-target runtime build? My fix was slightly different so maybe you won't have the same problem, but I ran into an issue where clang would pick up the libc++ build for watchos instead of the one build for macOS. Here is an example of the error: https://github.com/llvm/llvm-project/actions/runs/18506722806/job/52742884609?pr=163026

Yes, I am doing a bootstrapping build of Clang + compiler-rt + libc++ for multiple targets (well, it does that by default for compiler-rt AFAICT). However, I am running into a different issue that I am still investigating: the compiler-rt build is creating fat libraries for e.g. x86_64, arm64 and arm64e in a single go, i.e. within a single build of compiler-rt. However, the libc++ build creates a library built for a single target, and instead it gets built multiple times via runtimes/CMakeLists.txt. With this patch, we (correctly) link against the just-built <install>/usr/lib/libc++.dylib instead of the macOS system <SDK>/usr/lib/libc++.dylib. However, since that library is NOT a fat library (unlike the compiler-rt libraries), we end up with unresolved symbols for the architectures that aren't present in <install>/usr/lib/libc++.dylib when trying to link compiler-rt. I believe this is a pre-existing issue and it simply went unnoticed until now since we were silently using the SDK-provided libc++.dylib, which is a fat library.

Where does this resolve in Xcode? If it goes to Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib or Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/21/lib/darwin then I don't think we want to be adding this, as the libraries in there don't have a usable install name.

It would add -L <...>/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib, however in a default Apple setup with Xcode, there wouldn't be any libc++.dylib to pick up from that location (so it would end up using the SDK-provided libc++.tbd). There are a few other libraries like libclang.dylib or libIndexStore.dylib, so it does mean that in principle if you add -lclang you would find Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib after landing this patch whereas you wouldn't before this patch. I'm not sure I understand why that would be a problem, though? This is what's done on other platforms, for example on Linux the linker is passed -L /usr/lib/llvm-22/bin/../lib and that directory contains a bunch of stuff:

$ ls /usr/lib/llvm-22/bin/../lib
LLVMPolly.so                  libLLVMARMInfo.a                libLLVMBitReader.a               libLLVMDiff.a                 libLLVMHipStdPar.a              libLLVMM68kInfo.a            libLLVMOrcDebugging.a         libLLVMSelectionDAG.a         libLLVMVEInfo.a                   libLLVMipo.a          libclang.so                            libclangHandleLLVM.a              libclangTidyBugproneModule.a           libclangToolingInclusions.a         libomp.so.5
LLVMgold.so                   libLLVMARMUtils.a               libLLVMBitWriter.a               libLLVMDlltoolDriver.a        libLLVMIRPrinter.a              libLLVMMC.a                  libLLVMOrcJIT.a               libLLVMSparcAsmParser.a       libLLVMVectorize.a                libLTO.so             libclangAPINotes.a                     libclangIncludeCleaner.a          libclangTidyCERTModule.a               libclangToolingInclusionsStdlib.a   libompd.so
amdgcn-amd-amdhsa             libLLVMAVRAsmParser.a           libLLVMBitstreamReader.a         libLLVMExecutionEngine.a      libLLVMIRReader.a               libLLVMMCA.a                 libLLVMOrcShared.a            libLLVMSparcCodeGen.a         libLLVMWebAssemblyAsmParser.a     libLTO.so.22.0        libclangAST.a                          libclangIncludeFixer.a            libclangTidyConcurrencyModule.a        libclangToolingRefactoring.a        libomptarget.so
libLLVMAArch64AsmParser.a     libLLVMAsmParser.a              libLLVMCoroutines.a              libLLVMExtensions.a           libLLVMLanaiAsmParser.a         libLLVMMSP430Desc.a          libLLVMPowerPCDisassembler.a  libLLVMSystemZCodeGen.a       libLLVMWindowsManifest.a          libc++.a              libclangChangeNamespace.a              libclangMove.a                    libclangTidyLLVMModule.a               libclangdRemoteIndexServiceProto.a  nvptx64-nvidia-cuda
libLLVMAArch64CodeGen.a       libLLVMAsmPrinter.a             libLLVMCoverage.a                libLLVMFileCheck.a            libLLVMLanaiCodeGen.a           libLLVMMSP430Disassembler.a  libLLVMPowerPCInfo.a          libLLVMSystemZDesc.a          libLLVMX86AsmParser.a             libc++.modules.json   libclangCodeGen.a                      libclangParse.a                   libclangTidyLinuxKernelModule.a        libclangdRemoteMarshalling.a        python3
libLLVMAArch64Desc.a          libLLVMBOLTCore.a               libLLVMDWARFCFIChecker.a         libLLVMFrontendAtomic.a       libLLVMLanaiDesc.a              libLLVMMSP430Info.a          libLLVMProfileData.a          libLLVMSystemZDisassembler.a  libLLVMX86CodeGen.a               libc++.so             libclangCrossTU.a                      libclangQuery.a                   libclangTidyMPIModule.a                libclangdSupport.a                  python3.10
libLLVMAArch64Disassembler.a  libLLVMBOLTPasses.a             libLLVMDWARFLinker.a             libLLVMFrontendDirective.a    libLLVMLanaiDisassembler.a      libLLVMMipsAsmParser.a       libLLVMRISCVAsmParser.a       libLLVMSystemZInfo.a          libLLVMX86Desc.a                  libc++.so.1           libclangDaemon.a                       libclangReorderFields.a           libclangTidyMain.a                     libear
libLLVMAArch64Info.a          libLLVMBOLTProfile.a            libLLVMDWARFLinkerClassic.a      libLLVMFrontendDriver.a       libLLVMLanaiInfo.a              libLLVMMipsCodeGen.a         libLLVMRISCVCodeGen.a         libLLVMTableGen.a             libLLVMX86Disassembler.a          libc++.so.1.0         libclangDaemonTweaks.a                 libclangRewrite.a                 libclangTidyMiscModule.a               libfindAllSymbols.a
libLLVMAArch64Utils.a         libLLVMBOLTRewrite.a            libLLVMDWARFLinkerParallel.a     libLLVMFrontendHLSL.a         libLLVMLibDriver.a              libLLVMMipsDesc.a            libLLVMRISCVDesc.a            libLLVMTableGenBasic.a        libLLVMX86Info.a                  libc++abi.a           libclangDependencyScanning.a           libclangRewriteFrontend.a         libclangTidyModernizeModule.a          libgomp.so
libLLVMAMDGPUAsmParser.a      libLLVMBOLTRuntimeLibs.a        libLLVMDWP.a                     libLLVMFrontendOffloading.a   libLLVMLineEditor.a             libLLVMMipsDisassembler.a    libLLVMRISCVDisassembler.a    libLLVMTableGenCommon.a       libLLVMX86TargetMCA.a             libc++abi.so          libclangDirectoryWatcher.a             libclangSema.a                    libclangTidyObjCModule.a               libgomp.so.1
libLLVMAMDGPUCodeGen.a        libLLVMBOLTTargetAArch64.a      libLLVMDebugInfoBTF.a            libLLVMFrontendOpenACC.a      libLLVMLinker.a                 libLLVMMipsInfo.a            libLLVMRISCVInfo.a            libLLVMTarget.a               libLLVMXCoreCodeGen.a             libc++abi.so.1        libclangDoc.a                          libclangSerialization.a           libclangTidyOpenMPModule.a             libiomp5.so
libLLVMAMDGPUDesc.a           libLLVMBOLTTargetRISCV.a        libLLVMDebugInfoCodeView.a       libLLVMFrontendOpenMP.a       libLLVMLoongArchAsmParser.a     libLLVMNVPTXCodeGen.a        libLLVMRISCVTargetMCA.a       libLLVMTargetParser.a         libLLVMXCoreDesc.a                libc++abi.so.1.0      libclangDocSupport.a                   libclangStaticAnalyzerCheckers.a  libclangTidyPerformanceModule.a        liblldb-22.0.0.so
libLLVMAMDGPUDisassembler.a   libLLVMBOLTTargetX86.a          libLLVMDebugInfoDWARF.a          libLLVMFuzzMutate.a           libLLVMLoongArchCodeGen.a       libLLVMNVPTXDesc.a           libLLVMRemarks.a              libLLVMTelemetry.a            libLLVMXCoreDisassembler.a        libc++experimental.a  libclangDriver.a                       libclangStaticAnalyzerCore.a      libclangTidyPlugin.a                   liblldb-22.so
libLLVMAMDGPUInfo.a           libLLVMBOLTUtils.a              libLLVMDebugInfoDWARFLowLevel.a  libLLVMFuzzerCLI.a            libLLVMLoongArchDesc.a          libLLVMNVPTXInfo.a           libLLVMRuntimeDyld.a          libLLVMTextAPI.a              libLLVMXCoreInfo.a                libclang-22.0.0.so    libclangDynamicASTMatchers.a           libclangStaticAnalyzerFrontend.a  libclangTidyPortabilityModule.a        liblldb-22.so.1
libLLVMAMDGPUTargetMCA.a      libLLVMBPFAsmParser.a           libLLVMDebugInfoGSYM.a           libLLVMGlobalISel.a           libLLVMLoongArchDisassembler.a  libLLVMObjCARCOpts.a         libLLVMSPIRVAnalysis.a        libLLVMTextAPIBinaryReader.a  libLLVMXRay.a                     libclang-22.so        libclangEdit.a                         libclangSupport.a                 libclangTidyReadabilityModule.a        liblldb.so
libLLVMAMDGPUUtils.a          libLLVMBPFCodeGen.a             libLLVMDebugInfoLogicalView.a    libLLVMHexagonAsmParser.a     libLLVMLoongArchInfo.a          libLLVMObjCopy.a             libLLVMSPIRVCodeGen.a         libLLVMTransformUtils.a       libLLVMXtensaAsmParser.a          libclang-22.so.1      libclangExtractAPI.a                   libclangTidy.a                    libclangTidyUtils.a                    liblldb.so.1
libLLVMARMAsmParser.a         libLLVMBPFDesc.a                libLLVMDebugInfoMSF.a            libLLVMHexagonCodeGen.a       libLLVMM68kAsmParser.a          libLLVMObject.a              libLLVMSPIRVDesc.a            libLLVMVEAsmParser.a          libLLVMXtensaCodeGen.a            libclang-22.so.22     libclangFormat.a                       libclangTidyAbseilModule.a        libclangTidyZirconModule.a             liblldbIntelFeatures.so
...

So if I do e.g. echo "int main() {}" | clang++-22 -xc++ - -v -lclang, it find libclang.so just fine within its toolchain/lib directory. Why is that a problem?

@ian-twilightcoder
Copy link
Contributor

It's a problem for the dylibs because you'll end up with a broken executable for rpath reasons. I don't think it makes sense to add XcodeDefault.xctoolchain/usr/lib to everyone's search paths by default. There's nothing in there that anyone should use outside of Xcode, and things that get packaged inside of Xcode. Maybe @cachemeifyoucan or https://github.com/jakepetroules have other opinions.

@ldionne
Copy link
Member Author

ldionne commented Dec 2, 2025

It's a problem for the dylibs because you'll end up with a broken executable for rpath reasons.

That's only the case if you do add e.g. -lclang but fail to provide the appropriate -L path/to/libclang/location where the libclang.dylib you actually intend to link against is located -- which can't happen because that wouldn't link today.

@ian-twilightcoder
Copy link
Contributor

It's a problem for the dylibs because you'll end up with a broken executable for rpath reasons.

That's only the case if you do add e.g. -lclang but fail to provide the appropriate -L path/to/libclang/location where the libclang.dylib you actually intend to link against is located -- which can't happen because that wouldn't link today.

It's not link time that's the problem but load/run time due to the @loader_path in its LC_RPATH. The same is true for all of the dylibs in Xcode that aren't in SDKs. It allows Xcode to be relocatable but it means that nothing outside of the SDK is usable by anything outside of stuff in Xcode

Copy link
Contributor

@ian-twilightcoder ian-twilightcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't generally want this behavior for clients as it adds an undesired linker search path into Xcode, I think we want something special in clang/libc++ to find the libc++ that was previously built.

@cachemeifyoucan
Copy link
Collaborator

I think searching for libcxx dylib in the install directory for bootstrap situation makes sense but I am very worried about ingesting such a search path in such a high priority location (before sys root). That can cause user unintentionally pick up libraries in there. I would rather if clang++ can just explicitly link that libcxx if found with full path.

@ldionne
Copy link
Member Author

ldionne commented Dec 3, 2025

It's not link time that's the problem but load/run time due to the @loader_path in its LC_RPATH.

I don't understand. There's no RPATH added by this patch.

I think searching for libcxx dylib in the install directory for bootstrap situation makes sense but I am very worried about ingesting such a search path in such a high priority location (before sys root). That can cause user unintentionally pick up libraries in there.

Yeah, I agree this is not ideal and it was a tradeoff I was willing to make in order to fix this issue, but I think your suggestion is strictly better.

I would rather if clang++ can just explicitly link that libcxx if found with full path.

Another option would be to ship libc++ under a subdirectory and then add e.g. -L <install>/lib/c++/v1 instead. But that requires wider coordination amongst various platforms if we want to avoid making that change just for Darwin. So I think your suggestion to link against the file name explicitly is a great compromise.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Dec 3, 2025
@llvmbot
Copy link
Member

llvmbot commented Dec 3, 2025

@llvm/pr-subscribers-clang-driver

Author: Louis Dionne (ldionne)

Changes

When libc++ is bootstrapped with clang, the resulting clang uses the just-built libcxx headers from <install>/bin/../include/c++/v1. However, before this patch, clang would still use the system-provided libc++.dylib (usually in the Apple SDK) because it would fail to add the corresponding linker flag to find the just-built libc++. After this patch, Clang will also add -L &lt;install&gt;/bin/../lib to the linker search paths, which will allow the just-built libc++.dylib to be found.

Fixes #77653
rdar://107060541


Full diff: https://github.com/llvm/llvm-project/pull/170303.diff

10 Files Affected:

  • (modified) clang/lib/Driver/ToolChains/Darwin.cpp (+41-3)
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++.dylib ()
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++experimental.a ()
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/bin/.keep ()
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/include/c++/v1/.keep ()
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++.a ()
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++experimental.a ()
  • (modified) clang/test/Driver/darwin-header-search-libcxx.cpp (+2-2)
  • (added) clang/test/Driver/darwin-link-libcxx.cpp (+81)
  • (modified) clang/test/Driver/experimental-library-flag.cpp (+5-3)
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index fc3cd9030f71d..6665b54ca473d 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -2846,11 +2846,49 @@ void AppleMachO::AddCXXStdlibLibArgs(const ArgList &Args,
   CXXStdlibType Type = GetCXXStdlibType(Args);
 
   switch (Type) {
-  case ToolChain::CST_Libcxx:
-    CmdArgs.push_back("-lc++");
+  case ToolChain::CST_Libcxx: {
+    // On Darwin, we prioritize a libc++ located in the toolchain to a libc++
+    // located in the sysroot. Unlike the driver for most other platforms, on
+    // Darwin we do that by explicitly passing the library path to the linker
+    // to avoid having to add the toolchain's `lib/` directory to the linker
+    // search path, which would make other libraries findable as well.
+    //
+    // Prefering the toolchain library over the sysroot library matches the
+    // behavior we have for headers, where we prefer headers in the toolchain
+    // over headers in the sysroot if there are any. Note that it's important
+    // for the header search path behavior to match the link-time search path
+    // behavior to ensure that we link the program against a library that
+    // matches the headers that were used to compile it.
+    //
+    // Otherwise, we end up compiling against some set of headers and then
+    // linking against a different library (which, confusingly, shares the same
+    // name) which may have been configured with different options, be at a
+    // different version, etc.
+    SmallString<128> InstallLib = llvm::sys::path::parent_path(getDriver().Dir);
+    llvm::sys::path::append(InstallLib, "lib"); // <install>/bin/../lib
+    auto Link = [&](StringRef Library) {
+      SmallString<128> Shared(InstallLib);
+      llvm::sys::path::append(Shared,
+                              SmallString<4>("lib") + Library + ".dylib");
+      SmallString<128> Static(InstallLib);
+      llvm::sys::path::append(Static, SmallString<4>("lib") + Library + ".a");
+      SmallString<32> Relative("-l");
+      Relative += Library;
+
+      if (getVFS().exists(Shared)) {
+        CmdArgs.push_back(Args.MakeArgString(Shared));
+      } else if (getVFS().exists(Static)) {
+        CmdArgs.push_back(Args.MakeArgString(Static));
+      } else {
+        CmdArgs.push_back(Args.MakeArgString(Relative));
+      }
+    };
+
+    Link("c++");
     if (Args.hasArg(options::OPT_fexperimental_library))
-      CmdArgs.push_back("-lc++experimental");
+      Link("c++experimental");
     break;
+  }
 
   case ToolChain::CST_Libstdcxx:
     // Unfortunately, -lstdc++ doesn't always exist in the standard search path;
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++.dylib b/clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++.dylib
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++experimental.a b/clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++experimental.a
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/bin/.keep b/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/bin/.keep
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/include/c++/v1/.keep b/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/include/c++/v1/.keep
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++.a b/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++.a
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++experimental.a b/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++experimental.a
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/darwin-header-search-libcxx.cpp b/clang/test/Driver/darwin-header-search-libcxx.cpp
index cc8ec9ceb89b3..e8985a4e22b2f 100644
--- a/clang/test/Driver/darwin-header-search-libcxx.cpp
+++ b/clang/test/Driver/darwin-header-search-libcxx.cpp
@@ -92,7 +92,7 @@
 // CHECK-LIBCXX-SYSROOT_AND_TOOLCHAIN-1: "-internal-isystem" "[[TOOLCHAIN]]/usr/bin/../include/c++/v1"
 // CHECK-LIBCXX-SYSROOT_AND_TOOLCHAIN-1-NOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"
 
-// Make sure that using -nostdinc, -nostdinc++ or -nostdlib will drop both the toolchain
+// Make sure that using -nostdinc, -nostdinc++ or -nostdlibinc will drop both the toolchain
 // C++ include path and the sysroot one.
 //
 // RUN: %clang -### %s -fsyntax-only 2>&1 \
@@ -116,7 +116,7 @@
 // RUN:     -isysroot %S/Inputs/basic_darwin_sdk_usr_cxx_v1 \
 // RUN:     -stdlib=platform \
 // RUN:     -nostdinc++ \
-// RUN:   | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr \
+// RUN:   | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_cxx_v1 \
 // RUN:               -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain \
 // RUN:               --check-prefix=CHECK-LIBCXX-NOSTDINCXX %s
 // CHECK-LIBCXX-NOSTDINCXX: "-cc1"
diff --git a/clang/test/Driver/darwin-link-libcxx.cpp b/clang/test/Driver/darwin-link-libcxx.cpp
new file mode 100644
index 0000000000000..1c4f31b257512
--- /dev/null
+++ b/clang/test/Driver/darwin-link-libcxx.cpp
@@ -0,0 +1,81 @@
+// UNSUPPORTED: system-windows
+
+// Tests to check that we link against the toolchain-provided libc++ built library when it is provided.
+// This is required to prefer the toolchain's libc++ over the system's libc++, which matches the behavior
+// we have for header search paths.
+
+// When libc++.dylib is NOT in the toolchain, we should use -lc++ and fall back to the libc++
+// in the sysroot.
+//
+// (1) Without -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain_no_libcxx    \
+// RUN:               --check-prefix=CHECK-1 %s
+// CHECK-1: "/usr/bin/ld"
+// CHECK-1: "-lc++"
+// CHECK-1-NOT: "[[TOOLCHAIN]]/usr/lib"
+//
+// (2) With -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
+// RUN:     -fexperimental-library                                              \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain_no_libcxx    \
+// RUN:               --check-prefix=CHECK-2 %s
+// CHECK-2: "/usr/bin/ld"
+// CHECK-2: "-lc++" "-lc++experimental"
+// CHECK-2-NOT: "[[TOOLCHAIN]]/usr/lib"
+
+// When we have libc++.dylib in the toolchain, it should be used over the one in the sysroot.
+// There are a few cases worth testing.
+//
+// (1) Without -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin           \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain              \
+// RUN:               --check-prefix=CHECK-3 %s
+// CHECK-3: "/usr/bin/ld"
+// CHECK-3: "[[TOOLCHAIN]]/usr/lib/libc++.dylib"
+// CHECK-3-NOT: "-lc++"
+//
+// (2) With -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin           \
+// RUN:     -fexperimental-library                                              \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain              \
+// RUN:               --check-prefix=CHECK-4 %s
+// CHECK-4: "/usr/bin/ld"
+// CHECK-4: "[[TOOLCHAIN]]/usr/lib/libc++.dylib"
+// CHECK-4: "[[TOOLCHAIN]]/usr/lib/libc++experimental.a"
+// CHECK-4-NOT: "-lc++"
+// CHECK-4-NOT: "-lc++experimental"
+
+// When we have libc++.a in the toolchain instead of libc++.dylib, it should be
+// used over the one in the sysroot.
+//
+// (1) Without -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain_static/usr/bin    \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain_static       \
+// RUN:               --check-prefix=CHECK-5 %s
+// CHECK-5: "/usr/bin/ld"
+// CHECK-5: "[[TOOLCHAIN]]/usr/lib/libc++.a"
+// CHECK-5-NOT: "-lc++"
+//
+// (2) With -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain_static/usr/bin    \
+// RUN:     -fexperimental-library                                              \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain_static       \
+// RUN:               --check-prefix=CHECK-6 %s
+// CHECK-6: "/usr/bin/ld"
+// CHECK-6: "[[TOOLCHAIN]]/usr/lib/libc++.a"
+// CHECK-6: "[[TOOLCHAIN]]/usr/lib/libc++experimental.a"
+// CHECK-6-NOT: "-lc++"
+// CHECK-6-NOT: "-lc++experimental"
diff --git a/clang/test/Driver/experimental-library-flag.cpp b/clang/test/Driver/experimental-library-flag.cpp
index 62b007516897e..0546a09d5518b 100644
--- a/clang/test/Driver/experimental-library-flag.cpp
+++ b/clang/test/Driver/experimental-library-flag.cpp
@@ -18,6 +18,8 @@
 // CHECK: -fexperimental-library
 
 // Depending on the stdlib in use, we should (or not) pass -lc++experimental.
-// CHECK-LIBCXX: -lc++experimental
-// CHECK-LIBSTDCXX-NOT: -lc++experimental
-// CHECK-NOSTDLIB-NOT: -lc++experimental
+// Note that we don't check for `-lc++experimental` specifically, since some targets
+// like Darwin pass the path to the library explicitly instead of using `-lx`.
+// CHECK-LIBCXX: c++experimental
+// CHECK-LIBSTDCXX-NOT: c++experimental
+// CHECK-NOSTDLIB-NOT: c++experimental

@llvmbot
Copy link
Member

llvmbot commented Dec 3, 2025

@llvm/pr-subscribers-clang

Author: Louis Dionne (ldionne)

Changes

When libc++ is bootstrapped with clang, the resulting clang uses the just-built libcxx headers from <install>/bin/../include/c++/v1. However, before this patch, clang would still use the system-provided libc++.dylib (usually in the Apple SDK) because it would fail to add the corresponding linker flag to find the just-built libc++. After this patch, Clang will also add -L &lt;install&gt;/bin/../lib to the linker search paths, which will allow the just-built libc++.dylib to be found.

Fixes #77653
rdar://107060541


Full diff: https://github.com/llvm/llvm-project/pull/170303.diff

10 Files Affected:

  • (modified) clang/lib/Driver/ToolChains/Darwin.cpp (+41-3)
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++.dylib ()
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++experimental.a ()
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/bin/.keep ()
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/include/c++/v1/.keep ()
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++.a ()
  • (added) clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++experimental.a ()
  • (modified) clang/test/Driver/darwin-header-search-libcxx.cpp (+2-2)
  • (added) clang/test/Driver/darwin-link-libcxx.cpp (+81)
  • (modified) clang/test/Driver/experimental-library-flag.cpp (+5-3)
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index fc3cd9030f71d..6665b54ca473d 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -2846,11 +2846,49 @@ void AppleMachO::AddCXXStdlibLibArgs(const ArgList &Args,
   CXXStdlibType Type = GetCXXStdlibType(Args);
 
   switch (Type) {
-  case ToolChain::CST_Libcxx:
-    CmdArgs.push_back("-lc++");
+  case ToolChain::CST_Libcxx: {
+    // On Darwin, we prioritize a libc++ located in the toolchain to a libc++
+    // located in the sysroot. Unlike the driver for most other platforms, on
+    // Darwin we do that by explicitly passing the library path to the linker
+    // to avoid having to add the toolchain's `lib/` directory to the linker
+    // search path, which would make other libraries findable as well.
+    //
+    // Prefering the toolchain library over the sysroot library matches the
+    // behavior we have for headers, where we prefer headers in the toolchain
+    // over headers in the sysroot if there are any. Note that it's important
+    // for the header search path behavior to match the link-time search path
+    // behavior to ensure that we link the program against a library that
+    // matches the headers that were used to compile it.
+    //
+    // Otherwise, we end up compiling against some set of headers and then
+    // linking against a different library (which, confusingly, shares the same
+    // name) which may have been configured with different options, be at a
+    // different version, etc.
+    SmallString<128> InstallLib = llvm::sys::path::parent_path(getDriver().Dir);
+    llvm::sys::path::append(InstallLib, "lib"); // <install>/bin/../lib
+    auto Link = [&](StringRef Library) {
+      SmallString<128> Shared(InstallLib);
+      llvm::sys::path::append(Shared,
+                              SmallString<4>("lib") + Library + ".dylib");
+      SmallString<128> Static(InstallLib);
+      llvm::sys::path::append(Static, SmallString<4>("lib") + Library + ".a");
+      SmallString<32> Relative("-l");
+      Relative += Library;
+
+      if (getVFS().exists(Shared)) {
+        CmdArgs.push_back(Args.MakeArgString(Shared));
+      } else if (getVFS().exists(Static)) {
+        CmdArgs.push_back(Args.MakeArgString(Static));
+      } else {
+        CmdArgs.push_back(Args.MakeArgString(Relative));
+      }
+    };
+
+    Link("c++");
     if (Args.hasArg(options::OPT_fexperimental_library))
-      CmdArgs.push_back("-lc++experimental");
+      Link("c++experimental");
     break;
+  }
 
   case ToolChain::CST_Libstdcxx:
     // Unfortunately, -lstdc++ doesn't always exist in the standard search path;
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++.dylib b/clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++.dylib
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++experimental.a b/clang/test/Driver/Inputs/basic_darwin_toolchain/usr/lib/libc++experimental.a
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/bin/.keep b/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/bin/.keep
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/include/c++/v1/.keep b/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/include/c++/v1/.keep
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++.a b/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++.a
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++experimental.a b/clang/test/Driver/Inputs/basic_darwin_toolchain_static/usr/lib/libc++experimental.a
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/clang/test/Driver/darwin-header-search-libcxx.cpp b/clang/test/Driver/darwin-header-search-libcxx.cpp
index cc8ec9ceb89b3..e8985a4e22b2f 100644
--- a/clang/test/Driver/darwin-header-search-libcxx.cpp
+++ b/clang/test/Driver/darwin-header-search-libcxx.cpp
@@ -92,7 +92,7 @@
 // CHECK-LIBCXX-SYSROOT_AND_TOOLCHAIN-1: "-internal-isystem" "[[TOOLCHAIN]]/usr/bin/../include/c++/v1"
 // CHECK-LIBCXX-SYSROOT_AND_TOOLCHAIN-1-NOT: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"
 
-// Make sure that using -nostdinc, -nostdinc++ or -nostdlib will drop both the toolchain
+// Make sure that using -nostdinc, -nostdinc++ or -nostdlibinc will drop both the toolchain
 // C++ include path and the sysroot one.
 //
 // RUN: %clang -### %s -fsyntax-only 2>&1 \
@@ -116,7 +116,7 @@
 // RUN:     -isysroot %S/Inputs/basic_darwin_sdk_usr_cxx_v1 \
 // RUN:     -stdlib=platform \
 // RUN:     -nostdinc++ \
-// RUN:   | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr \
+// RUN:   | FileCheck -DSYSROOT=%S/Inputs/basic_darwin_sdk_usr_cxx_v1 \
 // RUN:               -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain \
 // RUN:               --check-prefix=CHECK-LIBCXX-NOSTDINCXX %s
 // CHECK-LIBCXX-NOSTDINCXX: "-cc1"
diff --git a/clang/test/Driver/darwin-link-libcxx.cpp b/clang/test/Driver/darwin-link-libcxx.cpp
new file mode 100644
index 0000000000000..1c4f31b257512
--- /dev/null
+++ b/clang/test/Driver/darwin-link-libcxx.cpp
@@ -0,0 +1,81 @@
+// UNSUPPORTED: system-windows
+
+// Tests to check that we link against the toolchain-provided libc++ built library when it is provided.
+// This is required to prefer the toolchain's libc++ over the system's libc++, which matches the behavior
+// we have for header search paths.
+
+// When libc++.dylib is NOT in the toolchain, we should use -lc++ and fall back to the libc++
+// in the sysroot.
+//
+// (1) Without -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain_no_libcxx    \
+// RUN:               --check-prefix=CHECK-1 %s
+// CHECK-1: "/usr/bin/ld"
+// CHECK-1: "-lc++"
+// CHECK-1-NOT: "[[TOOLCHAIN]]/usr/lib"
+//
+// (2) With -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin \
+// RUN:     -fexperimental-library                                              \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain_no_libcxx    \
+// RUN:               --check-prefix=CHECK-2 %s
+// CHECK-2: "/usr/bin/ld"
+// CHECK-2: "-lc++" "-lc++experimental"
+// CHECK-2-NOT: "[[TOOLCHAIN]]/usr/lib"
+
+// When we have libc++.dylib in the toolchain, it should be used over the one in the sysroot.
+// There are a few cases worth testing.
+//
+// (1) Without -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin           \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain              \
+// RUN:               --check-prefix=CHECK-3 %s
+// CHECK-3: "/usr/bin/ld"
+// CHECK-3: "[[TOOLCHAIN]]/usr/lib/libc++.dylib"
+// CHECK-3-NOT: "-lc++"
+//
+// (2) With -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain/usr/bin           \
+// RUN:     -fexperimental-library                                              \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain              \
+// RUN:               --check-prefix=CHECK-4 %s
+// CHECK-4: "/usr/bin/ld"
+// CHECK-4: "[[TOOLCHAIN]]/usr/lib/libc++.dylib"
+// CHECK-4: "[[TOOLCHAIN]]/usr/lib/libc++experimental.a"
+// CHECK-4-NOT: "-lc++"
+// CHECK-4-NOT: "-lc++experimental"
+
+// When we have libc++.a in the toolchain instead of libc++.dylib, it should be
+// used over the one in the sysroot.
+//
+// (1) Without -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain_static/usr/bin    \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain_static       \
+// RUN:               --check-prefix=CHECK-5 %s
+// CHECK-5: "/usr/bin/ld"
+// CHECK-5: "[[TOOLCHAIN]]/usr/lib/libc++.a"
+// CHECK-5-NOT: "-lc++"
+//
+// (2) With -fexperimental-library.
+// RUN: %clangxx -### %s 2>&1                                                   \
+// RUN:     --target=x86_64-apple-darwin                                        \
+// RUN:     -ccc-install-dir %S/Inputs/basic_darwin_toolchain_static/usr/bin    \
+// RUN:     -fexperimental-library                                              \
+// RUN:   | FileCheck -DTOOLCHAIN=%S/Inputs/basic_darwin_toolchain_static       \
+// RUN:               --check-prefix=CHECK-6 %s
+// CHECK-6: "/usr/bin/ld"
+// CHECK-6: "[[TOOLCHAIN]]/usr/lib/libc++.a"
+// CHECK-6: "[[TOOLCHAIN]]/usr/lib/libc++experimental.a"
+// CHECK-6-NOT: "-lc++"
+// CHECK-6-NOT: "-lc++experimental"
diff --git a/clang/test/Driver/experimental-library-flag.cpp b/clang/test/Driver/experimental-library-flag.cpp
index 62b007516897e..0546a09d5518b 100644
--- a/clang/test/Driver/experimental-library-flag.cpp
+++ b/clang/test/Driver/experimental-library-flag.cpp
@@ -18,6 +18,8 @@
 // CHECK: -fexperimental-library
 
 // Depending on the stdlib in use, we should (or not) pass -lc++experimental.
-// CHECK-LIBCXX: -lc++experimental
-// CHECK-LIBSTDCXX-NOT: -lc++experimental
-// CHECK-NOSTDLIB-NOT: -lc++experimental
+// Note that we don't check for `-lc++experimental` specifically, since some targets
+// like Darwin pass the path to the library explicitly instead of using `-lx`.
+// CHECK-LIBCXX: c++experimental
+// CHECK-LIBSTDCXX-NOT: c++experimental
+// CHECK-NOSTDLIB-NOT: c++experimental

@ldionne
Copy link
Member Author

ldionne commented Dec 3, 2025

As a side effect, this new way of linking against libc++ instead of passing -L also avoids tripping the issue with the compiler-rt build. Indeed, since compiler-rt forcibly passes -lc++ in its build (weird), Clang ends up passing both -lc++ and <toolchain>/lib/libc++.dylib to the linker. However, since <toolchain>/lib/libc++.dylib doesn't contain the right architecture, it gets ignored by the linker and we fall back on the explicitly-specified -lc++ by compiler-rt.

The compiler-rt build is very wrong for doing that, but if we can avoid having to fix it to unblock this fix, that's a good thing.

@ian-twilightcoder
Copy link
Contributor

It's not link time that's the problem but load/run time due to the @loader_path in its LC_RPATH.

I don't understand. There's no RPATH added by this patch.

Sorry it's not the the @loader_path in the LC_RPATH in the Xcode libraries that's the issue, it's that their LC_ID_DYLIB are all @rpath based, e.g. @rpath/libclang.dylib. That basically means they aren't usable outside of Xcode because you wouldn't be able to resolve @rpath to a given Xcode installation.

@ian-twilightcoder
Copy link
Contributor

ian-twilightcoder commented Dec 3, 2025

I'm still not sure this is a good idea, if there ever was a XcodeDefault.xctoolchain/usr/lib/libc++.dylib it wouldn't be linkable from anything outside of Xcode (its LC_ID_DYLIB would either be an absolute path that would break if someone had their Xcode in a different location, or it would be @rpath based which would break for anyone not contributing to Xcode). Why can't we solve this with an extra linker search path in the bootstrapping case?

@ldionne
Copy link
Member Author

ldionne commented Dec 4, 2025

I'm still not sure this is a good idea, if there ever was a XcodeDefault.xctoolchain/usr/lib/libc++.dylib it wouldn't be linkable from anything outside of Xcode (its LC_ID_DYLIB would either be an absolute path that would break if someone had their Xcode in a different location, or it would be @rpath based which would break for anyone not contributing to Xcode). Why can't we solve this with an extra linker search path in the bootstrapping case?

This whole change basically has nothing to do with Xcode or the way we distribute libc++ on Apple platforms as a system library. It's all about unbreaking the toolchain we produce in upstream builds of Clang and libc++. On Apple platforms, libc++ may be shipped in two different ways:

  1. As a system library, with the headers and .tbd part of the SDK, and with the .dylib as part of the shared cache. When that's the case, Clang (whether AppleClang or LLVM Clang) will pick up libc++ from the -isysroot. This is the way we (at Apple) build and ship libc++.
  2. Then, there's how everyone else is using libc++ based on upstream LLVM Clang: as part of the toolchain. In that world, we build Clang and libc++ within a single bootstrapping build, and libc++ is installed at <toolchain>/usr/include/c++/v1 and <toolchain>/usr/lib. When you invoke Clang, you still provide a SDK because you need various headers to do anything useful (e.g. the libc headers and any other Apple system headers you might want to use). But that SDK already contains a different copy of libc++ under <SDK>/usr/include/c++/v1 and <SDK>/usr/lib (which has an arbitrary other version and has been configured differently -- think of it as being an entirely different library which happens to have the same name). Hence, Clang needs to do something in order to pick up the libc++ that you actually want to use, which is the one you built as part of your bootstrap and are shipping with your toolchain. That's why the Clang driver looks at whether <toolchain>/usr/include/c++/v1 exists, and if so, it uses that path instead of <SDK>/usr/include/c++/v1 for the C++ stdlib headers. Unfortunately, it doesn't do the same thing for the dylib, which leads to it mixing <toolchain>/usr/include/c++/v1 with <SDK>/usr/lib. Not only does that make no sense, this actually breaks in all kinds of way since, as I said, they're two different libraries. So for example the headers will advertise that some function exists in the dylib, but the dylib actually doesn't contain that function. At the moment, this fundamentally breaks any attempt to build and use upstream libc++ on Darwin as part of a toolchain -- which is pretty much as bad as it gets. This has resulted in numerous issues like the comments in [D148266] [clang][driver] Linking to just-built libc++.dylib when bootstrapping libc++ with clang #77653 and Homebrew being broken: Undefined reference issues when mixing Homebrew LLVM 21.1.0 with system libc++ Homebrew/homebrew-core#235411.

So, why is that more of a problem now than it was in the past? Simply because we've introduced more differences between the libc++.dylib we ship in the SDK and the upstream one (e.g. typed memory allocation). We've also added new symbols to the built library upstream, which means that the headers now think that libc++.dylib should provide those symbols. But if you link against the wrong libc++.dylib, well obviously they're not present.

So, again, this has nothing to do with the way we ship libc++ within Xcode. In the Xcode case, there is no libc++ in the toolchain, so we always fall back to the SDK (for headers and for linking).

I'm still not sure this is a good idea, if there ever was a XcodeDefault.xctoolchain/usr/lib/libc++.dylib it wouldn't be linkable from anything outside of Xcode

So, hopefully that is made clear by the above, but there is no intention to ever have XcodeDefault.xctoolchain/usr/lib/libc++.dylib.

@ian-twilightcoder
Copy link
Contributor

Oh I see, and I was missing the part in AppleMachO::AddClangCXXStdlibIncludeArgs where we add the toolchain path. Thanks for the explanation. I guess we just have to know that we can't make a XcodeDefault.xctoolchain/usr/lib/libc++.dylib or weird things will happen but this seems fine minus the "can we really use parent_path" thing.

Copy link
Collaborator

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version LGTM

@ldionne
Copy link
Member Author

ldionne commented Dec 4, 2025

Thanks for the reviews.

For information, I'm currently investigating some new failures I'm seeing when doing a bootstrapping build. The compiler-rt build is complaining about something new I wasn't seeing before (but I did a clean reinstall of my system in between, so some stuff may have changed). Before I land this, I'll also want to make sure I understand the RPATH story for the toolchain we're building upstream -- since it's the first time we'll actually be linking against the libc++.dylib that we build in the toolchain, that is something new we haven't tested yet and I want to make sure everything behaves correctly. (Specifically, I want to check the rpath and the install_name we use for libc++ in the toolchain, and do an end-to-end test by e.g. modifying the Homebrew formula for LLVM and building from source to ensure everything works).

@ldionne
Copy link
Member Author

ldionne commented Dec 4, 2025

Okay, I got the compiler-rt build to stop complaining. I think something that was previously a warning in ld was promoted to an error, and that why it started failing upon updating my system.

I'm investigating the rpath situation now:

% otool -l build/bootstrap/install/lib/libc++.dylib
...
Load command 4
          cmd LC_ID_DYLIB
      cmdsize 48
         name @rpath/libc++.1.dylib (offset 24)

% otool -L build/bootstrap/install/lib/libc++.dylib
build/bootstrap/install/lib/libc++.dylib:
	@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	@rpath/libc++abi.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	@rpath/libunwind.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1358.0.0)

So libc++.dylib is given the install_name @rpath/libc++.1.dylib, which means that any executable linked against it will use its runtime LC_RPATH to search for it. Obviously, since we're shipping a toolchain and we can't predict where it's going to land, we can't hardcode a full absolute path here (like we do for the system libc++, which is /usr/lib/libc++.dylib). So I think this is the only thing we can do realistically.

Now, when we build an executable using that toolchain:

cat <<EOF > x.cpp
#include <string>

int main() {
    std::string s;
    s.resize(10000);
    s[44] = 'x';
    return s[44] == 'x' ? 0 : 1;
}
EOF

./build/bootstrap/bin/clang++ x.cpp -isysroot $(xcrun --show-sdk-path) -v

First, I can see that the executable references the rpath-relative libc++.dylib, as we'd expect:

% otool -L a.out
a.out:
	@rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1358.0.0)

However, when I run the executable, it fails at load time because it can't find the dylib in question:

% ./a.out
dyld[30071]: Library not loaded: @rpath/libc++.1.dylib
  Referenced from: <3D71B5D9-1D7D-3104-BBAC-65C6DC42DD68> /Users/ldionne/code/llvm-project/a.out
  Reason: no LC_RPATH's found

This all makes sense: we haven't told anyone what rpath the executable should be using. So, if we now tell it to use the right rpath when compiling:

% ./build/bootstrap/bin/clang++ x.cpp -isysroot $(xcrun --show-sdk-path) -Wl,-rpath,$PWD/build/bootstrap/install/lib -v
% ./a.out

Now it's happy. So, I believe the right thing to do here is for whoever is actually installing the toolchain into its final destination to either:

  1. Somehow configure the compiler to always insert the appropriate rpath based on the final location of the toolchain, or
  2. To change the installation name of libc++.dylib in its final install location such that it's an absolute path. That way, when the compiler links against libc++.dylib in the installed toolchain, it will encode a dependency on that absolute path in the executable, no need for a LC_RPATH entry. The dynamic loader will then find it at the absolute path within the toolchain. If you move the toolchain around, you'll break any program that was built with that toolchain a-priori, but I would say that's expected.

I believe (2) is what everybody shipping a toolchain is already doing. I'm mostly writing this down to leave breadcrumbs of my reasoning. @tstellar, can you validate that we're OK with producing a toolchain that contains @rpath-relative install names and letting the final distributor fix up the install names appropriately? That seems to be what we do for compiler-rt dylibs.

@ldionne
Copy link
Member Author

ldionne commented Dec 5, 2025

Alright, I've tested with a slightly modified Homebrew formula (they change the installation directory of libc++.dylib and I think we have to undo that), and everything seems to be working. I'm comfortable with landing this now.

@ldionne
Copy link
Member Author

ldionne commented Dec 5, 2025

Note that it's possible that landing this patch is going to expose places where we were previously using the SDK libc++ headers when we really intended to be using the toolchain libc++ headers. The failure mode for that would be that a program is compiled against SDK headers, and hence makes references to stuff that's only present in Apple's system libc++.dylib. But then, if the program ends up being linked against the toolchain's libc++.dylib, which might not contain the same definitions, we'd get an error.

Without proper CI on Apple platforms (🥲), I don't know how to shake those out, so I guess we'll have to land this and be ready to fix stuff forward, and potentially revert.

@ldionne ldionne merged commit 190b8d0 into llvm:main Dec 5, 2025
11 checks passed
@ldionne ldionne deleted the review/clang-link-against-built-libcxx-darwin branch December 5, 2025 18:06
@ldionne
Copy link
Member Author

ldionne commented Dec 5, 2025

Just for posterity, here are my changes to the Homebrew formula:

diff --git a/Formula/l/llvm.rb b/Formula/l/llvm.rb
index 74373c08297..49c174df36f 100644
--- a/Formula/l/llvm.rb
+++ b/Formula/l/llvm.rb
@@ -9,6 +9,12 @@ class Llvm < Formula
     url "https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.7/llvm-project-21.1.7.src.tar.xz"
     sha256 "e5b65fd79c95c343bb584127114cb2d252306c1ada1e057899b6aacdd445899e"
 
+    # Apply https://github.com/llvm/llvm-project/pull/170303
+    patch do
+      url "https://github.com/llvm/llvm-project/pull/170303.diff"
+      # sha256 ""
+    end
+
     # Fix triple config loading for clang-cl
     # https://github.com/llvm/llvm-project/pull/111397
     patch do
@@ -168,16 +174,13 @@ class Llvm < Formula
       args << "-DFFI_INCLUDE_DIR=#{macos_sdk}/usr/include/ffi"
       args << "-DFFI_LIBRARY_DIR=#{macos_sdk}/usr/lib"
 
-      libcxx_install_libdir = lib/"c++"
       libunwind_install_libdir = lib/"unwind"
-      libcxx_rpaths = [loader_path, rpath(source: libcxx_install_libdir, target: libunwind_install_libdir)]
+      libcxx_rpaths = [loader_path, rpath(source: lib, target: libunwind_install_libdir)]
 
       args << "-DLLVM_BUILD_LLVM_C_DYLIB=ON"
       args << "-DLLVM_ENABLE_LIBCXX=ON"
       args << "-DLIBCXX_PSTL_BACKEND=libdispatch"
-      args << "-DLIBCXX_INSTALL_LIBRARY_DIR=#{libcxx_install_libdir}"
       args << "-DLIBUNWIND_INSTALL_LIBRARY_DIR=#{libunwind_install_libdir}"
-      args << "-DLIBCXXABI_INSTALL_LIBRARY_DIR=#{libcxx_install_libdir}"
       runtimes_cmake_args << "-DCMAKE_INSTALL_RPATH=#{libcxx_rpaths.join("|")}"
 
       # Disable builds for OSes not supported by the CLT SDK.

I'll create a patch to propose these changes once this change has settled down.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 5, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime-2 running on rocm-worker-hw-02 while building clang,compiler-rt at step 7 "Add check check-clang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/18578

Here is the relevant piece of the build log for the reference
Step 7 (Add check check-clang) failure: test (failure)
******************** TEST 'Clang :: Driver/darwin-link-libcxx.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 11
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang --driver-mode=g++ -### /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp 2>&1                                                        --target=x86_64-apple-darwin                                             -ccc-install-dir /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin    | /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/FileCheck -DTOOLCHAIN=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx                   --check-prefix=CHECK-1 /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp
# executed command: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang --driver-mode=g++ '-###' /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp --target=x86_64-apple-darwin -ccc-install-dir /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin
# note: command had no output on stdout or stderr
# executed command: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/FileCheck -DTOOLCHAIN=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx --check-prefix=CHECK-1 /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp
# .---command stderr------------
# | /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp:16:13: error: CHECK-1: expected string not found in input
# | // CHECK-1: "/usr/bin/ld"
# |             ^
# | <stdin>:1:1: note: scanning from here
# | clang version 22.0.0git (https://github.com/llvm/llvm-project.git 190b8d0b4f19e1c3d68c5d153ec7be71a9969192)
# | ^
# | <stdin>:6:1284: note: possible intended match here
# |  "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang-22" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/tools/clang/test/Driver" "-fcoverage-compilation-dir=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/tools/clang/test/Driver" "-resource-dir" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/tmp/lit-tmp-08eqxa03/darwin-link-libcxx-e7a1b7.o" "-x" "c++" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp"
# |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^
# | 
# | Input file: <stdin>
# | Check file: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: clang version 22.0.0git (https://github.com/llvm/llvm-project.git 190b8d0b4f19e1c3d68c5d153ec7be71a9969192) 
# | check:16'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |             2: Target: x86_64-apple-darwin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             3: Thread model: posix 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~
# |             4: InstalledDir: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             5: Build config: +assertions 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             6:  "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/clang-22" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/tools/clang/test/Driver" "-fcoverage-compilation-dir=/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/tools/clang/test/Driver" "-resource-dir" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/tmp/lit-tmp-08eqxa03/darwin-link-libcxx-e7a1b7.o" "-x" "c++" "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp" 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~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~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:16'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 possible intended match
# |             7:  "/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/bin/ld64.lld" "-demangle" "-dynamic" "-arch" "x86_64" "-platform_version" "macos" "10.4.0" "10.4.0" "-mllvm" "-enable-linkonceodr-outlining" "-o" "a.out" "-lcrt1.o" "/tmp/lit-tmp-08eqxa03/darwin-link-libcxx-e7a1b7.o" "-lc++" "-lSystem" "-lgcc_s.1" 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 5, 2025

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-b-1 while building clang,compiler-rt at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/29386

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[863/1469] Running the Clang regression tests
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using clang: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/clang
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find cir-opt in /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find clang-repl in /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/ld.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/lld-link
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/ld64.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/wasm-ld
-- Testing: 23293 tests, 60 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50
FAIL: Clang :: Driver/darwin-link-libcxx.cpp (12431 of 23293)
******************** TEST 'Clang :: Driver/darwin-link-libcxx.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 11
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/clang --driver-mode=g++ -### /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp 2>&1                                                        --target=x86_64-apple-darwin                                             -ccc-install-dir /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin    | /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/FileCheck -DTOOLCHAIN=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx                   --check-prefix=CHECK-1 /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# executed command: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/clang --driver-mode=g++ '-###' /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp --target=x86_64-apple-darwin -ccc-install-dir /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin
# executed command: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/FileCheck -DTOOLCHAIN=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx --check-prefix=CHECK-1 /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# .---command stderr------------
# | /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp:16:13: error: CHECK-1: expected string not found in input
# | // CHECK-1: "/usr/bin/ld"
# |             ^
# | <stdin>:1:1: note: scanning from here
# | Fuchsia clang version 22.0.0git (https://github.com/llvm/llvm-project.git 190b8d0b4f19e1c3d68c5d153ec7be71a9969192)
# | ^
# | <stdin>:5:1331: note: possible intended match here
# |  "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/llvm" "clang" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/tools/clang/test/Driver" "-fcoverage-compilation-dir=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/tools/clang/test/Driver" "-resource-dir" "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/tmp/lit-tmp-a0hhfomi/darwin-link-libcxx-2893a8.o" "-x" "c++" "/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp"
# |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
# | 
# | Input file: <stdin>
# | Check file: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: Fuchsia clang version 22.0.0git (https://github.com/llvm/llvm-project.git 190b8d0b4f19e1c3d68c5d153ec7be71a9969192) 
# | check:16'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |             2: Target: x86_64-apple-darwin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             3: Thread model: posix 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~
# |             4: InstalledDir: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             5:  "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/llvm" "clang" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/tools/clang/test/Driver" "-fcoverage-compilation-dir=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/tools/clang/test/Driver" "-resource-dir" "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/tmp/lit-tmp-a0hhfom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~~~~~~~~~~~~~~~~~~~~~~
# | check:16'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     possible intended match
Step 7 (check) failure: check (failure)
...
[863/1469] Running the Clang regression tests
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using clang: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/clang
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find cir-opt in /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find clang-repl in /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/ld.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using lld-link: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/lld-link
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using ld64.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/ld64.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:564: note: using wasm-ld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/wasm-ld
-- Testing: 23293 tests, 60 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50
FAIL: Clang :: Driver/darwin-link-libcxx.cpp (12431 of 23293)
******************** TEST 'Clang :: Driver/darwin-link-libcxx.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 11
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/clang --driver-mode=g++ -### /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp 2>&1                                                        --target=x86_64-apple-darwin                                             -ccc-install-dir /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin    | /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/FileCheck -DTOOLCHAIN=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx                   --check-prefix=CHECK-1 /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# executed command: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/clang --driver-mode=g++ '-###' /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp --target=x86_64-apple-darwin -ccc-install-dir /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin
# executed command: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/FileCheck -DTOOLCHAIN=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx --check-prefix=CHECK-1 /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# .---command stderr------------
# | /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp:16:13: error: CHECK-1: expected string not found in input
# | // CHECK-1: "/usr/bin/ld"
# |             ^
# | <stdin>:1:1: note: scanning from here
# | Fuchsia clang version 22.0.0git (https://github.com/llvm/llvm-project.git 190b8d0b4f19e1c3d68c5d153ec7be71a9969192)
# | ^
# | <stdin>:5:1331: note: possible intended match here
# |  "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/llvm" "clang" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/tools/clang/test/Driver" "-fcoverage-compilation-dir=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/tools/clang/test/Driver" "-resource-dir" "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/tmp/lit-tmp-a0hhfomi/darwin-link-libcxx-2893a8.o" "-x" "c++" "/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp"
# |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ^
# | 
# | Input file: <stdin>
# | Check file: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: Fuchsia clang version 22.0.0git (https://github.com/llvm/llvm-project.git 190b8d0b4f19e1c3d68c5d153ec7be71a9969192) 
# | check:16'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |             2: Target: x86_64-apple-darwin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             3: Thread model: posix 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~
# |             4: InstalledDir: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             5:  "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/bin/llvm" "clang" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/tools/clang/test/Driver" "-fcoverage-compilation-dir=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/tools/clang/test/Driver" "-resource-dir" "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-sbatnwrm/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exce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~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:16'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     possible intended match

@Kewen12
Copy link
Contributor

Kewen12 commented Dec 5, 2025

Hi! It seems this PR breaks bots. Could you please take a look? Thanks!

https://lab.llvm.org/buildbot/#/builders/10/builds/18578

@zeroomega
Copy link
Contributor

We are seeing test failures on Clang :: Driver/darwin-link-libcxx.cpp after this patch landed:

Exit Code: 1

Command Output (stdout):
--
# RUN: at line 11
/b/s/w/ir/x/w/llvm_build/bin/clang --driver-mode=g++ -### /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/darwin-link-libcxx.cpp 2>&1                                                        --target=x86_64-apple-darwin                                             -ccc-install-dir /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin    | /b/s/w/ir/x/w/llvm_build/bin/FileCheck -DTOOLCHAIN=/b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx                   --check-prefix=CHECK-1 /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# executed command: /b/s/w/ir/x/w/llvm_build/bin/clang --driver-mode=g++ '-###' /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/darwin-link-libcxx.cpp --target=x86_64-apple-darwin -ccc-install-dir /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin
# executed command: /b/s/w/ir/x/w/llvm_build/bin/FileCheck -DTOOLCHAIN=/b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx --check-prefix=CHECK-1 /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# .---command stderr------------
# | /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/darwin-link-libcxx.cpp:16:13: error: CHECK-1: expected string not found in input
# | // CHECK-1: "/usr/bin/ld"
# |             ^
# | <stdin>:1:1: note: scanning from here
# | Fuchsia clang version 22.0.0git (https://llvm.googlesource.com/llvm-project 190b8d0b4f19e1c3d68c5d153ec7be71a9969192)
# | ^
# | <stdin>:6:1083: note: possible intended match here
# |  "/b/s/w/ir/x/w/llvm_build/bin/llvm" "clang" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/b/s/w/ir/x/w/llvm_build/tools/clang/test/Driver" "-fcoverage-compilation-dir=/b/s/w/ir/x/w/llvm_build/tools/clang/test/Driver" "-resource-dir" "/b/s/w/ir/x/w/llvm_build/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/b/s/w/ir/x/w/llvm_build/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/b/s/w/ir/x/t/lit-tmp-uv_390yr/darwin-link-libcxx-8c3d38.o" "-x" "c++" "/b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/darwin-link-libcxx.cpp"
# |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^
# | 
# | Input file: <stdin>
# | Check file: /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: Fuchsia clang version 22.0.0git (https://llvm.googlesource.com/llvm-project 190b8d0b4f19e1c3d68c5d153ec7be71a9969192) 
# | check:16'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |             2: Target: x86_64-apple-darwin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             3: Thread model: posix 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~
# |             4: InstalledDir: /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             5: Build config: +assertions 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             6:  "/b/s/w/ir/x/w/llvm_build/bin/llvm" "clang" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/b/s/w/ir/x/w/llvm_build/tools/clang/test/Driver" "-fcoverage-compilation-dir=/b/s/w/ir/x/w/llvm_build/tools/clang/test/Driver" "-resource-dir" "/b/s/w/ir/x/w/llvm_build/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/b/s/w/ir/x/w/llvm_build/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/b/s/w/ir/x/t/lit-tmp-uv_390yr/darwin-link-libcxx-8c3d38.o" "-x" "c++" "/b/s/w/ir/x/w/llvm-llvm-project/clang/test/Driver/darwin-link-libcxx.cpp" 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~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~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:16'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          possible intended match
# |             7:  "/b/s/w/ir/x/w/llvm_build/bin/ld64.lld" "-demangle" "-dynamic" "-arch" "x86_64" "-platform_version" "macos" "10.4.0" "10.4.0" "-mllvm" "-enable-linkonceodr-outlining" "-o" "a.out" "-lcrt1.o" "/b/s/w/ir/x/t/lit-tmp-uv_390yr/darwin-link-libcxx-8c3d38.o" "-lc++" "-lSystem" "-lgcc_s.1" 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

Failed task: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-host-linux-x64/b8696300887931519761/overview

Could you revert your change and fix it please?

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 5, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-sles-build-only running on rocm-worker-hw-04-sles while building clang,compiler-rt at step 6 "Add check check-clang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/140/builds/35231

Here is the relevant piece of the build log for the reference
Step 6 (Add check check-clang) failure: test (failure)
******************** TEST 'Clang :: Driver/darwin-link-libcxx.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 11
/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/clang --driver-mode=g++ -### /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp 2>&1                                                        --target=x86_64-apple-darwin                                             -ccc-install-dir /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin    | /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/FileCheck -DTOOLCHAIN=/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx                   --check-prefix=CHECK-1 /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp
# executed command: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/clang --driver-mode=g++ '-###' /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp --target=x86_64-apple-darwin -ccc-install-dir /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin
# executed command: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/FileCheck -DTOOLCHAIN=/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx --check-prefix=CHECK-1 /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp
# .---command stderr------------
# | /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp:16:13: error: CHECK-1: expected string not found in input
# | // CHECK-1: "/usr/bin/ld"
# |             ^
# | <stdin>:1:1: note: scanning from here
# | clang version 22.0.0git (https://github.com/llvm/llvm-project.git 190b8d0b4f19e1c3d68c5d153ec7be71a9969192)
# | ^
# | <stdin>:6:1279: note: possible intended match here
# |  "/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/clang-22" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/tools/clang/test/Driver" "-fcoverage-compilation-dir=/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/tools/clang/test/Driver" "-resource-dir" "/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/tmp/lit-tmp-r8qgmgeg/darwin-link-libcxx-bea980.o" "-x" "c++" "/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp"
# |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ^
# | 
# | Input file: <stdin>
# | Check file: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: clang version 22.0.0git (https://github.com/llvm/llvm-project.git 190b8d0b4f19e1c3d68c5d153ec7be71a9969192) 
# | check:16'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |             2: Target: x86_64-apple-darwin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             3: Thread model: posix 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~
# |             4: InstalledDir: /home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             5: Build config: +assertions 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             6:  "/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/clang-22" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/tools/clang/test/Driver" "-fcoverage-compilation-dir=/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/tools/clang/test/Driver" "-resource-dir" "/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/tmp/lit-tmp-r8qgmgeg/darwin-link-libcxx-bea980.o" "-x" "c++" "/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.src/clang/test/Driver/darwin-link-libcxx.cpp" 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~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~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:16'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                possible intended match
# |             7:  "/home/botworker/bbot/builds/openmp-offload-sles-build/llvm.build/bin/ld64.lld" "-demangle" "-dynamic" "-arch" "x86_64" "-platform_version" "macos" "10.4.0" "10.4.0" "-mllvm" "-enable-linkonceodr-outlining" "-o" "a.out" "-lcrt1.o" "/tmp/lit-tmp-r8qgmgeg/darwin-link-libcxx-bea980.o" "-lc++" "-lSystem" "-lgcc_s.1" 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 5, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-ubuntu-x-aarch64-pauth running on as-builder-11 while building clang,compiler-rt at step 15 "test-check-clang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/224/builds/206

Here is the relevant piece of the build log for the reference
Step 15 (test-check-clang) failure: Test just built components: check-clang completed (failure)
******************** TEST 'Clang :: Driver/darwin-link-libcxx.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 11
/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/bin/clang --driver-mode=g++ -### /home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp 2>&1                                                        --target=x86_64-apple-darwin                                             -ccc-install-dir /home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin    | /home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/bin/FileCheck -DTOOLCHAIN=/home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx                   --check-prefix=CHECK-1 /home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# executed command: /home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/bin/clang --driver-mode=g++ '-###' /home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp --target=x86_64-apple-darwin -ccc-install-dir /home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin
# executed command: /home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/bin/FileCheck -DTOOLCHAIN=/home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx --check-prefix=CHECK-1 /home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# .---command stderr------------
# | /home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp:16:13: error: CHECK-1: expected string not found in input
# | // CHECK-1: "/usr/bin/ld"
# |             ^
# | <stdin>:1:1: note: scanning from here
# | clang version 22.0.0git (https://github.com/llvm/llvm-project.git 190b8d0b4f19e1c3d68c5d153ec7be71a9969192)
# | ^
# | <stdin>:6:1244: note: possible intended match here
# |  "/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/bin/clang-22" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/tools/clang/test/Driver" "-fcoverage-compilation-dir=/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/tools/clang/test/Driver" "-resource-dir" "/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/tmp/lit-tmp-8fjdt7mr/darwin-link-libcxx-4337cd.o" "-x" "c++" "/home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp"
# |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^
# | 
# | Input file: <stdin>
# | Check file: /home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: clang version 22.0.0git (https://github.com/llvm/llvm-project.git 190b8d0b4f19e1c3d68c5d153ec7be71a9969192) 
# | check:16'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |             2: Target: x86_64-apple-darwin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             3: Thread model: posix 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~
# |             4: InstalledDir: /home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/Inputs/basic_darwin_toolchain_no_libcxx/usr/bin 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             5: Build config: +assertions 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             6:  "/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/bin/clang-22" "-cc1" "-triple" "x86_64-apple-macosx10.4.0" "-Wundef-prefix=TARGET_OS_" "-Werror=undef-prefix" "-Wdeprecated-objc-isa-usage" "-Werror=deprecated-objc-isa-usage" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "darwin-link-libcxx.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mframe-pointer=all" "-ffp-contract=on" "-fno-rounding-math" "-funwind-tables=2" "-faligned-alloc-unavailable" "-fno-sized-deallocation" "-fcompatibility-qualified-id-block-type-checking" "-fvisibility-inlines-hidden-static-local-var" "-fbuiltin-headers-in-system-modules" "-fdefine-target-os-macros" "-target-cpu" "core2" "-tune-cpu" "generic" "-debugger-tuning=lldb" "-fdebug-compilation-dir=/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/tools/clang/test/Driver" "-fcoverage-compilation-dir=/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/tools/clang/test/Driver" "-resource-dir" "/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/lib/clang/22" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/lib/clang/22/include" "-internal-externc-isystem" "/usr/include" "-internal-iframework" "/System/Library/Frameworks" "-internal-iframework" "/System/Library/SubFrameworks" "-internal-iframework" "/Library/Frameworks" "-fdeprecated-macro" "-ferror-limit" "19" "-fblocks" "-fblocks-runtime-optional" "-fencode-extended-block-signature" "-fregister-global-dtors-with-atexit" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-dispatch-method=non-legacy" "-fcxx-exceptions" "-fexceptions" "-fmax-type-align=16" "-fdwarf2-cfi-asm" "-o" "/tmp/lit-tmp-8fjdt7mr/darwin-link-libcxx-4337cd.o" "-x" "c++" "/home/buildbot/worker/as-builder-11/x-aarch64-pauth/llvm-project/clang/test/Driver/darwin-link-libcxx.cpp" 
# | check:16'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~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:16'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  possible intended match
# |             7:  "/home/buildbot/worker/as-builder-11/x-aarch64-pauth/build/bin/ld64.lld" "-demangle" "-dynamic" "-arch" "x86_64" "-platform_version" "macos" "10.4.0" "10.4.0" "-mllvm" "-enable-linkonceodr-outlining" "-o" "a.out" "-lcrt1.o" "/tmp/lit-tmp-8fjdt7mr/darwin-link-libcxx-4337cd.o" "-lc++" "-lSystem" "-lgcc_s.1" 
# | check:16'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

********************


@ldionne
Copy link
Member Author

ldionne commented Dec 5, 2025

Ack, let's follow up on #170912

ldionne added a commit that referenced this pull request Dec 5, 2025
… non-darwin systems (#170912)

Disable the test added in #170303, which breaks bots that don't use ld
as their linker. This is a temporary and narrow disablement of the test
until we can make it more general again, to get the bots green.

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category compiler-rt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[D148266] [clang][driver] Linking to just-built libc++.dylib when bootstrapping libc++ with clang

8 participants