Skip to content

Instantly share code, notes, and snippets.

@jupp0r
Created July 19, 2016 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jupp0r/ac4116a3c222672320ffcf7b3431e65e to your computer and use it in GitHub Desktop.
Save jupp0r/ac4116a3c222672320ffcf7b3431e65e to your computer and use it in GitHub Desktop.
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 8ec9c7f..1f60e9d 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -102,7 +102,7 @@ pub fn std_link(build: &Build,
///
/// Only required for musl targets that statically link to libc
fn copy_third_party_objects(build: &Build, target: &str, into: &Path) {
- for &obj in &["crt1.o", "crti.o", "crtn.o"] {
+ for &obj in &["crtbegin.o", "crtend.o", "crt1.o", "crti.o", "crtn.o"] {
copy(&compiler_file(build.cc(target), obj), &into.join(obj));
}
}
diff --git a/src/librustc_back/target/linux_musl_base.rs b/src/librustc_back/target/linux_musl_base.rs
index d55907a..bad40ea 100644
--- a/src/librustc_back/target/linux_musl_base.rs
+++ b/src/librustc_back/target/linux_musl_base.rs
@@ -57,7 +57,9 @@ pub fn opts() -> TargetOptions {
// Each target directory for musl has these object files included in it so
// they'll be included from there.
base.pre_link_objects_exe.push("crt1.o".to_string());
- base.pre_link_objects_exe.push("crti.o".to_string());
+ base.pre_link_objects_exe.push("crtbegin.o".to_string());
+ base.pre_link_objects_exe.push("crtend.o".to_string());
+ base.pre_link_objects_exe.push("crti.o".to_string());
base.post_link_objects.push("crtn.o".to_string());
// MUSL support doesn't currently include dynamic linking, so there's no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment