0002-improve-reproducibility.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. From 7f1357529d23b356b45fbb0dd7388588162e4cb8 Mon Sep 17 00:00:00 2001
  2. From: Hongxu Jia <hongxu.jia@windriver.com>
  3. Date: Wed, 10 Jan 2018 14:43:20 +0800
  4. Subject: [PATCH] src/Makefile.am: improve reproducibility
  5. Remove build host references from the internally
  6. generated file version.c. The references get compiled into
  7. executables, which leads to non-reproducible builds.
  8. The removed references (--sysroot, -fdebug-prefix-map) were
  9. only used as part of the `wget --version' which do not have
  10. side effect.
  11. ...
  12. $ wget --version
  13. GNU Wget 1.14 built on linux-gnu.
  14. +digest +https +ipv6 +iri +large-file +nls +ntlm +opie +ssl/openssl
  15. Wgetrc:
  16. /etc/wgetrc (system)
  17. Locale: /usr/share/locale
  18. Compile: gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc"
  19. -DLOCALEDIR="/usr/share/locale" -I. -I../lib -I../lib -O2 -g -pipe
  20. -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
  21. --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic
  22. Link: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
  23. -fstack-protector-strong --param=ssp-buffer-size=4
  24. -grecord-gcc-switches -m64 -mtune=generic -lssl -lcrypto
  25. /usr/lib64/libssl.so /usr/lib64/libcrypto.so /usr/lib64/libz.so
  26. -ldl -lz -lz -lidn -luuid -lpcre ftp-opie.o openssl.o http-ntlm.o
  27. ../lib/libgnu.a
  28. ...
  29. Upstream-Status: Inappropriate [oe-core specific]
  30. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
  31. sed use of DEBUG_PREFIX_MAP must treat whitespace the same as the
  32. echo command building version.c or the expression match will fail.
  33. Signed-off-by: Joe Slater <jslater@windriver.com>
  34. ---
  35. src/Makefile.am | 4 ++++
  36. 1 file changed, 4 insertions(+)
  37. diff --git a/src/Makefile.am b/src/Makefile.am
  38. index 28c0be2..44084a3 100644
  39. --- a/src/Makefile.am
  40. +++ b/src/Makefile.am
  41. @@ -87,9 +87,13 @@ version.c: $(wget_SOURCES) ../lib/libgnu.a
  42. echo '#include "version.h"' >> $@
  43. echo 'const char *version_string = "@VERSION@";' >> $@
  44. echo 'const char *compilation_string = "'$(COMPILE)'";' \
  45. + | sed -e "s,$(TOOLCHAIN_OPTIONS),,g" \
  46. + -e "s,$$(echo $(DEBUG_PREFIX_MAP)),,g" \
  47. | $(ESCAPEQUOTE) >> $@
  48. echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \
  49. $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \
  50. + | sed -e "s,$(TOOLCHAIN_OPTIONS),,g" \
  51. + -e "s,$$(echo $(DEBUG_PREFIX_MAP)),,g" \
  52. | $(ESCAPEQUOTE) >> $@
  53. css.c: $(srcdir)/css.l
  54. --
  55. 1.8.3.1