13#include "llvm/Support/FileSystem.h"
14#include "llvm/Support/Path.h"
19using namespace llvm::sys;
27 if (fs::real_path(Linker, Path))
29 llvm::StringRef LinkerName =
30 path::filename(llvm::StringRef(Path.data(), Path.size()));
34 if (LinkerName.startswith(
"ld64.so"))
37 if (!LinkerName.startswith(
"ld-2."))
39 unsigned Minor = (LinkerName[5] -
'0') * 10 + (LinkerName[6] -
'0');
47 const llvm::Triple &Triple,
48 const llvm::opt::ArgList &Args)
49 :
Linux(D, Triple, Args) {
50 if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ)) {
51 StringRef ABIName = A->getValue();
53 if ((ABIName ==
"ieeelongdouble" &&
54 !SupportIEEEFloat128(D, Triple, Args)) ||
55 (ABIName ==
"ibmlongdouble" && !supportIBMLongDouble(D, Args)))
56 D.
Diag(diag::warn_drv_unsupported_float_abi_by_lib) << ABIName;
61 ArgStringList &CC1Args)
const {
62 if (!DriverArgs.hasArg(clang::driver::options::OPT_nostdinc) &&
63 !DriverArgs.hasArg(options::OPT_nobuiltininc)) {
66 llvm::sys::path::append(
P,
"include",
"ppc_wrappers");
73bool PPCLinuxToolChain::supportIBMLongDouble(
74 const Driver &D,
const llvm::opt::ArgList &Args)
const {
75 if (Args.hasArg(options::OPT_nostdlib, options::OPT_nostdlibxx))
85bool PPCLinuxToolChain::SupportIEEEFloat128(
86 const Driver &D,
const llvm::Triple &Triple,
87 const llvm::opt::ArgList &Args)
const {
88 if (!Triple.isLittleEndian() || !Triple.isPPC64())
91 if (Args.hasArg(options::OPT_nostdlib, options::OPT_nostdlibxx))
95 bool HasUnsupportedCXXLib =
102 !(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.
DiagnosticBuilder Diag(unsigned DiagID) const
std::string ResourceDir
The path to the compiler resource directory.
bool CCCIsCXX() const
Whether the driver should follow g++ like behavior.