[llvm-branch-commits] [clang] [Driver] Add support for crtbegin.o, crtend.o and libgloss lib to BareMetal toolchain object (PR #121830)

Petr Hosek via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Apr 4 00:54:18 PDT 2025


================
@@ -545,9 +545,27 @@ void baremetal::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back(Arch == llvm::Triple::aarch64_be ? "-EB" : "-EL");
   }
 
-  if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
-                   options::OPT_r)) {
-    CmdArgs.push_back(Args.MakeArgString(TC.GetFilePath("crt0.o")));
+  bool WantCRTs =
----------------
petrhosek wrote:

This is just a suggestion, but I think `NeedsCRT` would be more accurate.
```suggestion
  bool NeedCRT =
```

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


More information about the llvm-branch-commits mailing list