diff options
Diffstat (limited to 'src/comp/back/rpath.rs')
| -rw-r--r-- | src/comp/back/rpath.rs | 10 | 
1 files changed, 10 insertions, 0 deletions
diff --git a/src/comp/back/rpath.rs b/src/comp/back/rpath.rs index d7eaa083bfb..fccacdcba80 100644 --- a/src/comp/back/rpath.rs +++ b/src/comp/back/rpath.rs @@ -105,6 +105,7 @@ fn get_rpath_relative_to_output(os: session::os, // Mac doesn't appear to support $ORIGIN let prefix = alt os { session::os_linux. { "$ORIGIN" + fs::path_sep() } + session::os_freebsd. { "$ORIGIN" + fs::path_sep() } session::os_macos. { "@executable_path" + fs::path_sep() } }; @@ -191,6 +192,7 @@ fn minimize_rpaths(rpaths: [str]) -> [str] { #[cfg(target_os = "linux")] #[cfg(target_os = "macos")] +#[cfg(target_os = "freebsd")] #[cfg(test)] mod test { #[test] @@ -316,6 +318,14 @@ mod test { } #[test] + #[cfg(target_os = "freebsd")] + fn test_rpath_relative() { + let res = get_rpath_relative_to_output(session::os_freebsd, + "/usr", "bin/rustc", "lib/libstd.so"); + assert res == "$ORIGIN/../lib"; + } + + #[test] #[cfg(target_os = "macos")] fn test_rpath_relative() { let res = get_rpath_relative_to_output(session::os_macos,  | 
