[clang] [Driver] Add the --gcc-triple option (PR #73214)

Tom Stellard via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 13 11:57:09 PST 2023


================
@@ -2130,6 +2130,15 @@ void Generic_GCC::GCCInstallationDetector::init(
     return;
   }
 
+  // If --gcc-triple is specified use this instead of trying to
+  // auto-detect a triple.
+  if (const Arg *A =
+          Args.getLastArg(clang::driver::options::OPT_gcc_triple_EQ)) {
+    StringRef GCCTriple = A->getValue();
+    CandidateTripleAliases.clear();
+    CandidateTripleAliases.push_back(GCCTriple);
+  }
+
   // Compute the set of prefixes for our search.
----------------
tstellar wrote:

No --gcc-toolchain= and GCC_INSTALL_PREFIX should be unaffected.  They just provide the install prefix and then --gcc-triple specifies the triple to use within that prefix.

I think GCC_INSTALL_PREFIX should be deprecated still because this functionality can be replicated using config files now.

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


More information about the cfe-commits mailing list