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: Include objtool in kernel-devel #874

Merged
merged 1 commit into from
Mar 27, 2020
Merged

kernel: Include objtool in kernel-devel #874

merged 1 commit into from
Mar 27, 2020

Conversation

sam-aws
Copy link
Contributor

@sam-aws sam-aws commented Mar 26, 2020

Issue number:
#819

Description of changes:
objtool is a requirement for compiling external modules, particularly if
stack validation is enabled at build time.

Testing done:
Built an image and compiled a module against the installed kernel headers from within the SDK container:

# docker run -it --net host --mount type=bind,source=/home/ANT.AMAZON.COM/samjonas/workbench/thar/module/mod,target=/tmp/mod --mount type=bind,source=/home/ANT.AMAZON.COM/samjonas/workbench/thar/module/kernels,target=/usr/src/kernels --mount type=bind,source=/home/ANT.AMAZON.COM/samjonas/workbench/thar/module/modules,target=/lib/modules bottlerocket/sdk-x86_64:v0.10.0
[builder@u87e72aa3c6c25c /]$ cd /tmp/mod
[builder@u87e72aa3c6c25c mod]$ make -C /lib/modules/5.4.16/build/ M=`pwd` modules
make: Entering directory '/usr/src/kernels/5.4.16'
  CC [M]  /tmp/mod/KMOD_XXX.o
  AS [M]  /tmp/mod/KMOD_YYY.o
  LD [M]  /tmp/mod/KMOD_ZZZ.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /tmp/mod/KMOD_ZZZ.mod.o
  LD [M]  /tmp/mod/KMOD_ZZZ.ko
make: Leaving directory '/usr/src/kernels/5.4.16'
[builder@u87e72aa3c6c25c mod]$ echo $?
0

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.

Signed-off-by: Samuel Mendoza-Jonas [email protected]

@sam-aws sam-aws requested a review from bcressey March 26, 2020 20:44
@sam-aws
Copy link
Contributor Author

sam-aws commented Mar 26, 2020

@bcressey reminded me that objtool is probably compiled in the host arch, not the target arch - and indeed this breaks the build when cross compiling. Fix to come!

objtool is a requirement for compiling external modules, particularly if
stack validation is enabled at build time.

Signed-off-by: Samuel Mendoza-Jonas <[email protected]>
@sam-aws
Copy link
Contributor Author

sam-aws commented Mar 26, 2020

Updated to only include objtool for x86. After some poking around it seems objtool support is almost but not quite supported on arm64 (e.g. https://lore.kernel.org/linux-arm-kernel/[email protected]/)

@sam-aws sam-aws merged commit 5e78fc5 into develop Mar 27, 2020
@sam-aws sam-aws deleted the kerneler branch March 27, 2020 17:40
@sam-aws sam-aws linked an issue Mar 27, 2020 that may be closed by this pull request
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.

missing objtool from kernel-devel
3 participants