summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-06-20 23:54:44 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-06-20 23:54:44 +0000
commit3379242a90dd506c66e943eb2df9bf91ee4651ee (patch)
tree07017a4b0f7599a91b03d309bf261cd8540cde90
parent072c1da32a9b001d375469c3a2babff9c261525f (diff)
downloadclang-3379242a90dd506c66e943eb2df9bf91ee4651ee.tar.gz
Add a ENABLE_X86_RELAX_RELOCATIONS cmake option.
This corresponds to binutils' --enable-x86-relax-relocations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273224 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt3
-rw-r--r--include/clang/Config/config.h.cmake3
-rw-r--r--lib/Driver/Tools.cpp2
3 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 851664427a..114d23095e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -185,6 +185,9 @@ set(DEFAULT_SYSROOT "" CACHE PATH
set(ENABLE_LINKER_BUILD_ID OFF CACHE BOOL "pass --build-id to ld")
+set(ENABLE_X86_RELAX_RELOCATIONS OFF CACHE BOOL
+ "enable x86 relax relocations by default")
+
set(CLANG_DEFAULT_CXX_STDLIB "" CACHE STRING
"Default C++ stdlib to use (empty for architecture default, \"libstdc++\" or \"libc++\"")
if (NOT(CLANG_DEFAULT_CXX_STDLIB STREQUAL "" OR
diff --git a/include/clang/Config/config.h.cmake b/include/clang/Config/config.h.cmake
index 09f5e4b3b3..e5a1d0dac8 100644
--- a/include/clang/Config/config.h.cmake
+++ b/include/clang/Config/config.h.cmake
@@ -41,4 +41,7 @@
/* pass --build-id to ld */
#cmakedefine ENABLE_LINKER_BUILD_ID
+/* enable x86 relax relocations by default */
+#cmakedefine01 ENABLE_X86_RELAX_RELOCATIONS
+
#endif
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index a23f660a11..c0d6c52db8 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -2839,7 +2839,7 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
// options.
bool CompressDebugSections = false;
- bool UseRelaxRelocations = false;
+ bool UseRelaxRelocations = ENABLE_X86_RELAX_RELOCATIONS;
const char *MipsTargetFeature = nullptr;
for (const Arg *A :
Args.filtered(options::OPT_Wa_COMMA, options::OPT_Xassembler)) {