public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] kbuild, bpf: reproducible BTF from pahole when KBUILD_BUILD_TIMESTAMP set
@ 2024-07-01 17:31 Alan Maguire
  2024-07-01 23:07 ` Jiri Olsa
  2024-07-02  7:58 ` Masahiro Yamada
  0 siblings, 2 replies; 7+ messages in thread
From: Alan Maguire @ 2024-07-01 17:31 UTC (permalink / raw)
  To: ast, andrii
  Cc: masahiroy, daniel, nathan, nicolas, martin.lau, eddyz87, song,
	yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa, bpf,
	linux-kbuild, asmadeus, Alan Maguire

Reproducible builds [1] require that the same source code with
the same set of tools can build identical objects each time,
but pahole in parallel mode was non-deterministic in
BTF generation prior to

dba7b5e ("pahole: Encode BTF serially in a reproducible build")

This was a problem since said BTF is baked into kernels and modules in
.BTF sections, so parallel pahole was causing non-reproducible binary
generation.  Now with the above commit we have support for parallel
reproducible BTF generation in pahole.

KBUILD_BUILD_TIMESTAMP is set for reproducible builds, so if it
is set, add reproducible_build to --btf_features.

[1] Documentation/kbuild/reproducible-builds.rst

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
---
 scripts/Makefile.btf | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/Makefile.btf b/scripts/Makefile.btf
index b75f09f3f424..40bb72662967 100644
--- a/scripts/Makefile.btf
+++ b/scripts/Makefile.btf
@@ -21,6 +21,10 @@ else
 # Switch to using --btf_features for v1.26 and later.
 pahole-flags-$(call test-ge, $(pahole-ver), 126)  = -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs
 
+ifneq ($(KBUILD_BUILD_TIMESTAMP),)
+pahole-flags-$(call test-ge, $(pahole-ver), 126) += --btf_features=reproducible_build
+endif
+
 ifneq ($(KBUILD_EXTMOD),)
 module-pahole-flags-$(call test-ge, $(pahole-ver), 126) += --btf_features=distilled_base
 endif
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-07-20 12:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 17:31 [PATCH bpf-next] kbuild, bpf: reproducible BTF from pahole when KBUILD_BUILD_TIMESTAMP set Alan Maguire
2024-07-01 23:07 ` Jiri Olsa
2024-07-02  7:58 ` Masahiro Yamada
2024-07-02  8:20   ` asmadeus
2024-07-02  9:49   ` Alan Maguire
2024-07-15 11:19     ` Masahiro Yamada
2024-07-20 12:12       ` asmadeus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox