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

Disallow LTO with a preference to dynamic linking #11157

Closed
wants to merge 1 commit into from

Conversation

alexcrichton
Copy link
Member

Closes #11154

@klutzy
Copy link
Contributor

klutzy commented Dec 27, 2013

It may be better if -Z lto -Z prefer-dynamic is disallowed at driver-level to save build time.

@pcwalton
Copy link
Contributor

Agreed with @klutzy.

@alexcrichton
Copy link
Member Author

I'm trying to keep things like LTO and output format to be fairly self-contained instead of spraying various bits and pieces across modules. It looks like I could easily add the check if sess.lto() && sess.prefer_dynamic() { fatal } to driver/driver.rs early in the compilation process, but then you still have the error which is generated if you attempt to produce a dylib output with LTO enabled.

I could move both of these checks up much earlier in the compilation process (doesn't really make sense to me to have only one early up), but I'm afraid that it's sharding the logic of LTO too much across the compiler. It is sad that it's so late in the compilation process, but this isn't an error which anyone will hit on a regular basis. Instead, this will just be a thing you hit after you waited awhile and then you'll probably never do it again, so I don't think that it's too crucial that you see this error as soon as possible.

@ghost
Copy link

ghost commented Dec 27, 2013

The earliest possible option of informing the user is -Z help.

bors added a commit that referenced this pull request Dec 31, 2013
@bors bors closed this Dec 31, 2013
@alexcrichton alexcrichton deleted the issue-11154 branch January 1, 2014 21:28
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 14, 2023
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.

ICE when using lto and prefer-dynamic
4 participants