]> granicus.if.org Git - clang/commitdiff
Disable generating movt on FreeBSD.
authorDavide Italiano <davide@freebsd.org>
Wed, 30 Dec 2015 13:53:25 +0000 (13:53 +0000)
committerDavide Italiano <davide@freebsd.org>
Wed, 30 Dec 2015 13:53:25 +0000 (13:53 +0000)
It's sort of an hack, but we have no choice.
The linker in the base system doesn't handle that correctly (yet).
Once FreeBSD will import lld, this can be backed out.

Patch by: Andrew Turner!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256641 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/arm-no-movt.c

index 7a185dc0764de630c749e1e0905a33e043d2738b..bf0470bbd1eee7b9316eb516273c58dd4890c826 100644 (file)
@@ -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");
 }
 
index 9684d0e16cce331bfdcef7efd2318dc33cfb9a82..1107cf8ff89a4f29825cd653298625a526263979 100644 (file)
@@ -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"