Created
June 17, 2011 18:15
-
-
Save eholk/1031941 to your computer and use it in GitHub Desktop.
An initial look at rpath for rust in linux.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs | |
index e0a6d28..aa2a226 100644 | |
--- a/src/comp/driver/rustc.rs | |
+++ b/src/comp/driver/rustc.rs | |
@@ -418,6 +418,13 @@ fn main(vec[str] args) { | |
case (session::os_linux) { | |
shared_cmd = "-shared"; | |
gcc_args = common_args + ["-march=i686", "-O2", "-m32"]; | |
+ | |
+ auto opts = sess.get_opts(); | |
+ for (str path in opts.library_search_paths) { | |
+ path = fs::make_absolute(path); | |
+ log_err "Adding " + path + " to rpath."; | |
+ gcc_args += ["-Xlinker", "-rpath=" + path]; | |
+ } | |
} | |
} | |
if (sopts.shared) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment