summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Driver/Tools.cpp4
-rw-r--r--clang/test/Driver/arm-no-movt.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 7a185dc0764..bf0470bbd1e 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -938,8 +938,8 @@ static void getARMTargetFeatures(const ToolChain &TC,
if (Args.hasArg(options::OPT_ffixed_r9))
Features.push_back("+reserve-r9");
- // The kext linker doesn't know how to deal with movw/movt.
- if (KernelOrKext)
+ // The kext and FreeBSD linkers don't know how to deal with movw/movt.
+ if (KernelOrKext || Triple.isOSFreeBSD())
Features.push_back("+no-movt");
}
diff --git a/clang/test/Driver/arm-no-movt.c b/clang/test/Driver/arm-no-movt.c
index 9684d0e16cc..1107cf8ff89 100644
--- a/clang/test/Driver/arm-no-movt.c
+++ b/clang/test/Driver/arm-no-movt.c
@@ -4,6 +4,11 @@
// RUN: %clang -target armv7-apple-darwin -mkernel -### %s 2>&1 \
// RUN: | FileCheck %s -check-prefix CHECK-KERNEL
+// RUN: %clang -target armv7-gnueabi-freebsd11 -### %s 2>&1 \
+// RUN: | FileCheck %s -check-prefix CHECK-FREEBSD
+
// CHECK-DEFAULT-NOT: "-target-feature" "+no-movt"
// CHECK-KERNEL: "-target-feature" "+no-movt"
+
+// CHECK-FREEBSD: "-target-feature" "+no-movt"
OpenPOWER on IntegriCloud