aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2018-01-12 03:11:22 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-18 23:28:40 +0000
commitc7fc89c136311c69bc96edf110e988f1be691781 (patch)
tree0d9111de72313973466eceefe079d70622ead51a
parentd4c7091362569af08ea67d57925ffb91579ce3bd (diff)
downloadopenembedded-core-contrib-c7fc89c136311c69bc96edf110e988f1be691781.tar.gz
openembedded-core-contrib-c7fc89c136311c69bc96edf110e988f1be691781.tar.bz2
openembedded-core-contrib-c7fc89c136311c69bc96edf110e988f1be691781.zip
wget: improve reproducibility
Remove build host references from the internally generated file version.c. The references get compiled into executables, which leads to non-reproducible builds. The removed references (--sysroot, -fdebug-prefix-map) were only used as part of the `wget --version' which do not have side effect. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/recipes-extended/wget/wget.inc3
-rw-r--r--meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch61
-rw-r--r--meta/recipes-extended/wget/wget_1.19.2.bb1
3 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-extended/wget/wget.inc b/meta/recipes-extended/wget/wget.inc
index 1299edb720b..e374e6d8abe 100644
--- a/meta/recipes-extended/wget/wget.inc
+++ b/meta/recipes-extended/wget/wget.inc
@@ -10,6 +10,9 @@ inherit autotools gettext texinfo update-alternatives pkgconfig
EXTRA_OECONF = "--with-ssl=gnutls --disable-rpath --disable-iri \
--without-libgnutls-prefix ac_cv_header_uuid_uuid_h=no"
+EXTRA_OEMAKE += 'TOOLCHAIN_OPTIONS="${TOOLCHAIN_OPTIONS}" \
+ DEBUG_PREFIX_MAP="${DEBUG_PREFIX_MAP}"'
+
ALTERNATIVE_${PN} = "wget"
ALTERNATIVE_${PN}_class-nativesdk = ""
ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch b/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch
new file mode 100644
index 00000000000..8781df21c03
--- /dev/null
+++ b/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch
@@ -0,0 +1,61 @@
+From 7f1357529d23b356b45fbb0dd7388588162e4cb8 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 10 Jan 2018 14:43:20 +0800
+Subject: [PATCH] src/Makefile.am: improve reproducibility
+
+Remove build host references from the internally
+generated file version.c. The references get compiled into
+executables, which leads to non-reproducible builds.
+The removed references (--sysroot, -fdebug-prefix-map) were
+only used as part of the `wget --version' which do not have
+side effect.
+
+...
+$ wget --version
+GNU Wget 1.14 built on linux-gnu.
+
++digest +https +ipv6 +iri +large-file +nls +ntlm +opie +ssl/openssl
+
+Wgetrc:
+ /etc/wgetrc (system)
+Locale: /usr/share/locale
+Compile: gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc"
+ -DLOCALEDIR="/usr/share/locale" -I. -I../lib -I../lib -O2 -g -pipe
+ -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
+ --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic
+Link: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
+ -fstack-protector-strong --param=ssp-buffer-size=4
+ -grecord-gcc-switches -m64 -mtune=generic -lssl -lcrypto
+ /usr/lib64/libssl.so /usr/lib64/libcrypto.so /usr/lib64/libz.so
+ -ldl -lz -lz -lidn -luuid -lpcre ftp-opie.o openssl.o http-ntlm.o
+ ../lib/libgnu.a
+...
+
+Upstream-Status: Inappropriate [oe-core specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ src/Makefile.am | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 28c0be2..44084a3 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -87,9 +87,13 @@ version.c: $(wget_SOURCES) ../lib/libgnu.a
+ echo '#include "version.h"' >> $@
+ echo 'const char *version_string = "@VERSION@";' >> $@
+ echo 'const char *compilation_string = "'$(COMPILE)'";' \
++ | sed -e "s,$(TOOLCHAIN_OPTIONS),,g" \
++ -e "s,$(DEBUG_PREFIX_MAP),,g" \
+ | $(ESCAPEQUOTE) >> $@
+ echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \
++ | sed -e "s,$(TOOLCHAIN_OPTIONS),,g" \
++ -e "s,$(DEBUG_PREFIX_MAP),,g" \
+ | $(ESCAPEQUOTE) >> $@
+
+ css.c: $(srcdir)/css.l
+--
+1.8.3.1
+
diff --git a/meta/recipes-extended/wget/wget_1.19.2.bb b/meta/recipes-extended/wget/wget_1.19.2.bb
index bdafa70bfd3..c216ea8e641 100644
--- a/meta/recipes-extended/wget/wget_1.19.2.bb
+++ b/meta/recipes-extended/wget/wget_1.19.2.bb
@@ -1,5 +1,6 @@
SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \
file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://0002-improve-reproducibility.patch \
"
SRC_URI[md5sum] = "caabf9727fa429626316619a6369fffa"