Only use the -dynamiclib flag when the linker is not ld
This is not a valid flag for ld64. When the ld64 linker is explicitly provided through `config.toml`, rustc will not successfully compile.
This commit is contained in:
parent
32ddd0206c
commit
f44fa6348f
1 changed files with 4 additions and 1 deletions
|
@ -315,7 +315,10 @@ impl<'a> GccLinker<'a> {
|
||||||
fn build_dylib(&mut self, out_filename: &Path) {
|
fn build_dylib(&mut self, out_filename: &Path) {
|
||||||
// On mac we need to tell the linker to let this library be rpathed
|
// On mac we need to tell the linker to let this library be rpathed
|
||||||
if self.sess.target.is_like_osx {
|
if self.sess.target.is_like_osx {
|
||||||
self.cmd.arg("-dynamiclib");
|
if !self.is_ld {
|
||||||
|
self.cmd.arg("-dynamiclib");
|
||||||
|
}
|
||||||
|
|
||||||
self.linker_arg("-dylib");
|
self.linker_arg("-dylib");
|
||||||
|
|
||||||
// Note that the `osx_rpath_install_name` option here is a hack
|
// Note that the `osx_rpath_install_name` option here is a hack
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue