Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -938,8 +938,8 @@ 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: test/Driver/arm-no-movt.c =================================================================== --- test/Driver/arm-no-movt.c +++ 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"