From 02a979fd1e8b1afe7e3a85d3ef7ae4dd880a71aa Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Thu, 24 Jul 2014 10:25:34 +0000 Subject: [PATCH] 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 llvm-svn: 213852 --- clang/lib/Driver/ToolChain.cpp | 11 +++++++++++ clang/test/Driver/aarch64-cpus.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 4f90d08..d2c2d55 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/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/clang/test/Driver/aarch64-cpus.c b/clang/test/Driver/aarch64-cpus.c index 25f8685..1627660 100644 --- a/clang/test/Driver/aarch64-cpus.c +++ b/clang/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 -- 2.7.4