kpatch-build: Enable cross compiling with env TARGET_ARCH#1471
kpatch-build: Enable cross compiling with env TARGET_ARCH#1471joe-lawrence merged 1 commit intodynup:masterfrom
Conversation
|
I am creating this PR for comments. We probably want to wait until #1439 is landed. |
|
This is interesting and something I hoped we'd eventually implement :) Have you run cross-compiled kpatch modules against native-built kernels? |
I haven't tried this, but I think this should work. The compiler should create the same binary in native compile and cross compile. In practice, I assume we will use identical environment to build the kernel and the kpatch modules. |
|
With the aarch64 support landed, can we merge this PR and cut a new release? Thanks! |
|
Hi @liu-song-6 : we should probably document usage and any caveats for this. For example, is this clang/llvm only or what happens if used with gcc? Can it be used to kpatch native-built binaries as well? (I'm not sure if this belongs as a FAQ or short blurb on the README.md or developer's guide, etc?) |
|
1f2f485 to
bb7b6a9
Compare
llvm/clang supports cross compiling of the kernel. To build livepatch in the same cross compile environment, enable specifying TARGET_ARCH for kpatch-build. For example, in a x86_64 host, we can build livepatch for aarch64 kernel with: TARGET=aarch64 kpatch-build ... Signed-off-by: Song Liu <song@kernel.org> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com> [removed whitespace changes]
bb7b6a9 to
e88e2cc
Compare
|
Thanks @liu-song-6 , I dropped out some of the extraneous whitespace edits (probably an editor setting). I'll work out a release next week (need to run all the internal tests and then push out a tag). |
llvm/clang supports cross compiling of the kernel. To build livepatch in the same cross compile environment, enable specifying TARGET_ARCH for kpatch-build. For example, in a x86_64 host, we can build livepatch for aarch64 kernel with:
TARGET=aarch64 kpatch-build ...