mirror of https://github.com/microsoft/clang.git
[Driver] Don't forward -m[no-]unaligned-access options to GCC when assembling/linking
Differential Revision: https://reviews.llvm.org/D45092 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329810 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6f411905a8
commit
7175a52e21
|
@ -85,6 +85,13 @@ void tools::gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
A->getOption().matches(options::OPT_W_Group))
|
||||
continue;
|
||||
|
||||
// Don't forward -mno-unaligned-access since GCC doesn't understand
|
||||
// it and because it doesn't affect the assembly or link steps.
|
||||
if ((isa<AssembleJobAction>(JA) || isa<LinkJobAction>(JA)) &&
|
||||
(A->getOption().matches(options::OPT_munaligned_access) ||
|
||||
A->getOption().matches(options::OPT_mno_unaligned_access)))
|
||||
continue;
|
||||
|
||||
A->render(Args, CmdArgs);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,3 +34,9 @@
|
|||
// RUN: | FileCheck --check-prefix=CHECK-ASM %s
|
||||
// CHECK-ASM: as
|
||||
// CHECK-ASM-NOT: "-g"
|
||||
|
||||
// Check that we're not forwarding -mno-unaligned-access.
|
||||
// RUN: %clang -target aarch64-none-elf -mno-unaligned-access %s -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-ARM %s
|
||||
// CHECK-ARM: gcc{{[^"]*}}"
|
||||
// CHECK-ARM-NOT: -mno-unaligned-access
|
||||
|
|
Loading…
Reference in New Issue