From bf4ccd4265ac614fbfa38bf168b6eeaf4c17d51e Mon Sep 17 00:00:00 2001 From: Bernhard M. Wiedemann Date: Sat, 12 Jun 2021 21:55:43 +0200 Subject: [build] Ensure build ID is deterministic Commit 040cdd0 ("[linux] Add a prefix to all symbols to avoid future name collisions") unintentionally reintroduced an element of non-determinism into the build ID, by omitting the -D option when manipulating the blib.a archive. Fix by adding the -D option to restore determinism. Reworded-by: Michael Brown Signed-off-by: Michael Brown --- src/Makefile.housekeeping | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Makefile.housekeeping') diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index e017c656b..9be7e7e13 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -1167,7 +1167,7 @@ $(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS) $(Q)$(RM) $(BLIB) $(QM)$(ECHO) " [AR] $@" $(Q)$(AR) rD $@ $(sort $(BLIB_OBJS)) - $(Q)$(OBJCOPY) --prefix-symbols=$(SYMBOL_PREFIX) $@ + $(Q)$(OBJCOPY) -D --prefix-symbols=$(SYMBOL_PREFIX) $@ $(Q)$(RANLIB) -D $@ blib : $(BLIB) -- cgit v1.2.3-55-g7522 From 51c88a4a62116d77a854b55100c6955d6f1eb6dc Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 17 Jun 2021 14:32:23 +0100 Subject: [build] Fix building on broken versions of GNU binutils Some versions of GNU objcopy (observed with binutils 2.23.52.0.1 on CentOS 7.0.1406) document the -D/--enable-deterministic-archives option but fail to recognise the short form of the option. Work around this problem by using the long form of the option. Reported-by: Olaf Hering Signed-off-by: Michael Brown --- src/Makefile.housekeeping | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Makefile.housekeeping') diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 9be7e7e13..0deb15c10 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -1167,7 +1167,8 @@ $(BLIB) : $(BLIB_OBJS) $(BLIB_LIST) $(MAKEDEPS) $(Q)$(RM) $(BLIB) $(QM)$(ECHO) " [AR] $@" $(Q)$(AR) rD $@ $(sort $(BLIB_OBJS)) - $(Q)$(OBJCOPY) -D --prefix-symbols=$(SYMBOL_PREFIX) $@ + $(Q)$(OBJCOPY) --enable-deterministic-archives \ + --prefix-symbols=$(SYMBOL_PREFIX) $@ $(Q)$(RANLIB) -D $@ blib : $(BLIB) -- cgit v1.2.3-55-g7522