[clang] Fix adding support for -X flag in Baremetal toolchain (PR #147804)

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 15 10:15:30 PDT 2025


================
@@ -613,8 +613,8 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     return;
   }
 
+  CmdArgs.push_back("-X");
----------------
petrhosek wrote:

I don't think this is a correct fix. In other drivers, we only set `-X` for RISC-V (and LoongArch). However, it looks like for RISC-V we're currently setting `-X` twice, once here and once below on line 698. I believe a correct fix is to remove the second `-X` on line 698.

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


More information about the cfe-commits mailing list