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

Fix builds with CONFIG_ERROR #1393

Merged
merged 2 commits into from
May 15, 2024
Merged

Conversation

joe-lawrence
Copy link
Contributor

When CONFIG_WERROR is set, CONFIG_LD_ORPHAN_WARN_LEVEL of "error" will fail for kernels built with KCFLAGS="-ffunction-sections" due to all the "unplaced orphan section .text. <object-file.o>" errors. This MR temporarily demotes ld --orphan-handling to a mere warning so that kpatch-build may complete.

Upstream kernel v6.1+ commit linux@e1789d7c752e ("kbuild: upgrade the
orphan section warning to an error if CONFIG_WERROR is set") and
CONFIG_WERROR will result in failed kernel builds due to the linker
reporting tons of "unplaced orphan section `.text.<function>`
<object-file.o>" errors.

Workaround this by temporarily demoting such errors in the top-level
kernel Makefile.

Reported-and-tested-by: Zhijun Wang <zhijwang@redhat.com>
Closes: dynup#1391 ("CONFIG_WERROR=y and CONFIG_LD_ORPHAN_WARN_LEVEL="error" break kpatch-build")
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Temporarily editing kernel tree sources has become a recurring
requirement in kpatch-build.  Pull the saving/restoring of these files
into a common function helpers to standardize the pattern.

Reported-and-tested-by: Zhijun Wang <zhijwang@redhat.com>
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
@joe-lawrence joe-lawrence merged commit bb93ac9 into dynup:master May 15, 2024
3 checks passed
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.

1 participant