1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-25 12:15:32 +03:00
aports/community/rust/musl-fix-linux_musl_base.patch
Rasmus Thomsen 6c8381ba96 community/rust: upgrade to 1.37.0, enable on aarch64&x86 again
Use upstream triplets for now, rust doesn't seem to want to work with our
triplets...

See https://github.com/rust-lang/rust/issues/62447
2019-08-30 02:59:13 -03:00

38 lines
1.9 KiB
Diff

From: Jakub Jirutka <jakub@jirutka.cz>
Date: Sat, 08 Aug 2016 15:06:00 +0200
Subject: [PATCH] Fix linux_musl_base for native musl host
See https://github.com/rust-lang/rust/pull/40113
--- a/src/librustc_target/spec/linux_musl_base.rs
+++ b/src/librustc_target/spec/linux_musl_base.rs
@@ -13,28 +13,13 @@
pub fn opts() -> TargetOptions {
let mut base = super::linux_base::opts();
+ base.need_rpath = true;
- // Make sure that the linker/gcc really don't pull in anything, including
- // default objects, libs, etc.
- base.pre_link_args_crt.insert(LinkerFlavor::Gcc, Vec::new());
- base.pre_link_args_crt.get_mut(&LinkerFlavor::Gcc).unwrap().push("-nostdlib".to_string());
-
// At least when this was tested, the linker would not add the
// `GNU_EH_FRAME` program header to executables generated, which is required
// when unwinding to locate the unwinding information. I'm not sure why this
// argument is *not* necessary for normal builds, but it can't hurt!
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-Wl,--eh-frame-hdr".to_string());
- // When generating a statically linked executable there's generally some
- // small setup needed which is listed in these files. These are provided by
- // a musl toolchain and are linked by default by the `musl-gcc` script. Note
- // that `gcc` also does this by default, it just uses some different files.
- //
- // Each target directory for musl has these object files included in it so
- // they'll be included from there.
- base.pre_link_objects_exe_crt.push("crt1.o".to_string());
- base.pre_link_objects_exe_crt.push("crti.o".to_string());
- base.post_link_objects_crt.push("crtn.o".to_string());
-
// These targets statically link libc by default
base.crt_static_default = true;
// These targets allow the user to choose between static and dynamic linking.