Skip to content

Commit

Permalink
Auto merge of #35178 - m4b:fix-relx-musl, r=alexcrichton
Browse files Browse the repository at this point in the history
Add -mrelax-relocations=no hacks to fix musl build

* this is just a start, dunno if it will work, but I'll just push it out to get feedback (my rust is still building 😢)
* I don't know much about rustbuild, so i just added that flag in there. it's a total hack, don't judge me
* I suspect the places in the musl .mk files are sufficient (but we may also need it present when building std), I'm not sure, needs more testing.
  • Loading branch information
bors authored Aug 3, 2016
2 parents ea07d52 + 5383cd7 commit 9cf1897
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mk/cfg/x86_64-unknown-linux-musl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 :=
Expand Down
6 changes: 6 additions & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,12 @@ impl Build {
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
}

Expand Down

0 comments on commit 9cf1897

Please sign in to comment.