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

.incbin, LTO, and incremental compilation #1618

Closed
nickdesaulniers opened this issue Mar 29, 2022 · 3 comments
Closed

.incbin, LTO, and incremental compilation #1618

nickdesaulniers opened this issue Mar 29, 2022 · 3 comments
Labels
[BUG] Untriaged Something isn't working [FEATURE] LTO Related to building the kernel with LLVM Link Time Optimization

Comments

@nickdesaulniers
Copy link
Member

I haven't had time to triage yet, but there was a reported issue with multiple configs where .incbin asm directives are causing incremental compilation surprises with LTO:

https://lore.kernel.org/lkml/164847778869.3060675.8115416881394543419.stgit@devnote2/
https://lore.kernel.org/all/20220321183500.GA4065@pswork/T/#u
https://lore.kernel.org/all/20220327115526.cc4b0ff55fc53c97683c3e4d@kernel.org/

Making note of this so we don't lose it.

@nickdesaulniers nickdesaulniers added [BUG] Untriaged Something isn't working [FEATURE] LTO Related to building the kernel with LLVM Link Time Optimization labels Mar 29, 2022
@mhiramat
Copy link

I confirmed this happens only if we choose CONFIG_LTO_CLANG_THIN.
Fortunately, the bootconfig could avoid this issue by separating the inline asm as an independent asm file.

https://lore.kernel.org/all/164870615889.127053.9055569952366814752.stgit@devnote2/T/#u

However, since the .incbin directive is used also for /proc/config.gz and /proc/kheaders.tar.xz, those also be affected by this issue. These can not separate the asm code because those can be a module. Thus I recommend to disable LTO for those files.

@nathanchance
Copy link
Member

I wonder if this upstream LLVM issue is relevant to this issue?

@nathanchance
Copy link
Member

This came up again in #2021. That issue has more information, so I am going to duplicate this one in favor of that one.

I've sent a patch removing use of the ThinLTO cache due to this, as the correctness is more important than the performance improvement that we get with caching: https://lore.kernel.org/20240501-kbuild-llvm-drop-thinlto-cache-v1-1-c117cc50a24b@kernel.org/

@nathanchance nathanchance closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[BUG] Untriaged Something isn't working [FEATURE] LTO Related to building the kernel with LLVM Link Time Optimization
Projects
None yet
Development

No branches or pull requests

3 participants