Skip to content

Commit 831d861

Browse files
committed
Mac uses @executable_path instead of $ORIGIN
1 parent 5cd6dbd commit 831d861

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/comp/back/rpath.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn get_rpath_relative_to_output(os: session::os,
105105
// Mac doesn't appear to support $ORIGIN
106106
let prefix = alt os {
107107
session::os_linux. { "$ORIGIN" + fs::path_sep() }
108-
session::os_macos. { "" }
108+
session::os_macos. { "@executable_path" + fs::path_sep() }
109109
};
110110

111111
prefix + get_relative_to(
@@ -322,7 +322,7 @@ mod test {
322322
fn test_rpath_relative() {
323323
let res = get_rpath_relative_to_output(session::os_macos,
324324
"/usr", "bin/rustc", "lib/libstd.so");
325-
assert res == "../lib";
325+
assert res == "@executable_path/../lib";
326326
}
327327

328328
#[test]

0 commit comments

Comments
 (0)