diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2018-01-12 03:11:22 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-19 12:37:13 +0000 |
commit | 03352b1ce34536ca7fe98959fe2f59c5708e773a (patch) | |
tree | 98d8f11b27159139b8d504dec4fd3abb171bd5bb /meta/recipes-extended | |
parent | d94199ef3b2b91a7a3a33ae885bf76721c442e9f (diff) | |
download | poky-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>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r-- | meta/recipes-extended/wget/wget.inc | 3 | ||||
-rw-r--r-- | meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch | 61 | ||||
-rw-r--r-- | meta/recipes-extended/wget/wget_1.19.2.bb | 1 |
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 | |||
10 | EXTRA_OECONF = "--with-ssl=gnutls --disable-rpath --disable-iri \ | 10 | EXTRA_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 | ||
13 | EXTRA_OEMAKE += 'TOOLCHAIN_OPTIONS="${TOOLCHAIN_OPTIONS}" \ | ||
14 | DEBUG_PREFIX_MAP="${DEBUG_PREFIX_MAP}"' | ||
15 | |||
13 | ALTERNATIVE_${PN} = "wget" | 16 | ALTERNATIVE_${PN} = "wget" |
14 | ALTERNATIVE_${PN}_class-nativesdk = "" | 17 | ALTERNATIVE_${PN}_class-nativesdk = "" |
15 | ALTERNATIVE_PRIORITY = "100" | 18 | 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 0000000000..8781df21c0 --- /dev/null +++ b/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch | |||
@@ -0,0 +1,61 @@ | |||
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 | |||
6 | Remove build host references from the internally | ||
7 | generated file version.c. The references get compiled into | ||
8 | executables, which leads to non-reproducible builds. | ||
9 | The removed references (--sysroot, -fdebug-prefix-map) were | ||
10 | only used as part of the `wget --version' which do not have | ||
11 | side effect. | ||
12 | |||
13 | ... | ||
14 | $ wget --version | ||
15 | GNU Wget 1.14 built on linux-gnu. | ||
16 | |||
17 | +digest +https +ipv6 +iri +large-file +nls +ntlm +opie +ssl/openssl | ||
18 | |||
19 | Wgetrc: | ||
20 | /etc/wgetrc (system) | ||
21 | Locale: /usr/share/locale | ||
22 | Compile: 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 | ||
26 | Link: 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 | |||
34 | Upstream-Status: Inappropriate [oe-core specific] | ||
35 | |||
36 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
37 | --- | ||
38 | src/Makefile.am | 4 ++++ | ||
39 | 1 file changed, 4 insertions(+) | ||
40 | |||
41 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
42 | index 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 | -- | ||
60 | 1.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 @@ | |||
1 | SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \ | 1 | SRC_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 | ||
5 | SRC_URI[md5sum] = "caabf9727fa429626316619a6369fffa" | 6 | SRC_URI[md5sum] = "caabf9727fa429626316619a6369fffa" |