File tree 4 files changed +10
-8
lines changed
4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -377,6 +377,11 @@ impl<'a> Builder<'a> {
377
377
self . ensure ( Libdir { compiler, target } )
378
378
}
379
379
380
+ pub fn sysroot_codegen_backends ( & self , compiler : Compiler ) -> PathBuf {
381
+ self . sysroot_libdir ( compiler, compiler. host )
382
+ . with_file_name ( "codegen-backends" )
383
+ }
384
+
380
385
/// Returns the compiler's libdir where it stores the dynamic libraries that
381
386
/// it itself links against.
382
387
///
Original file line number Diff line number Diff line change @@ -724,8 +724,7 @@ fn copy_codegen_backends_to_sysroot(builder: &Builder,
724
724
//
725
725
// Here we're looking for the output dylib of the `CodegenBackend` step and
726
726
// we're copying that into the `codegen-backends` folder.
727
- let libdir = builder. sysroot_libdir ( target_compiler, target) ;
728
- let dst = libdir. join ( "codegen-backends" ) ;
727
+ let dst = builder. sysroot_codegen_backends ( target_compiler) ;
729
728
t ! ( fs:: create_dir_all( & dst) ) ;
730
729
731
730
for backend in builder. config . rust_codegen_backends . iter ( ) {
Original file line number Diff line number Diff line change @@ -435,11 +435,9 @@ impl Step for Rustc {
435
435
}
436
436
437
437
// Copy over the codegen backends
438
- let backends_src = builder. sysroot_libdir ( compiler, host)
439
- . join ( "codegen-backends" ) ;
440
- let backends_dst = image. join ( "lib/rustlib" )
441
- . join ( & * host)
442
- . join ( "lib/codegen-backends" ) ;
438
+ let backends_src = builder. sysroot_codegen_backends ( compiler) ;
439
+ let backends_rel = backends_src. strip_prefix ( & src) . unwrap ( ) ;
440
+ let backends_dst = image. join ( & backends_rel) ;
443
441
t ! ( fs:: create_dir_all( & backends_dst) ) ;
444
442
cp_r ( & backends_src, & backends_dst) ;
445
443
Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ fn get_trans_sysroot(backend_name: &str) -> fn() -> Box<TransCrate> {
289
289
let sysroot = sysroot_candidates. iter ( )
290
290
. map ( |sysroot| {
291
291
let libdir = filesearch:: relative_target_lib_path ( & sysroot, & target) ;
292
- sysroot. join ( & libdir) . join ( "codegen-backends" )
292
+ sysroot. join ( libdir) . with_file_name ( "codegen-backends" )
293
293
} )
294
294
. filter ( |f| {
295
295
info ! ( "codegen backend candidate: {}" , f. display( ) ) ;
You can’t perform that action at this time.
0 commit comments