diff options
author | 2019-08-08 23:39:26 -0400 | |
---|---|---|
committer | 2019-08-08 23:39:26 -0400 | |
commit | 55dd15336b7301b686a0c183f5372b49c1003d03 (patch) | |
tree | 6e51ea06196dda5a62641c7b2e1457164350ad20 | |
parent | 00638cdd8f92869a0f89ebe3289fdbd856ba9458 (diff) | |
download | linux-yocto-v5.0/standard/tiny/intel-x86.tar.gz linux-yocto-v5.0/standard/tiny/intel-x86.tar.bz2 linux-yocto-v5.0/standard/tiny/intel-x86.zip |
arch/x86/boot: use prefix map to avoid embedded pathsv5.0/standard/xilinx-zynqmpv5.0/standard/tiny/intel-x86v5.0/standard/tiny/common-pcv5.0/standard/tiny/basev5.0/standard/qemuppcv5.0/standard/qemuarm64v5.0/standard/intel-x86v5.0/standard/edgerouterv5.0/standard/beaglebonev5.0/standard/base
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.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r-- | arch/x86/boot/compressed/Makefile | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index f0515ac895a4..364d1c64c26e 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -38,6 +38,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) KBUILD_CFLAGS += $(call cc-disable-warning, gnu) KBUILD_CFLAGS += -Wno-pointer-sign +KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n |