[clang] [Driver] Have getTargetSubDirPath better match get_compiler_rt_target (PR #100091)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 1 23:03:26 PDT 2024


================
@@ -766,9 +766,19 @@ ToolChain::getTargetSubDirPath(StringRef BaseDir) const {
     return {};
   };
 
-  if (auto Path = getPathForTriple(getTriple()))
+  llvm::Triple Triple = getTriple();
+
+  // Try triple as is.
+  if (auto Path = getPathForTriple(Triple))
     return *Path;
 
+  // Match transformations in CompilerRTUtils.cmake:get_compiler_rt_target.
----------------
MaskRay wrote:

I suspect that some BSDs used `amd64` but now switched to `x86_64`, e.g.
[x86_64-unknown-openbsd](https://doc.rust-lang.org/nightly/rustc/platform-support/openbsd.html)

It's fine that Solaris is different, but I think other OSes don't think this change.

Perhaps get_compiler_rt_target should be changed to affect only Solaris as well, but that change should not be merged to release/19.x to prevent potential disruption.

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


More information about the cfe-commits mailing list