;
44 Multilib(
"/a7_soft", {}, {}, {
"-mcpu=cortex-a7",
"-mfloat-abi=soft"}));
47 Multilib(
"/a7_softfp_neon-vfpv4", {}, {},
48{
"-mcpu=cortex-a7",
"-mfloat-abi=softfp",
"-mfpu=neon-vfpv4"}));
51 Multilib(
"/a7_hard_neon-vfpv4", {}, {},
52{
"-mcpu=cortex-a7",
"-mfloat-abi=hard",
"-mfpu=neon-vfpv4"}));
54 if(Multilibs.
select(
D, Flags, Result.SelectedMultilibs)) {
55Result.Multilibs = Multilibs;
63 constllvm::Triple &TargetTriple,
64StringRef
Path,
constArgList &Args,
68 if(
constArg *A = Args.getLastArg(options::OPT_mcpu_EQ))
69IsA7 = A->getValue() == StringRef(
"cortex-a7");
73 if(
constArg *A = Args.getLastArg(options::OPT_mfpu_EQ))
74IsMFPU = A->getValue() == StringRef(
"neon-vfpv4");
79 "-mfloat-abi=soft", Flags);
81 "-mfloat-abi=softfp", Flags);
83 "-mfloat-abi=hard", Flags);
91 switch(
T.getArch()) {
99 casellvm::Triple::arm:
100 casellvm::Triple::thumb:
101 return T.isOSLiteOS() ?
"arm-liteos-ohos":
"arm-linux-ohos";
102 casellvm::Triple::riscv32:
103 return "riscv32-linux-ohos";
104 casellvm::Triple::riscv64:
105 return "riscv64-linux-ohos";
106 casellvm::Triple::mipsel:
107 return "mipsel-linux-ohos";
108 casellvm::Triple::x86:
109 return "i686-linux-ohos";
110 casellvm::Triple::x86_64:
111 return "x86_64-linux-ohos";
112 casellvm::Triple::aarch64:
113 return "aarch64-linux-ohos";
119 constllvm::Triple &TargetTriple,
120StringRef SysRoot)
const{
124staticstd::string
makePath(
conststd::initializer_list<std::string> &IL) {
126 for(
const auto&S : IL)
127llvm::sys::path::append(
P, S);
128 return static_cast<std::string
>(
P.str());
147 if(
getVFS().exists(CandidateLibPath))
160std::string SysRootLibPath =
makePath({SysRoot,
"usr",
"lib"});
165 makePath({
D.Dir,
"..",
"lib", MultiarchTriple,
176 constArgList &Args)
const{
177 if(Arg *A = Args.getLastArg(clang::driver::options::OPT_rtlib_EQ)) {
178StringRef
Value= A->getValue();
179 if(
Value!=
"compiler-rt")
181<< A->getAsString(Args);
189 if(Arg *A = Args.getLastArg(options::OPT_stdlib_EQ)) {
190StringRef
Value= A->getValue();
191 if(
Value!=
"libc++")
193<< A->getAsString(Args);
200ArgStringList &CC1Args)
const{
202 constllvm::Triple &Triple =
getTriple();
205 if(DriverArgs.hasArg(options::OPT_nostdinc))
208 if(!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
210llvm::sys::path::append(
P,
"include");
214 if(DriverArgs.hasArg(options::OPT_nostdlibinc))
218StringRef CIncludeDirs(C_INCLUDE_DIRS);
219 if(CIncludeDirs !=
"") {
221CIncludeDirs.split(dirs,
":");
222 for(StringRef dir : dirs) {
224llvm::sys::path::is_absolute(dir) ? StringRef(SysRoot) :
"";
231SysRoot +
"/usr/include/"+
238ArgStringList &CC1Args)
const{
239 if(DriverArgs.hasArg(options::OPT_nostdlibinc) ||
240DriverArgs.hasArg(options::OPT_nostdincxx))
246std::string IncTargetPath =
248 if(
getVFS().exists(IncTargetPath)) {
256llvm_unreachable(
"invalid stdlib name");
261ArgStringList &CmdArgs)
const{
264CmdArgs.push_back(
"-lc++");
265CmdArgs.push_back(
"-lc++abi");
266CmdArgs.push_back(
"-lunwind");
270llvm_unreachable(
"invalid stdlib name");
275std::string SysRoot =
279 if(!llvm::sys::fs::exists(SysRoot))
280 returnstd::string();
283 returnllvm::sys::fs::exists(ArchRoot) ? ArchRoot : SysRoot;
290 constllvm::Triple &Triple =
getTriple();
293 P.assign(
D.ResourceDir);
294llvm::sys::path::append(
P,
"lib",
D.getTargetTriple(), SelectedMultilib.
gccSuffix());
295Paths.push_back(
P.c_str());
298 P.assign(
D.ResourceDir);
299llvm::sys::path::append(
P,
"lib", Triple.str(), SelectedMultilib.
gccSuffix());
300Paths.push_back(
P.c_str());
303 P.assign(
D.ResourceDir);
307Paths.push_back(
P.c_str());
313 constllvm::Triple &Triple =
getTriple();
314 constllvm::Triple::ArchType Arch =
getArch();
316assert(Triple.isMusl());
317std::string ArchName;
321 casellvm::Triple::arm:
322 casellvm::Triple::thumb:
326 casellvm::Triple::armeb:
327 casellvm::Triple::thumbeb:
332ArchName = Triple.getArchName().str();
338 return "/lib/ld-musl-"+ ArchName +
".so.1";
360llvm::sys::path::append(
361 Path, Prefix + Twine(
"clang_rt.") + Component + Suffix);
362 return static_cast<std::string
>(
Path.str());
366CmdArgs.push_back(
"-z");
367CmdArgs.push_back(
"now");
368CmdArgs.push_back(
"-z");
369CmdArgs.push_back(
"relro");
370CmdArgs.push_back(
"-z");
371CmdArgs.push_back(
"max-page-size=4096");
373 if(
getArch() != llvm::Triple::mipsel)
374CmdArgs.push_back(
"--hash-style=both");
375#ifdef ENABLE_LINKER_BUILD_ID 376CmdArgs.push_back(
"--build-id");
378CmdArgs.push_back(
"--enable-new-dtags");
383Res |= SanitizerKind::Address;
384Res |= SanitizerKind::PointerCompare;
385Res |= SanitizerKind::PointerSubtract;
386Res |= SanitizerKind::Fuzzer;
387Res |= SanitizerKind::FuzzerNoLink;
388Res |= SanitizerKind::Memory;
389Res |= SanitizerKind::Vptr;
390Res |= SanitizerKind::SafeStack;
391Res |= SanitizerKind::Scudo;
399llvm::opt::ArgStringList &CmdArgs)
const{
403CmdArgs.push_back(Args.MakeArgString(
404Twine(
"-u", llvm::getInstrProfRuntimeHookVarName())));
417 if(Args.getLastArg(options::OPT_unwindlib_EQ))
static bool findOHOSMuslMultilibs(const Driver &D, const Multilib::flags_list &Flags, DetectedMultilibs &Result)
static std::string makePath(const std::initializer_list< std::string > &IL)
static bool findOHOSMultilibs(const Driver &D, const ToolChain &TC, const llvm::Triple &TargetTriple, StringRef Path, const ArgList &Args, DetectedMultilibs &Result)
The base class of the type hierarchy.
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
std::string SysRoot
sysroot, if present
DiagnosticBuilder Diag(unsigned DiagID) const
std::string ResourceDir
The path to the compiler resource directory.
std::string Dir
The path the driver executable was in, as invoked from the command line.
See also MultilibSetBuilder for combining multilibs into a set.
bool select(const Driver &D, const Multilib::flags_list &Flags, llvm::SmallVectorImpl< Multilib > &, llvm::SmallVector< StringRef > *=nullptr) const
Select compatible variants,.
void push_back(const Multilib &M)
Add a completed Multilib to the set.
This corresponds to a single GCC Multilib, or a segment of one controlled by a command line flag.
const std::string & gccSuffix() const
Get the detected GCC installation path suffix for the multi-arch target variant.
std::vector< std::string > flags_list
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
const FunctionProtoType * T
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4