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()) {
127 CmdArgs.push_back(
"-lgcc");
129 CmdArgs.push_back(
"--push-state");
130 CmdArgs.push_back(
"--as-needed");
131 CmdArgs.push_back(
"-lgcc_s");
132 CmdArgs.push_back(
"--no-as-needed");
133 CmdArgs.push_back(
"--pop-state");
135 CmdArgs.push_back(
"-lroot");
137 CmdArgs.push_back(
"-lgcc");
139 CmdArgs.push_back(
"--push-state");
140 CmdArgs.push_back(
"--as-needed");
141 CmdArgs.push_back(
"-lgcc_s");
142 CmdArgs.push_back(
"--no-as-needed");
143 CmdArgs.push_back(
"--pop-state");
147 Args.claimAllArgs(options::OPT_pthread, options::OPT_pthreads);
149 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
157 const char *Exec = Args.MakeArgString(
getToolChain().GetLinkerPath());
158 C.addCommand(std::make_unique<Command>(JA, *
this,
160 Exec, CmdArgs, Inputs, Output));
178 llvm::opt::ArgStringList &CC1Args)
const {
181 if (DriverArgs.hasArg(options::OPT_nostdinc))
184 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
186 llvm::sys::path::append(Dir,
"include");
190 if (DriverArgs.hasArg(options::OPT_nostdlibinc))
194 StringRef CIncludeDirs(C_INCLUDE_DIRS);
195 if (!CIncludeDirs.empty()) {
197 CIncludeDirs.split(dirs,
":");
198 for (StringRef dir : dirs) {
200 llvm::sys::path::is_absolute(dir) ? StringRef(
D.SysRoot) :
"";
207 "/boot/system/non-packaged/develop/headers"));
209 "/boot/system/develop/headers/os"));
211 "/boot/system/develop/headers/os/app"));
213 "/boot/system/develop/headers/os/device"));
215 "/boot/system/develop/headers/os/drivers"));
217 "/boot/system/develop/headers/os/game"));
219 "/boot/system/develop/headers/os/interface"));
221 "/boot/system/develop/headers/os/kernel"));
223 "/boot/system/develop/headers/os/locale"));
225 "/boot/system/develop/headers/os/mail"));
227 "/boot/system/develop/headers/os/media"));
229 "/boot/system/develop/headers/os/midi"));
231 "/boot/system/develop/headers/os/midi2"));
233 "/boot/system/develop/headers/os/net"));
235 "/boot/system/develop/headers/os/opengl"));
237 "/boot/system/develop/headers/os/storage"));
239 "/boot/system/develop/headers/os/support"));
241 "/boot/system/develop/headers/os/translation"));
243 "/boot/system/develop/headers/os/add-ons/graphics"));
245 "/boot/system/develop/headers/os/add-ons/input_server"));
247 "/boot/system/develop/headers/os/add-ons/mail_daemon"));
249 "/boot/system/develop/headers/os/add-ons/registrar"));
251 "/boot/system/develop/headers/os/add-ons/screen_saver"));
253 "/boot/system/develop/headers/os/add-ons/tracker"));
255 "/boot/system/develop/headers/os/be_apps/Deskbar"));
257 "/boot/system/develop/headers/os/be_apps/NetPositive"));
259 "/boot/system/develop/headers/os/be_apps/Tracker"));
261 "/boot/system/develop/headers/3rdparty"));
263 "/boot/system/develop/headers/bsd"));
265 "/boot/system/develop/headers/glibc"));
267 "/boot/system/develop/headers/gnu"));
269 "/boot/system/develop/headers/posix"));
271 "/boot/system/develop/headers"));
275 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()