[clang] [Driver] Teach Barmetal toolchain about GCC installation (PR #121829)

Peter Smith via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 11 06:30:28 PDT 2025


================
@@ -110,20 +110,81 @@ static std::string computeBaseSysRoot(const Driver &D, bool IncludeTriple) {
   return std::string(SysRootDir);
 }
 
+static bool hasGCCToolChainAlongSideClang(const Driver &D) {
----------------
smithp35 wrote:

IIUC this is when we have something like clang copied into a GNU installation bin directory or another directory at the same level. So that `bin\clang\..\<target-triple>\lib\crt0.o`

One minor concern is that almost any toolchain will have a `crt0.o` although in the current bare-metal driver they are most likely in `clang-runtimes` so won't clash with the location.

I'm wondering if there's a common file that is really GCC specific so we can avoid inferring a GNU toolchain by mistake.

We could decide that this is unlikely, or make it a requirment that non GNU based bare-metal toolchains just avoid this. If that's the case could we document this? I'll leave a separate comment surrounding documentation.


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


More information about the cfe-commits mailing list