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

build.rs: Disable LTO if enabled implictly #2289

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

t-8ch
Copy link

@t-8ch t-8ch commented Jan 26, 2025

LTO between Rust and C is complicated. It requires clang and specific invocations configurations for both Rust and C compilations. If the CFLAGS from the environment enable LTO, for example from distribution build tools this can lead to errors.
Instead always disable LTO for the C compilation. There is not much to optimize away anyways.

Closes #1444

LTO between Rust and C is complicated. It requires clang and specific
invocations configurations for both Rust and C compilations.
If the CFLAGS from the environment enable LTO, for example from
distribution build tools this can lead to errors.
Instead always disable LTO for the C compilation. There is not much to
optimize away anyways.

Closes briansmith#1444
@briansmith
Copy link
Owner

How would the user enable LTO, with this patch?

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.

Cannot build on x86_64 (Arch Linux) when LTO is enabled
2 participants