Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for -fno-plt #351

Merged
merged 1 commit into from
Sep 28, 2018
Merged

Conversation

GabrielMajeri
Copy link
Contributor

@GabrielMajeri GabrielMajeri commented Sep 27, 2018

Similar to rust-lang/rust#54592, this PR enables the -fno-plt compiler flag by default when PIC is used. Should provide a small performance improvement with no obvious downsides.

@GabrielMajeri GabrielMajeri force-pushed the no-plt branch 4 times, most recently from fd59191 to e16de19 Compare September 27, 2018 04:47
@GabrielMajeri
Copy link
Contributor Author

Uh, I've run into a problem: how do I check if flag_is_supported from inside try_get_compiler? Because it seems it causes an infinite loop.

@alexcrichton
Copy link
Member

Hm so unfortunately is_flag_supported is somewhat expensive, could this perhaps default to off for now?

@GabrielMajeri
Copy link
Contributor Author

@alexcrichton Ok, I've made it so that this flag is not enabled by default. Another alterantive would've been to look at GCC's / Clang's version directly, and hard-code a version check, but it looks like we don't retrieve the compiler's version at any point.

@GabrielMajeri GabrielMajeri changed the title Enable -fno-plt by default Add support for -fno-plt Sep 28, 2018
@alexcrichton alexcrichton merged commit 82d730b into rust-lang:master Sep 28, 2018
@alexcrichton
Copy link
Member

Ok thanks!

@GabrielMajeri GabrielMajeri deleted the no-plt branch September 28, 2018 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants