clang 22.0.0git
Solaris.cpp
Go to the documentation of this file.
1//===--- Solaris.cpp - Solaris ToolChain Implementations --------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "Solaris.h"
10#include "Gnu.h"
12#include "clang/Config/config.h"
15#include "clang/Driver/Driver.h"
19#include "llvm/ADT/StringSwitch.h"
20#include "llvm/Option/ArgList.h"
21#include "llvm/Support/FileSystem.h"
22#include "llvm/Support/Path.h"
23
24using namespace clang::driver;
25using namespace clang::driver::tools;
26using namespace clang::driver::toolchains;
27using namespace clang;
28using namespace llvm::opt;
29
31 const InputInfo &Output,
32 const InputInfoList &Inputs,
33 const ArgList &Args,
34 const char *LinkingOutput) const {
35 // Just call the Gnu version, which enforces gas on Solaris.
36 gnutools::Assembler::ConstructJob(C, JA, Output, Inputs, Args, LinkingOutput);
37}
38
39bool solaris::isLinkerGnuLd(const ToolChain &TC, const ArgList &Args) {
40 // Only used if targetting Solaris.
41 const Arg *A = Args.getLastArg(options::OPT_fuse_ld_EQ);
42 StringRef UseLinker = A ? A->getValue() : TC.getDriver().getPreferredLinker();
43 return UseLinker == "bfd" || UseLinker == "gld";
44}
45
46static bool getPIE(const ArgList &Args, const ToolChain &TC) {
47 if (Args.hasArg(options::OPT_shared) || Args.hasArg(options::OPT_static) ||
48 Args.hasArg(options::OPT_r))
49 return false;
50
51 return Args.hasFlag(options::OPT_pie, options::OPT_no_pie,
52 TC.isPIEDefault(Args));
53}
54
55// FIXME: Need to handle PreferredLinker here?
56std::string solaris::Linker::getLinkerPath(const ArgList &Args) const {
58 if (const Arg *A = Args.getLastArg(options::OPT_fuse_ld_EQ)) {
59 StringRef UseLinker = A->getValue();
60 if (!UseLinker.empty()) {
61 if (llvm::sys::path::is_absolute(UseLinker) &&
62 llvm::sys::fs::can_execute(UseLinker))
63 return std::string(UseLinker);
64
65 // Accept 'bfd' and 'gld' as aliases for the GNU linker.
66 if (UseLinker == "bfd" || UseLinker == "gld")
67 // FIXME: Could also use /usr/bin/gld here.
68 return "/usr/gnu/bin/ld";
69
70 // Accept 'ld' as alias for the default linker
71 if (UseLinker != "ld")
72 ToolChain.getDriver().Diag(diag::err_drv_invalid_linker_name)
73 << A->getAsString(Args);
74 }
75 }
76
77 // getDefaultLinker() always returns an absolute path.
79}
80
82 const InputInfo &Output,
83 const InputInfoList &Inputs,
84 const ArgList &Args,
85 const char *LinkingOutput) const {
86 const auto &ToolChain = static_cast<const Solaris &>(getToolChain());
87 const Driver &D = ToolChain.getDriver();
88 const llvm::Triple::ArchType Arch = ToolChain.getArch();
89 const bool IsPIE = getPIE(Args, ToolChain);
90 const bool LinkerIsGnuLd = isLinkerGnuLd(ToolChain, Args);
91 ArgStringList CmdArgs;
92
93 // Demangle C++ names in errors. GNU ld already defaults to --demangle.
94 if (!LinkerIsGnuLd)
95 CmdArgs.push_back("-C");
96
97 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_shared,
98 options::OPT_r)) {
99 CmdArgs.push_back("-e");
100 CmdArgs.push_back("_start");
101 }
102
103 if (IsPIE) {
104 if (LinkerIsGnuLd) {
105 CmdArgs.push_back("-pie");
106 } else {
107 CmdArgs.push_back("-z");
108 CmdArgs.push_back("type=pie");
109 }
110 }
111
112 if (Args.hasArg(options::OPT_static)) {
113 CmdArgs.push_back("-Bstatic");
114 CmdArgs.push_back("-dn");
115 } else {
116 if (!Args.hasArg(options::OPT_r) && Args.hasArg(options::OPT_shared))
117 CmdArgs.push_back("-shared");
118
119 // libpthread has been folded into libc since Solaris 10, no need to do
120 // anything for pthreads. Claim argument to avoid warning.
121 Args.ClaimAllArgs(options::OPT_pthread);
122 Args.ClaimAllArgs(options::OPT_pthreads);
123 }
124
125 if (LinkerIsGnuLd) {
126 // Set the correct linker emulation for 32- and 64-bit Solaris.
127 switch (Arch) {
128 case llvm::Triple::x86:
129 CmdArgs.push_back("-m");
130 CmdArgs.push_back("elf_i386_sol2");
131 break;
132 case llvm::Triple::x86_64:
133 CmdArgs.push_back("-m");
134 CmdArgs.push_back("elf_x86_64_sol2");
135 break;
136 case llvm::Triple::sparc:
137 CmdArgs.push_back("-m");
138 CmdArgs.push_back("elf32_sparc_sol2");
139 break;
140 case llvm::Triple::sparcv9:
141 CmdArgs.push_back("-m");
142 CmdArgs.push_back("elf64_sparc_sol2");
143 break;
144 default:
145 break;
146 }
147
148 if (Args.hasArg(options::OPT_rdynamic))
149 CmdArgs.push_back("-export-dynamic");
150
151 CmdArgs.push_back("--eh-frame-hdr");
152 } else {
153 // -rdynamic is a no-op with Solaris ld. Claim argument to avoid warning.
154 Args.ClaimAllArgs(options::OPT_rdynamic);
155 }
156
157 assert((Output.isFilename() || Output.isNothing()) && "Invalid output.");
158 if (Output.isFilename()) {
159 CmdArgs.push_back("-o");
160 CmdArgs.push_back(Output.getFilename());
161 }
162
163 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
164 options::OPT_r)) {
165 if (!Args.hasArg(options::OPT_shared))
166 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crt1.o")));
167
168 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crti.o")));
169
170 const Arg *Std = Args.getLastArg(options::OPT_std_EQ, options::OPT_ansi);
171 bool HaveAnsi = false;
172 const LangStandard *LangStd = nullptr;
173 if (Std) {
174 HaveAnsi = Std->getOption().matches(options::OPT_ansi);
175 if (!HaveAnsi)
176 LangStd = LangStandard::getLangStandardForName(Std->getValue());
177 }
178
179 const char *values_X = "values-Xa.o";
180 // Use values-Xc.o for -ansi, -std=c*, -std=iso9899:199409.
181 if (HaveAnsi || (LangStd && !LangStd->isGNUMode()))
182 values_X = "values-Xc.o";
183 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(values_X)));
184
185 const char *values_xpg = "values-xpg6.o";
186 // Use values-xpg4.o for -std=c90, -std=gnu90, -std=iso9899:199409.
187 if (LangStd && LangStd->getLanguage() == Language::C && !LangStd->isC99())
188 values_xpg = "values-xpg4.o";
189 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(values_xpg)));
190
191 const char *crtbegin = nullptr;
192 if (Args.hasArg(options::OPT_shared) || IsPIE)
193 crtbegin = "crtbeginS.o";
194 else
195 crtbegin = "crtbegin.o";
196 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtbegin)));
197 // Add crtfastmath.o if available and fast math is enabled.
199 }
200
201 ToolChain.AddFilePathLibArgs(Args, CmdArgs);
202
203 Args.addAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group});
204
205 bool NeedsSanitizerDeps = addSanitizerRuntimes(ToolChain, Args, CmdArgs);
206 AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs, JA);
207
208 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs,
209 options::OPT_r)) {
210 // Use the static OpenMP runtime with -static-openmp
211 bool StaticOpenMP = Args.hasArg(options::OPT_static_openmp) &&
212 !Args.hasArg(options::OPT_static);
213 addOpenMPRuntime(C, CmdArgs, ToolChain, Args, StaticOpenMP);
214
215 if (D.CCCIsCXX()) {
217 ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
218 CmdArgs.push_back("-lm");
219 }
220 // Silence warnings when linking C code with a C++ '-stdlib' argument.
221 Args.ClaimAllArgs(options::OPT_stdlib_EQ);
222 // Additional linker set-up and flags for Fortran. This is required in order
223 // to generate executables. As Fortran runtime depends on the C runtime,
224 // these dependencies need to be listed before the C runtime below.
225 if (D.IsFlangMode() &&
226 !Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
228 ToolChain.addFortranRuntimeLibs(Args, CmdArgs);
229 CmdArgs.push_back("-lm");
230 }
231 if (Args.hasArg(options::OPT_fstack_protector) ||
232 Args.hasArg(options::OPT_fstack_protector_strong) ||
233 Args.hasArg(options::OPT_fstack_protector_all)) {
234 // Explicitly link ssp libraries, not folded into Solaris libc.
235 CmdArgs.push_back("-lssp_nonshared");
236 CmdArgs.push_back("-lssp");
237 }
238 // LLVM support for atomics on 32-bit SPARC V8+ is incomplete, so
239 // forcibly link with libatomic as a workaround.
240 if (Arch == llvm::Triple::sparc) {
241 addAsNeededOption(ToolChain, Args, CmdArgs, true);
242 CmdArgs.push_back("-latomic");
243 addAsNeededOption(ToolChain, Args, CmdArgs, false);
244 }
245
246 AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
247 CmdArgs.push_back("-lc");
248
249 const SanitizerArgs &SA = ToolChain.getSanitizerArgs(Args);
250 if (NeedsSanitizerDeps) {
251 linkSanitizerRuntimeDeps(ToolChain, Args, CmdArgs);
252
253 // Work around Solaris/amd64 ld bug when calling __tls_get_addr directly.
254 // However, ld -z relax=transtls is available since Solaris 11.2, but not
255 // in Illumos.
256 if (Arch == llvm::Triple::x86_64 &&
257 (SA.needsAsanRt() || SA.needsStatsRt() ||
258 (SA.needsUbsanRt() && !SA.requiresMinimalRuntime())) &&
259 !LinkerIsGnuLd) {
260 CmdArgs.push_back("-z");
261 CmdArgs.push_back("relax=transtls");
262 }
263 }
264 // Avoid AsanInitInternal cycle, Issue #64126.
265 if (SA.needsSharedRt() && SA.needsAsanRt()) {
266 CmdArgs.push_back("-z");
267 CmdArgs.push_back("now");
268 }
269 }
270
271 if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
272 options::OPT_r)) {
273 const char *crtend = nullptr;
274 if (Args.hasArg(options::OPT_shared) || IsPIE)
275 crtend = "crtendS.o";
276 else
277 crtend = "crtend.o";
278 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
279 CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtn.o")));
280 }
281
282 ToolChain.addProfileRTLibs(Args, CmdArgs);
283
284 const char *Exec = Args.MakeArgString(getLinkerPath(Args));
285 C.addCommand(std::make_unique<Command>(JA, *this, ResponseFileSupport::None(),
286 Exec, CmdArgs, Inputs, Output));
287}
288
289static StringRef getSolarisLibSuffix(const llvm::Triple &Triple) {
290 switch (Triple.getArch()) {
291 case llvm::Triple::x86:
292 case llvm::Triple::sparc:
293 default:
294 break;
295 case llvm::Triple::x86_64:
296 return "/amd64";
297 case llvm::Triple::sparcv9:
298 return "/sparcv9";
299 }
300 return "";
301}
302
303/// Solaris - Solaris tool chain which can call as(1) and ld(1) directly.
304
305Solaris::Solaris(const Driver &D, const llvm::Triple &Triple,
306 const ArgList &Args)
307 : Generic_ELF(D, Triple, Args) {
308
309 GCCInstallation.init(Triple, Args);
310
311 StringRef LibSuffix = getSolarisLibSuffix(Triple);
312 path_list &Paths = getFilePaths();
313 if (GCCInstallation.isValid()) {
314 // On Solaris gcc uses both an architecture-specific path with triple in it
315 // as well as a more generic lib path (+arch suffix).
317 GCCInstallation.getInstallPath() +
318 GCCInstallation.getMultilib().gccSuffix(),
319 Paths);
320 addPathIfExists(D, GCCInstallation.getParentLibPath() + LibSuffix, Paths);
321 }
322
323 // If we are currently running Clang inside of the requested system root,
324 // add its parent library path to those searched.
325 if (StringRef(D.Dir).starts_with(D.SysRoot))
326 addPathIfExists(D, D.Dir + "/../lib", Paths);
327
328 addPathIfExists(D, D.SysRoot + "/usr/lib" + LibSuffix, Paths);
329}
330
332 const bool IsSparc = getTriple().getArch() == llvm::Triple::sparc;
333 const bool IsX86 = getTriple().getArch() == llvm::Triple::x86;
335 // FIXME: Omit SparcV9 and X86_64 until 64-bit support is figured out.
336 if (IsSparc || IsX86) {
337 Res |= SanitizerKind::Address;
338 Res |= SanitizerKind::PointerCompare;
339 Res |= SanitizerKind::PointerSubtract;
340 }
341 Res |= SanitizerKind::SafeStack;
342 Res |= SanitizerKind::Vptr;
343 return Res;
344}
345
346const char *Solaris::getDefaultLinker() const {
347 // FIXME: Only handle Solaris ld and GNU ld here.
348 return llvm::StringSwitch<const char *>(getDriver().getPreferredLinker())
349 .Cases("bfd", "gld", "/usr/gnu/bin/ld")
350 .Default("/usr/bin/ld");
351}
352
354 return new tools::solaris::Assembler(*this);
355}
356
357Tool *Solaris::buildLinker() const { return new tools::solaris::Linker(*this); }
358
359void Solaris::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
360 ArgStringList &CC1Args) const {
361 const Driver &D = getDriver();
362
363 if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
364 return;
365
366 if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
367 addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/local/include");
368
369 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
370 SmallString<128> P(D.ResourceDir);
371 llvm::sys::path::append(P, "include");
372 addSystemInclude(DriverArgs, CC1Args, P);
373 }
374
375 if (DriverArgs.hasArg(options::OPT_nostdlibinc))
376 return;
377
378 // Check for configure-time C include directories.
379 StringRef CIncludeDirs(C_INCLUDE_DIRS);
380 if (CIncludeDirs != "") {
382 CIncludeDirs.split(dirs, ":");
383 for (StringRef dir : dirs) {
384 StringRef Prefix =
385 llvm::sys::path::is_absolute(dir) ? "" : StringRef(D.SysRoot);
386 addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
387 }
388 return;
389 }
390
391 // Add include directories specific to the selected multilib set and multilib.
392 if (GCCInstallation.isValid()) {
393 const MultilibSet::IncludeDirsFunc &Callback =
394 Multilibs.includeDirsCallback();
395 if (Callback) {
396 for (const auto &Path : Callback(GCCInstallation.getMultilib()))
398 DriverArgs, CC1Args, GCCInstallation.getInstallPath() + Path);
399 }
400 }
401
402 addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/include");
403}
404
406 const llvm::opt::ArgList &DriverArgs,
407 llvm::opt::ArgStringList &CC1Args) const {
408 // We need a detected GCC installation on Solaris (similar to Linux)
409 // to provide libstdc++'s headers.
410 if (!GCCInstallation.isValid())
411 return;
412
413 // By default, look for the C++ headers in an include directory adjacent to
414 // the lib directory of the GCC installation.
415 // On Solaris this usually looks like /usr/gcc/X.Y/include/c++/X.Y.Z
416 StringRef LibDir = GCCInstallation.getParentLibPath();
417 StringRef TripleStr = GCCInstallation.getTriple().str();
418 const Multilib &Multilib = GCCInstallation.getMultilib();
419 const GCCVersion &Version = GCCInstallation.getVersion();
420
421 // The primary search for libstdc++ supports multiarch variants.
422 addLibStdCXXIncludePaths(LibDir.str() + "/../include/c++/" + Version.Text,
423 TripleStr, Multilib.includeSuffix(), DriverArgs,
424 CC1Args);
425}
static StringRef getSolarisLibSuffix(const llvm::Triple &Triple)
Definition Solaris.cpp:289
static bool getPIE(const ArgList &Args, const ToolChain &TC)
Definition Solaris.cpp:46
Compilation - A set of tasks to perform for a single driver invocation.
Definition Compilation.h:45
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition Driver.h:99
DiagnosticBuilder Diag(unsigned DiagID) const
Definition Driver.h:169
bool IsFlangMode() const
Whether the driver should invoke flang for fortran inputs.
Definition Driver.h:251
StringRef getPreferredLinker() const
Definition Driver.h:456
bool CCCIsCXX() const
Whether the driver should follow g++ like behavior.
Definition Driver.h:238
InputInfo - Wrapper for information about an input source.
Definition InputInfo.h:22
const char * getFilename() const
Definition InputInfo.h:83
bool isNothing() const
Definition InputInfo.h:74
bool isFilename() const
Definition InputInfo.h:75
std::function< std::vector< std::string >(const Multilib &M)> IncludeDirsFunc
Definition Multilib.h:133
This corresponds to a single GCC Multilib, or a segment of one controlled by a command line flag.
Definition Multilib.h:35
const std::string & includeSuffix() const
Get the include directory suffix.
Definition Multilib.h:78
ToolChain - Access to tools for a single platform.
Definition ToolChain.h:92
static void addSystemInclude(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
Utility function to add a system include directory to CC1 arguments.
bool ShouldLinkCXXStdlib(const llvm::opt::ArgList &Args) const
Returns if the C++ standard library should be linked in.
static void addExternCSystemInclude(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
Utility function to add a system include directory with extern "C" semantics to CC1 arguments.
virtual void addFortranRuntimeLibraryPath(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
Adds the path for the Fortran runtime libraries to CmdArgs.
std::string GetFilePath(const char *Name) const
virtual void addFortranRuntimeLibs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
Adds Fortran runtime libraries to CmdArgs.
path_list & getFilePaths()
Definition ToolChain.h:295
llvm::Triple::ArchType getArch() const
Definition ToolChain.h:269
const Driver & getDriver() const
Definition ToolChain.h:253
virtual bool isPIEDefault(const llvm::opt::ArgList &Args) const =0
Test whether this toolchain defaults to PIE.
bool addFastMathRuntimeIfAvailable(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddFastMathRuntimeIfAvailable - If a runtime library exists that sets global flags for unsafe floatin...
static void addExternCSystemIncludeIfExists(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, const Twine &Path)
virtual void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddCXXStdlibLibArgs - Add the system specific linker arguments to use for the given C++ standard libr...
virtual const char * getDefaultLinker() const
GetDefaultLinker - Get the default linker to use.
Definition ToolChain.h:494
const llvm::Triple & getTriple() const
Definition ToolChain.h:255
virtual void addProfileRTLibs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
addProfileRTLibs - When -fprofile-instr-profile is specified, try to pass a suitable profile runtime ...
void AddFilePathLibArgs(const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const
AddFilePathLibArgs - Add each thing in getFilePaths() as a "-L" option.
SanitizerArgs getSanitizerArgs(const llvm::opt::ArgList &JobArgs) const
virtual SanitizerMask getSupportedSanitizers() const
Return sanitizers which are available in this toolchain.
SmallVector< std::string, 16 > path_list
Definition ToolChain.h:94
Tool - Information on a specific compilation tool.
Definition Tool.h:32
const ToolChain & getToolChain() const
Definition Tool.h:52
Generic_ELF(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
Definition Gnu.h:439
GCCInstallationDetector GCCInstallation
Definition Gnu.h:357
bool addLibStdCXXIncludePaths(Twine IncludeDir, StringRef Triple, Twine IncludeSuffix, const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args, bool DetectDebian=false) const
Definition Gnu.cpp:3301
SanitizerMask getSupportedSanitizers() const override
Return sanitizers which are available in this toolchain.
Definition Solaris.cpp:331
Solaris(const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
Solaris - Solaris tool chain which can call as(1) and ld(1) directly.
Definition Solaris.cpp:305
Tool * buildLinker() const override
Definition Solaris.cpp:357
const char * getDefaultLinker() const override
GetDefaultLinker - Get the default linker to use.
Definition Solaris.cpp:346
Tool * buildAssembler() const override
Definition Solaris.cpp:353
void AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Add the clang cc1 arguments for system include paths.
Definition Solaris.cpp:359
void addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const override
Definition Solaris.cpp:405
void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override
ConstructJob - Construct jobs to perform the action JA, writing to Output and with Inputs,...
Definition Gnu.cpp:590
void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override
ConstructJob - Construct jobs to perform the action JA, writing to Output and with Inputs,...
Definition Solaris.cpp:30
std::string getLinkerPath(const llvm::opt::ArgList &Args) const
Definition Solaris.cpp:56
void ConstructJob(Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override
ConstructJob - Construct jobs to perform the action JA, writing to Output and with Inputs,...
Definition Solaris.cpp:81
bool isLinkerGnuLd(const ToolChain &TC, const llvm::opt::ArgList &Args)
void addAsNeededOption(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, bool as_needed)
void AddRunTimeLibs(const ToolChain &TC, const Driver &D, llvm::opt::ArgStringList &CmdArgs, const llvm::opt::ArgList &Args)
void linkSanitizerRuntimeDeps(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
bool addSanitizerRuntimes(const ToolChain &TC, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs)
void addPathIfExists(const Driver &D, const Twine &Path, ToolChain::path_list &Paths)
bool addOpenMPRuntime(const Compilation &C, llvm::opt::ArgStringList &CmdArgs, const ToolChain &TC, const llvm::opt::ArgList &Args, bool ForceStaticHostRuntime=false, bool IsOffloadingHost=false, bool GompNeedsRT=false)
Returns true, if an OpenMP runtime has been added.
void AddLinkerInputs(const ToolChain &TC, const InputInfoList &Inputs, const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs, const JobAction &JA)
SmallVector< InputInfo, 4 > InputInfoList
Definition Driver.h:50
The JSON file list parser is used to communicate input to InstallAPI.
@ C
Languages that the frontend can parse and compile.
LangStandard - Information about the properties of a particular language standard.
static const LangStandard * getLangStandardForName(StringRef Name)
clang::Language getLanguage() const
Get the language that this standard describes.
bool isGNUMode() const
isGNUMode - Language includes GNU extensions.
bool isC99() const
isC99 - Language is a superset of C99.
static constexpr ResponseFileSupport None()
Returns a ResponseFileSupport indicating that response files are not supported.
Definition Job.h:78
Struct to store and manipulate GCC versions.
Definition Gnu.h:163
std::string Text
The unparsed text of the version.
Definition Gnu.h:165