On 27.08.2021 21:33, Peter Swain wrote:
(apologies for re-post, having trouble enforcing no-HTML mode in gmail)
On Fri, Aug 27, 2021 at 9:08 AM Evgenii Shatokhin <eshatokhin@xxxxxxxxxxxxx>
wrote:
LLpatch requires a pre-built kernel tree ("repository"), right?
Yes.
It doesn't rebuild existing *.o as a pre-image of the patched code, as
kpatch does.
But LLpatch does use the dependency analysis the previous make left in
*.o.cmd, although the same information could also be extracted by "make -n
-W changed_file ..."
Does that mean that the kernel should be built with clang first?
Or, perhaps, clang is only used when building the patch itself, while
the kernel can be built with GCC or other compiler used by the given
Linux distro?
We haven't explored this deeply, as all our kernels are clang-built.
In principle this should work with gcc-built kernels, as long as the
particular change doesn't intersect with some feature which is expressed
differently between the gcc/clang worlds, such as some ELF section names.
But as there are so many such potential incompatibilities, we do not
recommend this.
I see. Yes, it is safer to use the same toolchain both for the kernel
and for the patch.
As a precondition for LLpatch-patchable kernels, I would recommend moving
to clang-built base kernels
This is not always an option ;-) For example, the kernels in our
(Virtuozzo) Linux distros are based on those from RHEL. We try to change
only what we really need to, otherwise we lose the benefits of a
well-tested code base. So, the compiler and even its version are
basically fixed for us.
Thanks, anyway.
.
Regards,
Evgenii