Skip to content

Commit c41a18c

Browse files
committed
[CMake] Default ENABLE_X86_RELAX_RELOCATIONS to ON
This makes clang default to -Wa,-mrelax-relocations=yes, which enables R_386_GOT32X (GNU as enables it regardless of -mrelax-relocations=) and R_X86_64_[REX_]GOTPCRELX in MC. The produced object files require GNU ld>=2.26 to link. binutils 2.26 is considered a very old release today.
1 parent 5a4cd55 commit c41a18c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: clang/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ set(DEFAULT_SYSROOT "" CACHE STRING
259259

260260
set(ENABLE_LINKER_BUILD_ID OFF CACHE BOOL "pass --build-id to ld")
261261

262-
set(ENABLE_X86_RELAX_RELOCATIONS OFF CACHE BOOL
262+
set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL
263263
"enable x86 relax relocations by default")
264264

265265
set(ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER FALSE CACHE BOOL

Diff for: llvm/utils/gn/secondary/clang/include/clang/Config/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ write_cmake_config("Config") {
3333
"GCC_INSTALL_PREFIX=",
3434
"BACKEND_PACKAGE_STRING=LLVM ${llvm_version}git",
3535
"ENABLE_LINKER_BUILD_ID=",
36-
"ENABLE_X86_RELAX_RELOCATIONS=",
36+
"ENABLE_X86_RELAX_RELOCATIONS=1",
3737
"ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=",
3838
"CLANG_ENABLE_OBJC_REWRITER=1", # FIXME: flag?
3939
"CLANG_SYSTEMZ_DEFAULT_ARCH=z10",

0 commit comments

Comments
 (0)