diff options
author | 2019-08-31 23:31:12 +0530 | |
---|---|---|
committer | 2019-10-26 16:56:23 +0200 | |
commit | b285c8014349e8eeaa3a2faa043628840c588096 (patch) | |
tree | e845228c7c4c6b0e9629f61fb374a30ddee83836 /toolchain | |
parent | 76b4fcb5dc0eb9f19060a8d7ca9dde087138d62c (diff) | |
download | buildroot-b285c8014349e8eeaa3a2faa043628840c588096.tar.gz buildroot-b285c8014349e8eeaa3a2faa043628840c588096.tar.bz2 |
toolchain/toolchain-wrapper: explicitly pass --build-id=none if BR2_REPRODUCIBLE
Build ID is added to binaries at link time. Building in different
output directories causes some packages to have different Build IDs,
thus resulting in non-reproducibility.
Adding "-Wl,--build-id=none" fixes this issue by disabling setting of
Build ID.
Diffoscope output for Build ID issue:
https://gitlab.com/snippets/1886180/raw
After this patch, build is reproducible - i.e. diffoscope does not
produce any output.
Signed-off-by: Atharva Lele <itsatharva@gmail.com>
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'toolchain')
-rw-r--r-- | toolchain/toolchain-wrapper.mk | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk index 970bde76a0..88695a5b2d 100644 --- a/toolchain/toolchain-wrapper.mk +++ b/toolchain/toolchain-wrapper.mk @@ -21,6 +21,10 @@ TOOLCHAIN_WRAPPER_OPTS = \ $(call qstrip,$(BR2_SSP_OPTION)) \ $(call qstrip,$(BR2_TARGET_OPTIMIZATION)) +ifeq ($(BR2_REPRODUCIBLE),y) +TOOLCHAIN_WRAPPER_OPTS += -Wl,--build-id=none +endif + # We create a list like '"-mfoo", "-mbar", "-mbarfoo"' so that each flag is a # separate argument when used in execv() by the toolchain wrapper. TOOLCHAIN_WRAPPER_ARGS += \ |