@@ -13,7 +13,6 @@ pub struct RPathConfig<'a> {
1313 pub is_like_osx : bool ,
1414 pub has_rpath : bool ,
1515 pub linker_is_gnu : bool ,
16- pub get_install_prefix_lib_path : & ' a mut dyn FnMut ( ) -> PathBuf ,
1716}
1817
1918pub fn get_rpath_flags ( config : & mut RPathConfig < ' _ > ) -> Vec < String > {
@@ -63,24 +62,13 @@ fn get_rpaths(config: &mut RPathConfig<'_>, libs: &[PathBuf]) -> Vec<String> {
6362 // Use relative paths to the libraries. Binaries can be moved
6463 // as long as they maintain the relative relationship to the
6564 // crates they depend on.
66- let rel_rpaths = get_rpaths_relative_to_output ( config, libs) ;
65+ let rpaths = get_rpaths_relative_to_output ( config, libs) ;
6766
68- // And a final backup rpath to the global library location.
69- let fallback_rpaths = vec ! [ get_install_prefix_rpath( config) ] ;
70-
71- fn log_rpaths ( desc : & str , rpaths : & [ String ] ) {
72- debug ! ( "{} rpaths:" , desc) ;
73- for rpath in rpaths {
74- debug ! ( " {}" , * rpath) ;
75- }
67+ debug ! ( "rpaths:" ) ;
68+ for rpath in & rpaths {
69+ debug ! ( " {}" , rpath) ;
7670 }
7771
78- log_rpaths ( "relative" , & rel_rpaths) ;
79- log_rpaths ( "fallback" , & fallback_rpaths) ;
80-
81- let mut rpaths = rel_rpaths;
82- rpaths. extend_from_slice ( & fallback_rpaths) ;
83-
8472 // Remove duplicates
8573 minimize_rpaths ( & rpaths)
8674}
@@ -113,13 +101,6 @@ fn path_relative_from(path: &Path, base: &Path) -> Option<PathBuf> {
113101 diff_paths ( path, base)
114102}
115103
116- fn get_install_prefix_rpath ( config : & mut RPathConfig < ' _ > ) -> String {
117- let path = ( config. get_install_prefix_lib_path ) ( ) ;
118- let path = env:: current_dir ( ) . unwrap ( ) . join ( & path) ;
119- // FIXME (#9639): This needs to handle non-utf8 paths
120- path. to_str ( ) . expect ( "non-utf8 component in rpath" ) . to_owned ( )
121- }
122-
123104fn minimize_rpaths ( rpaths : & [ String ] ) -> Vec < String > {
124105 let mut set = FxHashSet :: default ( ) ;
125106 let mut minimized = Vec :: new ( ) ;
0 commit comments