mirror of
https://github.com/rust-lang/rust
synced 2024-11-02 15:36:35 +00:00
Add -mrelax-relocations=no hacks to fix musl build
This commit is contained in:
parent
1ece9ca968
commit
884b969f2a
2 changed files with 8 additions and 2 deletions
|
@ -7,8 +7,8 @@ CFG_INSTALL_ONLY_RLIB_x86_64-unknown-linux-musl = 1
|
|||
CFG_LIB_NAME_x86_64-unknown-linux-musl=lib$(1).so
|
||||
CFG_STATIC_LIB_NAME_x86_64-unknown-linux-musl=lib$(1).a
|
||||
CFG_LIB_GLOB_x86_64-unknown-linux-musl=lib$(1)-*.so
|
||||
CFG_JEMALLOC_CFLAGS_x86_64-unknown-linux-musl := -m64
|
||||
CFG_GCCISH_CFLAGS_x86_64-unknown-linux-musl := -g -fPIC -m64
|
||||
CFG_JEMALLOC_CFLAGS_x86_64-unknown-linux-musl := -m64 -Wa,-mrelax-relocations=no
|
||||
CFG_GCCISH_CFLAGS_x86_64-unknown-linux-musl := -g -fPIC -m64 -Wa,-mrelax-relocations=no
|
||||
CFG_GCCISH_CXXFLAGS_x86_64-unknown-linux-musl :=
|
||||
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-linux-musl :=
|
||||
CFG_GCCISH_DEF_FLAG_x86_64-unknown-linux-musl :=
|
||||
|
|
|
@ -855,6 +855,12 @@ fn cflags(&self, target: &str) -> Vec<String> {
|
|||
base.push("-stdlib=libc++".into());
|
||||
base.push("-mmacosx-version-min=10.7".into());
|
||||
}
|
||||
// This is a hack, because newer binutils broke things
|
||||
// on some vms/distros (i.e., linking against unknown relocs disabled by the following flag)
|
||||
// See: https://github.com/rust-lang/rust/issues/34978
|
||||
if target == "x86_64-unknown-linux-musl" {
|
||||
base.push("-Wa,-mrelax-relocations=no".into());
|
||||
}
|
||||
return base
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue