14#include "llvm/Option/ArgList.h"
15#include "llvm/Support/FileSystem.h"
16#include "llvm/Support/Path.h"
17#include "llvm/Support/raw_ostream.h"
27 StringRef InstallPath,
78 llvm::opt::ArgStringList &CC1Args,
80 CC1Args.push_back(
"-nostdsysteminc");
84 ArgStringList &CC1Args)
const {
85 if (DriverArgs.hasArg(options::OPT_nostdinc))
88 if (!DriverArgs.hasArg(options::OPT_nostdlibinc)) {
90 llvm::sys::path::append(Dir,
"include");
93 llvm::sys::path::append(Dir2,
"sys-include");
99 const llvm::opt::ArgList &DriverArgs,
100 llvm::opt::ArgStringList &CC1Args)
const {
109std::string CSKYToolChain::computeSysRoot()
const {
117 llvm::sys::path::append(SysRootDir, LibDir,
"..", TripleStr);
121 llvm::sys::path::append(SysRootDir,
getDriver().Dir,
"..",
125 if (!llvm::sys::fs::exists(SysRootDir))
126 return std::string();
128 return std::string(SysRootDir);
135 const char *LinkingOutput)
const {
138 ArgStringList CmdArgs;
140 if (!
D.SysRoot.empty())
141 CmdArgs.push_back(Args.MakeArgString(
"--sysroot=" +
D.SysRoot));
143 CmdArgs.push_back(
"-m");
144 CmdArgs.push_back(
"cskyelf");
146 std::string
Linker = getToolChain().GetLinkerPath();
149 !Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles);
151 const char *crtbegin, *crtend;
154 crtbegin =
"crtbegin.o";
170 Args.AddAllArgs(CmdArgs, options::OPT_L);
172 Args.addAllArgs(CmdArgs, {options::OPT_T_Group, options::OPT_s,
173 options::OPT_t, options::OPT_r});
179 if (!Args.hasArg(options::OPT_nostdlib) &&
180 !Args.hasArg(options::OPT_nodefaultlibs)) {
183 CmdArgs.push_back(
"--start-group");
184 CmdArgs.push_back(
"-lc");
185 if (Args.hasArg(options::OPT_msim))
186 CmdArgs.push_back(
"-lsemi");
188 CmdArgs.push_back(
"-lnosys");
189 CmdArgs.push_back(
"--end-group");
198 CmdArgs.push_back(
"-o");
200 C.addCommand(std::make_unique<Command>(
202 CmdArgs, Inputs, Output));
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...
std::string SysRoot
sysroot, if present
See also MultilibSetBuilder for combining multilibs into a set.
const IncludeDirsFunc & filePathsCallback() const
This corresponds to a single GCC Multilib, or a segment of one controlled by a command line flag.
const std::string & includeSuffix() const
Get the include directory suffix.
The JSON file list parser is used to communicate input to InstallAPI.
static constexpr ResponseFileSupport AtFileCurCP()