summaryrefslogtreecommitdiffstats
path: root/lib/Driver/ToolChains
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2017-11-22 01:38:31 +0000
committerPetr Hosek <phosek@chromium.org>2017-11-22 01:38:31 +0000
commit33284b73bd385c22898301b8937c73d87bcfcc11 (patch)
treea41ac56741a9fbe499b62d3652efe354a4189de1 /lib/Driver/ToolChains
parent5c803947ed21612317ffae768a3866d07953fc36 (diff)
[Driver] Make the use of relax relocations a per target option
The support for relax relocations is dependent on the linker and different toolchains within the same compiler can be using different linkers some of which may or may not support relax relocations. Give toolchains the option to control whether they want to use relax relocations in addition to the existing (global) build system option. Differential Revision: https://reviews.llvm.org/D39831 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318816 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains')
-rw-r--r--lib/Driver/ToolChains/Clang.cpp2
-rw-r--r--lib/Driver/ToolChains/Fuchsia.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp
index 3ab28d471b..d96664cf0b 100644
--- a/lib/Driver/ToolChains/Clang.cpp
+++ b/lib/Driver/ToolChains/Clang.cpp
@@ -1869,7 +1869,7 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
// arg after parsing the '-I' arg.
bool TakeNextArg = false;
- bool UseRelaxRelocations = ENABLE_X86_RELAX_RELOCATIONS;
+ bool UseRelaxRelocations = C.getDefaultToolChain().useRelaxRelocations();
const char *MipsTargetFeature = nullptr;
for (const Arg *A :
Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) {
diff --git a/lib/Driver/ToolChains/Fuchsia.h b/lib/Driver/ToolChains/Fuchsia.h
index 6d825fb817..6f438deca7 100644
--- a/lib/Driver/ToolChains/Fuchsia.h
+++ b/lib/Driver/ToolChains/Fuchsia.h
@@ -43,6 +43,7 @@ public:
bool HasNativeLLVMSupport() const override { return true; }
bool IsIntegratedAssemblerDefault() const override { return true; }
bool IsMathErrnoDefault() const override { return false; }
+ bool useRelaxRelocations() const override { return true; };
RuntimeLibType GetDefaultRuntimeLibType() const override {
return ToolChain::RLT_CompilerRT;
}