File tree 2 files changed +4
-4
lines changed
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,
93
93
add_to_sysroot ( & out_dir, & libdir) ;
94
94
95
95
if target. contains ( "musl" ) && !target. contains ( "mips" ) {
96
- copy_third_party_objects ( build, target , & libdir) ;
96
+ copy_musl_third_party_objects ( build, & libdir) ;
97
97
}
98
98
}
99
99
100
100
/// Copies the crt(1,i,n).o startup objects
101
101
///
102
102
/// 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 ) {
104
104
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) ) ;
106
106
}
107
107
}
108
108
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ fn main() {
35
35
println ! ( "cargo:rustc-link-lib=dl" ) ;
36
36
println ! ( "cargo:rustc-link-lib=log" ) ;
37
37
println ! ( "cargo:rustc-link-lib=gcc" ) ;
38
- } else {
38
+ } else if !target . contains ( "musl" ) || target . contains ( "mips" ) {
39
39
println ! ( "cargo:rustc-link-lib=dl" ) ;
40
40
println ! ( "cargo:rustc-link-lib=rt" ) ;
41
41
println ! ( "cargo:rustc-link-lib=pthread" ) ;
You can’t perform that action at this time.
0 commit comments