@@ -13,7 +13,6 @@ pub struct RPathConfig<'a> {
13
13
pub is_like_osx : bool ,
14
14
pub has_rpath : bool ,
15
15
pub linker_is_gnu : bool ,
16
- pub get_install_prefix_lib_path : & ' a mut dyn FnMut ( ) -> PathBuf ,
17
16
}
18
17
19
18
pub fn get_rpath_flags ( config : & mut RPathConfig < ' _ > ) -> Vec < String > {
@@ -63,24 +62,13 @@ fn get_rpaths(config: &mut RPathConfig<'_>, libs: &[PathBuf]) -> Vec<String> {
63
62
// Use relative paths to the libraries. Binaries can be moved
64
63
// as long as they maintain the relative relationship to the
65
64
// 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) ;
67
66
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) ;
76
70
}
77
71
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
-
84
72
// Remove duplicates
85
73
minimize_rpaths ( & rpaths)
86
74
}
@@ -113,13 +101,6 @@ fn path_relative_from(path: &Path, base: &Path) -> Option<PathBuf> {
113
101
diff_paths ( path, base)
114
102
}
115
103
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
-
123
104
fn minimize_rpaths ( rpaths : & [ String ] ) -> Vec < String > {
124
105
let mut set = FxHashSet :: default ( ) ;
125
106
let mut minimized = Vec :: new ( ) ;
0 commit comments