File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed
Expand file tree Collapse file tree 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> {
377377 self . ensure ( Libdir { compiler, target } )
378378 }
379379
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+
380385 /// Returns the compiler's libdir where it stores the dynamic libraries that
381386 /// it itself links against.
382387 ///
Original file line number Diff line number Diff line change @@ -724,8 +724,7 @@ fn copy_codegen_backends_to_sysroot(builder: &Builder,
724724 //
725725 // Here we're looking for the output dylib of the `CodegenBackend` step and
726726 // 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) ;
729728 t ! ( fs:: create_dir_all( & dst) ) ;
730729
731730 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 {
435435 }
436436
437437 // 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) ;
443441 t ! ( fs:: create_dir_all( & backends_dst) ) ;
444442 cp_r ( & backends_src, & backends_dst) ;
445443
Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ fn get_trans_sysroot(backend_name: &str) -> fn() -> Box<TransCrate> {
289289 let sysroot = sysroot_candidates. iter ( )
290290 . map ( |sysroot| {
291291 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" )
293293 } )
294294 . filter ( |f| {
295295 info ! ( "codegen backend candidate: {}" , f. display( ) ) ;
You can’t perform that action at this time.
0 commit comments