forked from OSchip/llvm-project
Propagate "-arch x86_64h" setting to the linker. <rdar://problem/15711488>
This is a follow-up to r194907, which added a new -arch setting to make it easier to specify AVX2 targets. The "-arch x86_64h" option needs to be passed on to the linker, but it was getting canonicalized to x86_64 by the code in getArchTypeForDarwinArchName. llvm-svn: 198096
This commit is contained in:
parent
83e3770ae7
commit
9914a02114
|
@ -1868,17 +1868,24 @@ static llvm::Triple computeTargetTriple(StringRef DefaultTargetTriple,
|
|||
if (Target.isOSDarwin()) {
|
||||
// If an explict Darwin arch name is given, that trumps all.
|
||||
if (!DarwinArchName.empty()) {
|
||||
Target.setArch(
|
||||
tools::darwin::getArchTypeForDarwinArchName(DarwinArchName));
|
||||
if (DarwinArchName == "x86_64h")
|
||||
Target.setArchName(DarwinArchName);
|
||||
else
|
||||
Target.setArch(
|
||||
tools::darwin::getArchTypeForDarwinArchName(DarwinArchName));
|
||||
return Target;
|
||||
}
|
||||
|
||||
// Handle the Darwin '-arch' flag.
|
||||
if (Arg *A = Args.getLastArg(options::OPT_arch)) {
|
||||
llvm::Triple::ArchType DarwinArch
|
||||
= tools::darwin::getArchTypeForDarwinArchName(A->getValue());
|
||||
if (DarwinArch != llvm::Triple::UnknownArch)
|
||||
Target.setArch(DarwinArch);
|
||||
if (StringRef(A->getValue()) == "x86_64h")
|
||||
Target.setArchName(DarwinArchName);
|
||||
else {
|
||||
llvm::Triple::ArchType DarwinArch
|
||||
= tools::darwin::getArchTypeForDarwinArchName(A->getValue());
|
||||
if (DarwinArch != llvm::Triple::UnknownArch)
|
||||
Target.setArch(DarwinArch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -143,4 +143,8 @@
|
|||
// LINK_EXPORT_DYNAMIC: {{ld(.exe)?"}}
|
||||
// LINK_EXPORT_DYNAMIC: "-export_dynamic"
|
||||
|
||||
|
||||
// RUN: %clang -target x86_64h-apple-darwin -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_X86_64H_ARCH %s < %t.log
|
||||
//
|
||||
// LINK_X86_64H_ARCH: {{ld(.exe)?"}}
|
||||
// LINK_X86_64H_ARCH: "x86_64h"
|
||||
|
|
Loading…
Reference in New Issue