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

LTO fallback without error #242

Closed
PhilipDeegan opened this issue Jan 4, 2022 · 2 comments
Closed

LTO fallback without error #242

PhilipDeegan opened this issue Jan 4, 2022 · 2 comments

Comments

@PhilipDeegan
Copy link

Hi,

I was wondering if there was any way to not fail if LTO is in use, but just fallback to what it would be without mold?

Thanks

@rui314
Copy link
Owner

rui314 commented Jan 4, 2022

That's an interesting question. I've never thought of that before, but we can indeed fall back to GNU ld or LLVM lld if LTO is in use. We can just invoke these linkers with the exact same command line arguments as mold received.

There are a few concerns, though:

  1. It may be "too automatic". If a user is using mold, it is their intentional choice. Automatic fallback may not desirable for them.
  2. It could change the link result in an edge case, as mold, GNU ld and LLVM lld all behave slightly differently in edge cases. That should be very rare, though.

But automatic fallback is an attractive idea... Let me think about that more.

@rui314 rui314 closed this as completed in a5029d1 Jan 4, 2022
@rui314
Copy link
Owner

rui314 commented Jan 4, 2022

OK, I decided to implement automatic fallback. We should support LTO natively in the future, but in the meantime, this should work as a poor-man's replacement.

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

No branches or pull requests

2 participants