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

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 13 22:45:48 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 don't see this as disruption, but I see `amd64-*` `sparcv9` as workarounds. For workarounds, we generally keep their scope as narrow as possible. We don't encourage current or future use cases.

I am concerned if supporting `amd64-*` opens the door for incorrect `amd64-linux`  usage.

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


More information about the cfe-commits mailing list