Re: [Patch] Add a ENABLE_X86_RELAX_RELOCATIONS cmake option

2016-06-20 Thread Chris Bieneman via cfe-commits
Patch LGTM.

-Chris

> On Jun 17, 2016, at 12:36 PM, Rafael EspĂ­ndola  
> wrote:
> 
> This corresponds to binutils' --enable-x86-relax-relocations.
> 
> Cheers,
> Rafael
> <0001-Add-a-ENABLE_X86_RELAX_RELOCATIONS-cmake-option.patch>

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[Patch] Add a ENABLE_X86_RELAX_RELOCATIONS cmake option

2016-06-17 Thread Rafael EspĂ­ndola via cfe-commits
This corresponds to binutils' --enable-x86-relax-relocations.

Cheers,
Rafael
From 1d5920b88d06afe0575313f3b2fc327a5069e32c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?=
 <rafael.espind...@gmail.com>
Date: Fri, 17 Jun 2016 15:33:29 -0400
Subject: [PATCH] Add a ENABLE_X86_RELAX_RELOCATIONS  cmake option.

This corresponds to binutils' --enable-x86-relax-relocations.
---
 CMakeLists.txt  | 3 +++
 include/clang/Config/config.h.cmake | 3 +++
 lib/Driver/Tools.cpp| 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8516644..114d230 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 09f5e4b..e5a1d0d 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 b911c17..6152291 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -2837,7 +2837,7 @@ static void CollectArgsForIntegratedAssembler(Compilation ,
   // 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)) {
-- 
2.5.5

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits