@@ -649,10 +649,6 @@ impl Build {
649
649
self . ar . get ( & target) . map ( |p| & * * p)
650
650
}
651
651
652
- fn linker ( & self , target : Interned < String > ) -> Option < & Path > {
653
- self . config . target_config . get ( & target) . and_then ( |c| c. linker . as_ref ( ) . map ( |p| & * * p) )
654
- }
655
-
656
652
/// Returns the path to the C++ compiler for the target specified.
657
653
fn cxx ( & self , target : Interned < String > ) -> Result < & Path , String > {
658
654
match self . cxx . get ( & target) {
@@ -663,24 +659,16 @@ impl Build {
663
659
}
664
660
}
665
661
666
- /// Returns flags to pass to the compiler to generate code for `target`.
667
- fn rustc_flags ( & self , target : Interned < String > ) -> Vec < String > {
668
- // New flags should be added here with great caution!
669
- //
670
- // It's quite unfortunate to **require** flags to generate code for a
671
- // target, so it should only be passed here if absolutely necessary!
672
- // Most default configuration should be done through target specs rather
673
- // than an entry here.
674
-
675
- let mut base = Vec :: new ( ) ;
676
- if let Some ( linker) = self . linker ( target) {
677
- // If linker was explictly provided, force it on all the compiled Rust code.
678
- base. push ( format ! ( "-Clinker={}" , linker. display( ) ) ) ;
679
- } else if target != self . config . build && !target. contains ( "msvc" ) &&
680
- !target. contains ( "emscripten" ) {
681
- base. push ( format ! ( "-Clinker={}" , self . cc( target) . display( ) ) ) ;
662
+ /// Returns the path to the linker for the given target if it needs to be overriden.
663
+ fn linker ( & self , target : Interned < String > ) -> Option < & Path > {
664
+ if let Some ( config) = self . config . target_config . get ( & target) {
665
+ config. linker . as_ref ( ) . map ( |p| & * * p)
666
+ } else if target != self . config . build &&
667
+ !target. contains ( "msvc" ) && !target. contains ( "emscripten" ) {
668
+ Some ( self . cc ( target) )
669
+ } else {
670
+ None
682
671
}
683
- base
684
672
}
685
673
686
674
/// Returns if this target should statically link the C runtime, if specified
0 commit comments