File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -93,16 +93,16 @@ pub fn std_link(build: &Build,
9393 add_to_sysroot ( & out_dir, & libdir) ;
9494
9595 if target. contains ( "musl" ) && !target. contains ( "mips" ) {
96- copy_third_party_objects ( build, target , & libdir) ;
96+ copy_musl_third_party_objects ( build, & libdir) ;
9797 }
9898}
9999
100100/// Copies the crt(1,i,n).o startup objects
101101///
102102/// Only required for musl targets that statically link to libc
103- fn copy_third_party_objects ( build : & Build , target : & str , into : & Path ) {
103+ fn copy_musl_third_party_objects ( build : & Build , into : & Path ) {
104104 for & obj in & [ "crt1.o" , "crti.o" , "crtn.o" ] {
105- copy ( & compiler_file ( build. cc ( target ) , obj) , & into. join ( obj) ) ;
105+ copy ( & build. config . musl_root . as_ref ( ) . unwrap ( ) . join ( "lib" ) . join ( obj) , & into. join ( obj) ) ;
106106 }
107107}
108108
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ fn main() {
3535 println ! ( "cargo:rustc-link-lib=dl" ) ;
3636 println ! ( "cargo:rustc-link-lib=log" ) ;
3737 println ! ( "cargo:rustc-link-lib=gcc" ) ;
38- } else {
38+ } else if !target . contains ( "musl" ) || target . contains ( "mips" ) {
3939 println ! ( "cargo:rustc-link-lib=dl" ) ;
4040 println ! ( "cargo:rustc-link-lib=rt" ) ;
4141 println ! ( "cargo:rustc-link-lib=pthread" ) ;
You can’t perform that action at this time.
0 commit comments