]> granicus.if.org Git - clang/commitdiff
Add a ENABLE_X86_RELAX_RELOCATIONS cmake option.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 20 Jun 2016 23:54:44 +0000 (23:54 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 20 Jun 2016 23:54:44 +0000 (23:54 +0000)
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

CMakeLists.txt
include/clang/Config/config.h.cmake
lib/Driver/Tools.cpp

index 851664427ad66ba1b47485379d3a0083ed0ab4b7..114d23095eefe03701a017b7b68723e8d41524a8 100644 (file)
@@ -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
index 09f5e4b3b36204d809ce89ca3e297a0509799719..e5a1d0dac8371bae5b2bd83c6a6be2be309c36a3 100644 (file)
@@ -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
index a23f660a11b67c7e960553fe2b4a3a6dc10bb83f..c0d6c52db8008130f4dbbe83d198030fceeee83e 100644 (file)
@@ -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)) {