зеркало из https://github.com/microsoft/clang-1.git
Driver/Darwin: Honor -Xarch_FOO when the arch matches either the toolchain or
the architecture being bound. - Fixes things like -Xarch_armv7. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
c3b9014c72
Коммит
2a45fa7cf6
|
@ -682,8 +682,13 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args,
|
|||
Arg *A = *it;
|
||||
|
||||
if (A->getOption().matches(options::OPT_Xarch__)) {
|
||||
// Skip this argument unless the architecture matches either the toolchain
|
||||
// triple arch, or the arch being bound.
|
||||
//
|
||||
// FIXME: Canonicalize name.
|
||||
if (getArchName() != A->getValue(Args, 0))
|
||||
llvm::StringRef XarchArch = A->getValue(Args, 0);
|
||||
if (!(XarchArch == getArchName() ||
|
||||
(BoundArch && XarchArch == BoundArch)))
|
||||
continue;
|
||||
|
||||
Arg *OriginalArg = A;
|
||||
|
|
|
@ -12,3 +12,9 @@
|
|||
// RUN: FileCheck --check-prefix=CHECK-LINK < %t %s
|
||||
//
|
||||
// CHECK-LINK: ld{{.*}} "-arch" "i386"{{.*}} "-some-linker-arg"
|
||||
|
||||
// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### \
|
||||
// RUN: -arch armv7 -Xarch_armv7 -Wl,-some-linker-arg -filelist X 2> %t
|
||||
// RUN: FileCheck --check-prefix=CHECK-ARMV7-LINK < %t %s
|
||||
//
|
||||
// CHECK-ARMV7-LINK: ld{{.*}} "-arch" "armv7"{{.*}} "-some-linker-arg"
|
||||
|
|
Загрузка…
Ссылка в новой задаче