summaryrefslogtreecommitdiffstats
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-19 12:37:13 +0000
commit03352b1ce34536ca7fe98959fe2f59c5708e773a (patch)
tree98d8f11b27159139b8d504dec4fd3abb171bd5bb
parentd94199ef3b2b91a7a3a33ae885bf76721c442e9f (diff)
downloadpoky-03352b1ce34536ca7fe98959fe2f59c5708e773a.tar.gz
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. (From OE-Core rev: c7fc89c136311c69bc96edf110e988f1be691781) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 1299edb720..e374e6d8ab 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
10EXTRA_OECONF = "--with-ssl=gnutls --disable-rpath --disable-iri \ 10EXTRA_OECONF = "--with-ssl=gnutls --disable-rpath --disable-iri \
11 --without-libgnutls-prefix ac_cv_header_uuid_uuid_h=no" 11 --without-libgnutls-prefix ac_cv_header_uuid_uuid_h=no"
12 12
13EXTRA_OEMAKE += 'TOOLCHAIN_OPTIONS="${TOOLCHAIN_OPTIONS}" \
14 DEBUG_PREFIX_MAP="${DEBUG_PREFIX_MAP}"'
15
13ALTERNATIVE_${PN} = "wget" 16ALTERNATIVE_${PN} = "wget"
14ALTERNATIVE_${PN}_class-nativesdk = "" 17ALTERNATIVE_${PN}_class-nativesdk = ""
15ALTERNATIVE_PRIORITY = "100" 18ALTERNATIVE_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 0000000000..8781df21c0
--- /dev/null
+++ b/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch
@@ -0,0 +1,61 @@
1From 7f1357529d23b356b45fbb0dd7388588162e4cb8 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 10 Jan 2018 14:43:20 +0800
4Subject: [PATCH] src/Makefile.am: improve reproducibility
5
6Remove build host references from the internally
7generated file version.c. The references get compiled into
8executables, which leads to non-reproducible builds.
9The removed references (--sysroot, -fdebug-prefix-map) were
10only used as part of the `wget --version' which do not have
11side effect.
12
13...
14$ wget --version
15GNU Wget 1.14 built on linux-gnu.
16
17+digest +https +ipv6 +iri +large-file +nls +ntlm +opie +ssl/openssl
18
19Wgetrc:
20 /etc/wgetrc (system)
21Locale: /usr/share/locale
22Compile: gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc"
23 -DLOCALEDIR="/usr/share/locale" -I. -I../lib -I../lib -O2 -g -pipe
24 -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
25 --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic
26Link: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
27 -fstack-protector-strong --param=ssp-buffer-size=4
28 -grecord-gcc-switches -m64 -mtune=generic -lssl -lcrypto
29 /usr/lib64/libssl.so /usr/lib64/libcrypto.so /usr/lib64/libz.so
30 -ldl -lz -lz -lidn -luuid -lpcre ftp-opie.o openssl.o http-ntlm.o
31 ../lib/libgnu.a
32...
33
34Upstream-Status: Inappropriate [oe-core specific]
35
36Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
37---
38 src/Makefile.am | 4 ++++
39 1 file changed, 4 insertions(+)
40
41diff --git a/src/Makefile.am b/src/Makefile.am
42index 28c0be2..44084a3 100644
43--- a/src/Makefile.am
44+++ b/src/Makefile.am
45@@ -87,9 +87,13 @@ version.c: $(wget_SOURCES) ../lib/libgnu.a
46 echo '#include "version.h"' >> $@
47 echo 'const char *version_string = "@VERSION@";' >> $@
48 echo 'const char *compilation_string = "'$(COMPILE)'";' \
49+ | sed -e "s,$(TOOLCHAIN_OPTIONS),,g" \
50+ -e "s,$(DEBUG_PREFIX_MAP),,g" \
51 | $(ESCAPEQUOTE) >> $@
52 echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \
53 $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \
54+ | sed -e "s,$(TOOLCHAIN_OPTIONS),,g" \
55+ -e "s,$(DEBUG_PREFIX_MAP),,g" \
56 | $(ESCAPEQUOTE) >> $@
57
58 css.c: $(srcdir)/css.l
59--
601.8.3.1
61
diff --git a/meta/recipes-extended/wget/wget_1.19.2.bb b/meta/recipes-extended/wget/wget_1.19.2.bb
index bdafa70bfd..c216ea8e64 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 @@
1SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \ 1SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \
2 file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ 2 file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
3 file://0002-improve-reproducibility.patch \
3 " 4 "
4 5
5SRC_URI[md5sum] = "caabf9727fa429626316619a6369fffa" 6SRC_URI[md5sum] = "caabf9727fa429626316619a6369fffa"