Make rpath work on mac
This commit is contained in:
parent
9c037d2194
commit
d8a85f0758
4 changed files with 16 additions and 5 deletions
|
|
@ -567,6 +567,13 @@ fn link_binary(sess: session::session,
|
|||
|
||||
if sess.get_opts().library {
|
||||
gcc_args += [lib_cmd];
|
||||
|
||||
// On mac we need to tell the linker to let this library
|
||||
// be rpathed
|
||||
if sess.get_targ_cfg().os == session::os_macos {
|
||||
gcc_args += ["-Wl,-install_name,@rpath/"
|
||||
+ fs::basename(saved_out_filename)];
|
||||
}
|
||||
} else {
|
||||
// FIXME: why do we hardcode -lm?
|
||||
gcc_args += ["-lm", main];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue