Re: [RFC PATCH] kbuild: Make --build-id linker flag configurable
From: Nathan Chancellor
Date: Mon Feb 02 2026 - 18:15:19 EST
On Mon, Feb 02, 2026 at 03:15:30PM +0100, Thomas Weißschuh wrote:
> On Mon, Feb 02, 2026 at 11:06:31AM +0000, Naman Jain wrote:
> > I am trying to implement reproducible builds for one of my product
> > kernel. I referred https://reproducible-builds.org/docs/build-path/
> > and tried to use both -fdebug-prefix-map=OLD=NEW and
> > -fmacro-prefix-map=OLD=NEW, but still could not achieve bit by bit
> > binary reproducibility without overwriting build-id to none.
> > If I move the kernel to same path in other setup, I was able to create
> > same binary hash, however, without it, there is some difference in
> > build-id hash values.
>
> Can you force the same build path during package building?
> That should avoid this issue.
Yeah, I think that it would be better to document this in
Documentation/kbuild/reproducible-builds.rst, as opposed to adding a
hack to disable the build ID altogether. It seems easy enough to make
the paths consistent between machines and environments by using a
container or such. The new scripts/container in -next could help there.
Cheers,
Nathan