From 6f3ff22e739441cfdcd8ad1de92dba6f48fa3da7 Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Fri, 30 Oct 2015 16:30:27 +0000 Subject: Support watchOS and tvOS driver options This patch should add support for almost all command-line options and driver tinkering necessary to produce a correct "clang -cc1" invocation for watchOS and tvOS. llvm-svn: 251706 --- clang/lib/Driver/Tools.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'clang/lib/Driver/Tools.cpp') diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 3e4cb3144f2..29b100ebbf8 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -3128,7 +3128,8 @@ ParsePICArgs(const ToolChain &ToolChain, const llvm::Triple &Triple, // This kernel flags are a trump-card: they will disable PIC/PIE // generation, independent of the argument order. - if (KernelOrKext && (!Triple.isiOS() || Triple.isOSVersionLT(6))) + if (KernelOrKext && ((!Triple.isiOS() || Triple.isOSVersionLT(6)) && + !Triple.isWatchOS())) PIC = PIE = false; if (Arg *A = Args.getLastArg(options::OPT_mdynamic_no_pic)) { @@ -6232,7 +6233,11 @@ StringRef arm::getLLVMArchSuffixForARM(StringRef CPU, StringRef Arch, // extract arch from default cpu of the Triple ArchKind = llvm::ARM::parseCPUArch(Triple.getARMCPUForArch(ARMArch)); } else { - ArchKind = llvm::ARM::parseCPUArch(CPU); + // FIXME: horrible hack to get around the fact that Cortex-A7 is only an + // armv7k triple if it's actually been specified via "-arch armv7k". + ArchKind = (Arch == "armv7k" || Arch == "thumbv7k") + ? llvm::ARM::AK_ARMV7K + : llvm::ARM::parseCPUArch(CPU); } if (ArchKind == llvm::ARM::AK_INVALID) return ""; -- cgit v1.2.3