Skip to content

Commit 4410868

Browse files
committed
Auto merge of rust-lang#106511 - MaskRay:gotpcrelx, r=nikic
Default relax_elf_relocations to true This option tells LLVM to emit relaxable relocation types R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX/R_386_GOT32X in applicable cases. True matches Clang's CMake default since 2020-08 [1] and latest LLVM default[2]. This also works around a GNU ld<2.41 issue[2] when using general-dynamic/local-dynamic TLS models in `-Z plt=no` mode with latest LLVM. [1]: llvm/llvm-project@c41a18c [2]: llvm/llvm-project@2aedfdd [3]: https://sourceware.org/bugzilla/show_bug.cgi?id=24784
2 parents 249595b + f3d8191 commit 4410868

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

Diff for: compiler/rustc_interface/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ fn test_unstable_options_tracking_hash() {
821821
tracked!(profile_emit, Some(PathBuf::from("abc")));
822822
tracked!(profile_sample_use, Some(PathBuf::from("abc")));
823823
tracked!(profiler_runtime, "abc".to_string());
824-
tracked!(relax_elf_relocations, Some(true));
824+
tracked!(relax_elf_relocations, Some(false));
825825
tracked!(relro_level, Some(RelroLevel::Full));
826826
tracked!(remap_cwd_prefix, Some(PathBuf::from("abc")));
827827
tracked!(report_delayed_bugs, true);

Diff for: compiler/rustc_target/src/spec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,7 @@ impl Default for TargetOptions {
22162216
mcount: "mcount".into(),
22172217
llvm_mcount_intrinsic: None,
22182218
llvm_abiname: "".into(),
2219-
relax_elf_relocations: false,
2219+
relax_elf_relocations: true,
22202220
llvm_args: cvs![],
22212221
use_ctors_section: false,
22222222
eh_frame_header: true,

Diff for: compiler/rustc_target/src/spec/x86_64_fortanix_unknown_sgx.rs

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ pub fn target() -> Target {
6969
position_independent_executables: true,
7070
pre_link_args,
7171
override_export_symbols: Some(EXPORT_SYMBOLS.iter().cloned().map(Cow::from).collect()),
72-
relax_elf_relocations: true,
7372
..Default::default()
7473
};
7574
Target {

0 commit comments

Comments
 (0)