Skip to content

Commit 8ee6215

Browse files
committed
---
yaml --- r: 5719 b: refs/heads/master c: 5cd6dbd h: refs/heads/master i: 5717: f3ada49 5715: 21feca0 5711: 9fb5a03 v: v3
1 parent e33370f commit 8ee6215

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 04e89af6dbf0e99c8cec6763a81b41dcf51e52c3
2+
refs/heads/master: 5cd6dbd5b9e53e374e6abf1ee433ca5b16360cf3

trunk/src/comp/back/rpath.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn get_rpaths(os: session::os, cwd: fs::path, sysroot: fs::path,
7171
let abs_rpaths = get_absolute_rpaths(cwd, libs);
7272

7373
// And a final backup rpath to the global library location.
74-
let fallback_rpaths = [get_install_prefix_rpath(target_triple)];
74+
let fallback_rpaths = [get_install_prefix_rpath(cwd, target_triple)];
7575

7676
fn log_rpaths(desc: str, rpaths: [str]) {
7777
log #fmt("%s rpaths:", desc);
@@ -166,7 +166,7 @@ fn get_absolute(cwd: fs::path, lib: fs::path) -> fs::path {
166166
}
167167
}
168168

169-
fn get_install_prefix_rpath(target_triple: str) -> str {
169+
fn get_install_prefix_rpath(cwd: fs::path, target_triple: str) -> str {
170170
let install_prefix = #env("CFG_PREFIX");
171171

172172
if install_prefix == "" {
@@ -176,7 +176,7 @@ fn get_install_prefix_rpath(target_triple: str) -> str {
176176
let path = [install_prefix]
177177
+ filesearch::relative_target_lib_path(target_triple);
178178
check vec::is_not_empty(path);
179-
fs::connect_many(path)
179+
get_absolute(cwd, fs::connect_many(path))
180180
}
181181

182182
fn minimize_rpaths(rpaths: [str]) -> [str] {
@@ -219,8 +219,15 @@ mod test {
219219

220220
#[test]
221221
fn test_prefix_rpath() {
222-
let res = get_install_prefix_rpath("triple");
223-
assert res == #env("CFG_PREFIX") + "/lib/rustc/triple/lib";
222+
let res = get_install_prefix_rpath("/usr/lib", "triple");
223+
assert str::ends_with(res, #env("CFG_PREFIX")
224+
+ "/lib/rustc/triple/lib");
225+
}
226+
227+
#[test]
228+
fn test_prefix_rpath_abs() {
229+
let res = get_install_prefix_rpath("/usr/lib", "triple");
230+
assert str::starts_with(res, "/");
224231
}
225232

226233
#[test]

0 commit comments

Comments
 (0)