From: Tim Northover Date: Thu, 24 Jul 2014 10:25:34 +0000 (+0000) Subject: MachO: use "arm64" as the triple name in modules. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a212e41b2f037b87e09a7eb1f5ea28e848ef8018;p=clang MachO: use "arm64" as the triple name in modules. Current versions of ld64 can't cope with "aarch64" being stored. I'm fixing that, but in the transitionary period we'll need to still emit "arm64". rdar://problem/17783765 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213852 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index 4f90d083c7..d2c2d55dfb 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -221,6 +221,17 @@ std::string ToolChain::ComputeLLVMTriple(const ArgList &Args, } return Triple.getTriple(); } + case llvm::Triple::aarch64: { + llvm::Triple Triple = getTriple(); + if (!Triple.isOSBinFormatMachO()) + return getTripleString(); + + // FIXME: older versions of ld64 expect the "arm64" component in the actual + // triple string and query it to determine whether an LTO file can be + // handled. Remove this when we don't care any more. + Triple.setArchName("arm64"); + return Triple.getTriple(); + } case llvm::Triple::arm: case llvm::Triple::armeb: case llvm::Triple::thumb: diff --git a/test/Driver/aarch64-cpus.c b/test/Driver/aarch64-cpus.c index 25f8685696..1627660d81 100644 --- a/test/Driver/aarch64-cpus.c +++ b/test/Driver/aarch64-cpus.c @@ -11,7 +11,7 @@ // ARM64-GENERIC: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target arm64-apple-darwin -arch arm64 -### -c %s 2>&1 | FileCheck -check-prefix=ARM64-DARWIN %s -// ARM64-DARWIN: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "cyclone" +// ARM64-DARWIN: "-cc1"{{.*}} "-triple" "arm64{{.*}}" "-target-cpu" "cyclone" // RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s // RUN: %clang -target aarch64 -mlittle-endian -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s