Skip to content

Commit

Permalink
Only pass -fno-use-linker-plugin on Windows
Browse files Browse the repository at this point in the history
Only pass -fno-use-linker-plugin on Windows where it avoids pulling in
dependencies. Passing it to clang on OS X and Linux would make it fail
though.
  • Loading branch information
skade committed Sep 15, 2014
1 parent 793a366 commit e9c4efb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustc/back/link.rs
Expand Up @@ -931,7 +931,12 @@ fn link_args(cmd: &mut Command,
}

// Rust does its' own LTO
cmd.arg("-fno-lto").arg("-fno-use-linker-plugin");
cmd.arg("-fno-lto");

// clang fails hard if -fno-use-linker-plugin is passed
if sess.targ_cfg.os == abi::OsWindows {
cmd.arg("-fno-use-linker-plugin");
}

// If we're building a dylib, we don't use --gc-sections because LLVM has
// already done the best it can do, and we also don't want to eliminate the
Expand Down

5 comments on commit e9c4efb

@bors
Copy link
Contributor

@bors bors commented on e9c4efb Sep 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at skade@e9c4efb

@bors
Copy link
Contributor

@bors bors commented on e9c4efb Sep 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging skade/rust/fix-osx-linking = e9c4efb into auto

@bors
Copy link
Contributor

@bors bors commented on e9c4efb Sep 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skade/rust/fix-osx-linking = e9c4efb merged ok, testing candidate = 1f5ee97

@bors
Copy link
Contributor

@bors bors commented on e9c4efb Sep 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on e9c4efb Sep 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 1f5ee97

Please sign in to comment.