12#include "llvm/Support/FileSystem.h"
13#include "llvm/Support/Path.h"
18using namespace llvm::sys;
26 if (fs::real_path(Linker, Path))
28 llvm::StringRef LinkerName =
29 path::filename(llvm::StringRef(Path.data(), Path.size()));
33 if (LinkerName.starts_with(
"ld64.so"))
36 if (!LinkerName.starts_with(
"ld-2."))
38 unsigned Minor = (LinkerName[5] -
'0') * 10 + (LinkerName[6] -
'0');
46 const llvm::Triple &Triple,
47 const llvm::opt::ArgList &Args)
48 :
Linux(D, Triple, Args) {
49 if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) {
50 StringRef ABIName = A->getValue();
52 if ((ABIName ==
"ieeelongdouble" &&
53 !SupportIEEEFloat128(D, Triple, Args)) ||
54 (ABIName ==
"ibmlongdouble" && !supportIBMLongDouble(D, Args)))
55 D.Diag(diag::warn_drv_unsupported_float_abi_by_lib) << ABIName;
60 ArgStringList &CC1Args)
const {
61 if (!DriverArgs.hasArg(clang::driver::options::OPT_nostdinc) &&
62 !DriverArgs.hasArg(options::OPT_nobuiltininc)) {
65 llvm::sys::path::append(P,
"include",
"ppc_wrappers");
72bool PPCLinuxToolChain::supportIBMLongDouble(
73 const Driver &D,
const llvm::opt::ArgList &Args)
const {
74 if (Args.hasArg(options::OPT_nostdlib, options::OPT_nostdlibxx))
84bool PPCLinuxToolChain::SupportIEEEFloat128(
85 const Driver &D,
const llvm::Triple &Triple,
86 const llvm::opt::ArgList &Args)
const {
87 if (!Triple.isLittleEndian() || !Triple.isPPC64())
90 if (Args.hasArg(options::OPT_nostdlib, options::OPT_nostdlibxx))
94 bool HasUnsupportedCXXLib =
101 !(D.
CCCIsCXX() && HasUnsupportedCXXLib);
static bool GlibcSupportsFloat128(const std::string &Linker)
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
std::string DyldPrefix
Dynamic loader prefix, if present.
bool CCCIsCXX() const
Whether the driver should follow g++ like behavior.