[cfe-commits] r168841 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/apple-kext-mkernel.c
Chad Rosier
mcrosier at apple.com
Wed Nov 28 16:42:06 PST 2012
Author: mcrosier
Date: Wed Nov 28 18:42:06 2012
New Revision: 168841
URL: http://llvm.org/viewvc/llvm-project?rev=168841&view=rev
Log:
[driver] -mkernel implies -mstrict-align; don't add the redundant option.
rdar://12771737
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/apple-kext-mkernel.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=168841&r1=168840&r2=168841&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Nov 28 18:42:06 2012
@@ -2508,7 +2508,8 @@
StringRef alignment = Args.getLastArgValue(options::OPT_mstack_alignment);
CmdArgs.push_back(Args.MakeArgString("-mstack-alignment=" + alignment));
}
- if (Args.hasArg(options::OPT_mstrict_align)) {
+ // -mkernel implies -mstrict-align; don't add the redundant option.
+ if (Args.hasArg(options::OPT_mstrict_align) && !KernelOrKext) {
CmdArgs.push_back("-backend-option");
CmdArgs.push_back("-arm-strict-align");
}
Modified: cfe/trunk/test/Driver/apple-kext-mkernel.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/apple-kext-mkernel.c?rev=168841&r1=168840&r2=168841&view=diff
==============================================================================
--- cfe/trunk/test/Driver/apple-kext-mkernel.c (original)
+++ cfe/trunk/test/Driver/apple-kext-mkernel.c Wed Nov 28 18:42:06 2012
@@ -8,11 +8,12 @@
// CHECK-X86: "-fno-common"
// RUN: %clang -target x86_64-apple-darwin10 \
-// RUN: -arch armv7 -mkernel -### -fsyntax-only %s 2> %t
+// RUN: -arch armv7 -mkernel -mstrict-align -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-ARM < %t %s
// CHECK-ARM: "-backend-option" "-arm-long-calls"
// CHECK-ARM: "-backend-option" "-arm-strict-align"
+// CHECK-ARM-NOT: "-backend-option" "-arm-strict-align"
// CHECK-ARM: "-fno-builtin"
// CHECK-ARM: "-fno-rtti"
// CHECK-ARM: "-fno-common"
More information about the cfe-commits
mailing list