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