]> code.ossystems Code Review - openembedded-core.git/commit
linux-yocto: arch/x86/boot: use prefix map to avoid embedded paths
authorBruce Ashfield <bruce.ashfield@gmail.com>
Tue, 29 Oct 2019 09:47:19 +0000 (10:47 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 Oct 2019 13:47:04 +0000 (13:47 +0000)
commita45a6e12d6ce3a531ad924d3e548de8a95055866
tree76b03e9f1b0730c95a8396be605b4df5cbcbd060
parent61eed761a51fcb5ac293b76b4dc6edbd6dbbb32f
linux-yocto: arch/x86/boot: use prefix map to avoid embedded paths

>From the kernel patch:

[
    It was observed that the kernel embeds the path in the x86 boot
    artifacts.

    From https://bugzilla.yoctoproject.org/show_bug.cgi?id=13458:

    [
       If you turn on the buildpaths QA test, or try a reproducible build, you
       discover that the kernel image contains build paths.

       $ strings bzImage-5.0.19-yocto-standard |grep tmp/
       out of pgt_buf in
       /data/poky-tmp/reproducible/tmp/work-shared/qemux86-64/kernel-source/arch/x86/boot/compressed/kaslr_64.c!?

       But what's this in the top-level Makefile:

       $ git grep prefix-map
       Makefile:KBUILD_CFLAGS  += $(call
       cc-option,-fmacro-prefix-map=$(srctree)/=)

       So the __FILE__ shouldn't be using the full path.  However
       arch/x86/boot/compressed/Makefile has this:

       KBUILD_CFLAGS := -m$(BITS) -O2

       So that clears KBUILD_FLAGS, removing the -fmacro-prefix-map option.
    ]

    Other architectures do not clear the flags, but instead prune before
    adding boot or specific options. There's no obvious reason why x86 isn't
    doing the same thing (pruning vs clearing) and no build or boot issues
    have been observed.

    So we make x86 can do the same thing, and we no longer have embedded paths.
]

This issue has been reported upstream, and a patch submission is
pending, but for now, we'll soak the proposed patch in linux-yocto to
see if any issues are found

[YOCTO: #13458]

(From OE-Core rev: 78b0ff5960814af935a8089ec49c51d76f148149)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-kernel/linux/linux-yocto-rt_5.0.bb
meta/recipes-kernel/linux/linux-yocto-tiny_5.0.bb
meta/recipes-kernel/linux/linux-yocto_5.0.bb