11#include "clang/Config/config.h"
13#include "llvm/Support/Path.h"
25 const char *LinkingOutput)
const {
29 const bool Static = Args.hasArg(options::OPT_static);
30 const bool Shared = Args.hasArg(options::OPT_shared);
31 ArgStringList CmdArgs;
34 Args.ClaimAllArgs(options::OPT_g_Group);
36 Args.ClaimAllArgs(options::OPT_emit_llvm);
39 Args.ClaimAllArgs(options::OPT_w);
42 Args.ClaimAllArgs(options::OPT_pie);
45 Args.ClaimAllArgs(options::OPT_rdynamic);
47 if (!
D.SysRoot.empty())
48 CmdArgs.push_back(Args.MakeArgString(
"--sysroot=" +
D.SysRoot));
50 CmdArgs.push_back(
"--eh-frame-hdr");
52 CmdArgs.push_back(
"-Bstatic");
55 CmdArgs.push_back(
"-shared");
56 CmdArgs.push_back(
"--enable-new-dtags");
59 CmdArgs.push_back(
"-shared");
62 CmdArgs.push_back(
"--no-undefined");
64 if (Triple.isRISCV64()) {
65 CmdArgs.push_back(
"-X");
66 if (Args.hasArg(options::OPT_mno_relax))
67 CmdArgs.push_back(
"--no-relax");
72 CmdArgs.push_back(
"-o");
76 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
85 Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
86 options::OPT_s, options::OPT_t});
90 assert(!Inputs.empty() &&
"Must have at least one input.");
92 auto Input = llvm::find_if(
94 if (Input == Inputs.end())
97 Input = Inputs.begin();
106 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,
109 bool StaticOpenMP = Args.hasArg(options::OPT_static_openmp) && !
Static;
116 Args.ClaimAllArgs(options::OPT_stdlib_EQ);
122 if (
D.IsFlangMode() &&
123 !Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
128 CmdArgs.push_back(
"-lgcc");
130 CmdArgs.push_back(
"--push-state");
131 CmdArgs.push_back(
"--as-needed");
132 CmdArgs.push_back(
"-lgcc_s");
133 CmdArgs.push_back(
"--no-as-needed");
134 CmdArgs.push_back(
"--pop-state");
136 CmdArgs.push_back(
"-lroot");
138 CmdArgs.push_back(
"-lgcc");
140 CmdArgs.push_back(
"--push-state");
141 CmdArgs.push_back(
"--as-needed");
142 CmdArgs.push_back(
"-lgcc_s");
143 CmdArgs.push_back(
"--no-as-needed");
144 CmdArgs.push_back(
"--pop-state");
148 Args.claimAllArgs(options::OPT_pthread, options::OPT_pthreads);
150 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
158 const char *Exec = Args.MakeArgString(
getToolChain().GetLinkerPath());
159 C.addCommand(std::make_unique<Command>(JA, *
this,
161 Exec, CmdArgs, Inputs, Output));
179 llvm::opt::ArgStringList &CC1Args)
const {
182 if (DriverArgs.hasArg(options::OPT_nostdinc))
185 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
187 llvm::sys::path::append(Dir,
"include");
191 if (DriverArgs.hasArg(options::OPT_nostdlibinc))
195 StringRef CIncludeDirs(C_INCLUDE_DIRS);
196 if (!CIncludeDirs.empty()) {
198 CIncludeDirs.split(dirs,
":");
199 for (StringRef dir : dirs) {
201 llvm::sys::path::is_absolute(dir) ? StringRef(
D.SysRoot) :
"";
208 "/boot/system/non-packaged/develop/headers"));
210 "/boot/system/develop/headers/os"));
212 "/boot/system/develop/headers/os/app"));
214 "/boot/system/develop/headers/os/device"));
216 "/boot/system/develop/headers/os/drivers"));
218 "/boot/system/develop/headers/os/game"));
220 "/boot/system/develop/headers/os/interface"));
222 "/boot/system/develop/headers/os/kernel"));
224 "/boot/system/develop/headers/os/locale"));
226 "/boot/system/develop/headers/os/mail"));
228 "/boot/system/develop/headers/os/media"));
230 "/boot/system/develop/headers/os/midi"));
232 "/boot/system/develop/headers/os/midi2"));
234 "/boot/system/develop/headers/os/net"));
236 "/boot/system/develop/headers/os/opengl"));
238 "/boot/system/develop/headers/os/storage"));
240 "/boot/system/develop/headers/os/support"));
242 "/boot/system/develop/headers/os/translation"));
244 "/boot/system/develop/headers/os/add-ons/graphics"));
246 "/boot/system/develop/headers/os/add-ons/input_server"));
248 "/boot/system/develop/headers/os/add-ons/mail_daemon"));
250 "/boot/system/develop/headers/os/add-ons/registrar"));
252 "/boot/system/develop/headers/os/add-ons/screen_saver"));
254 "/boot/system/develop/headers/os/add-ons/tracker"));
256 "/boot/system/develop/headers/os/be_apps/Deskbar"));
258 "/boot/system/develop/headers/os/be_apps/NetPositive"));
260 "/boot/system/develop/headers/os/be_apps/Tracker"));
262 "/boot/system/develop/headers/3rdparty"));
264 "/boot/system/develop/headers/bsd"));
266 "/boot/system/develop/headers/glibc"));
268 "/boot/system/develop/headers/gnu"));
270 "/boot/system/develop/headers/posix"));
272 "/boot/system/develop/headers"));
276 llvm::opt::ArgStringList &CC1Args)
const {
Compilation - A set of tasks to perform for a single driver invocation.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
The JSON file list parser is used to communicate input to InstallAPI.
static constexpr ResponseFileSupport AtFileCurCP()