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

kernel-6.1: exclude more object files from devel #172

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

bcressey
Copy link
Contributor

@bcressey bcressey commented Oct 1, 2024

Issue number:
Closes #171

Description of changes:
Now that an unpacked set of kernel-devel files is present in the buildroot, object files will be found by the /usr/lib/rpm/brp-strip invocation that tries to ensure all files are stripped.

This can lead to build failures if the host and target arch don't match, and if the target arch requires a host tool to be built. The object files will be built for the host, and the target's strip command will not recognize the format.

In any case, these object files shouldn't be included, as they may need to be rebuilt to match the running host architecture at the time the kernel-devel files are used.

Fixes: 76af8be ("kernel-6.1: also provide uncompressed devel files")

Testing done:
Collected files before and after:

rpm -qlp build/rpms/kernel-6.1/bottlerocket-kernel-6.1-devel-unpacked-6.1.109-1.*.rpm

Confirmed that .o and .a files were removed:

/aarch64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/arch/arm64/kernel/vdso/note.o
/aarch64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/arch/arm64/kernel/vdso/sigreturn.o
/aarch64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/arch/arm64/kernel/vdso/vgettimeofday.o
/aarch64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/arch/arm64/lib/built-in.a
/aarch64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/arch/arm64/lib/lib.a
/aarch64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/tools/objtool/libsubcmd.a

/x86_64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/arch/x86/lib/built-in.a
/x86_64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/arch/x86/lib/lib.a
/x86_64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/arch/x86/tools/relocs_32.o
/x86_64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/arch/x86/tools/relocs_64.o
/x86_64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/arch/x86/tools/relocs_common.o
/x86_64-bottlerocket-linux-gnu/sys-root/usr/share/bottlerocket/kernel-devel/6.1.109/tools/objtool/libsubcmd.a

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Now that an unpacked set of kernel-devel files is present in the
buildroot, object files will be found by the `/usr/lib/rpm/brp-strip`
invocation that tries to ensure all files are stripped.

This can lead to build failures if the host and target arch don't
match, and if the target arch requires a host tool to be built. The
object files will be built for the host, and the target's `strip`
command will not recognize the format.

In any case, these object files shouldn't be included, as they may
need to be rebuilt to match the running host architecture at the time
the kernel-devel files are used.

Fixes: 76af8be ("kernel-6.1: also provide uncompressed devel files")

Signed-off-by: Ben Cressey <[email protected]>
@bcressey bcressey merged commit 9b5ac22 into bottlerocket-os:develop Oct 2, 2024
2 checks passed
@bcressey bcressey deleted the trim-kernel-devel branch October 2, 2024 05:04
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.

Cross compilation for kernel 6.1 doesn't work on ARM
3 participants