From fc1de24f9378ca1e9c6e0f12a6abe65d48314d65 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Fri, 15 Dec 2023 14:49:19 +0100 Subject: gcc: Fix GCC patches --- ...01-strip-build-directory-from-fixincludes.patch | 29 ++++++++++++++++++++++ ...001-strip-build-directory-from-fixinclues.patch | 29 ---------------------- .../0002-compute-reproducible-checksums.patch | 4 +-- etc/patches/gcc-10/reproducibility/series | 2 +- ...02-strip-build-directory-from-fixincludes.patch | 29 ++++++++++++++++++++++ ...002-strip-build-directory-from-fixinclues.patch | 29 ---------------------- .../0004-compute-reproducible-checksums.patch | 4 +-- etc/patches/gcc-13/reproducibility/series | 2 +- .../0002-compute-reproducible-checksums.patch | 4 +-- 9 files changed, 66 insertions(+), 66 deletions(-) create mode 100644 etc/patches/gcc-10/reproducibility/0001-strip-build-directory-from-fixincludes.patch delete mode 100644 etc/patches/gcc-10/reproducibility/0001-strip-build-directory-from-fixinclues.patch create mode 100644 etc/patches/gcc-13/reproducibility/0002-strip-build-directory-from-fixincludes.patch delete mode 100644 etc/patches/gcc-13/reproducibility/0002-strip-build-directory-from-fixinclues.patch diff --git a/etc/patches/gcc-10/reproducibility/0001-strip-build-directory-from-fixincludes.patch b/etc/patches/gcc-10/reproducibility/0001-strip-build-directory-from-fixincludes.patch new file mode 100644 index 0000000..96e8ec7 --- /dev/null +++ b/etc/patches/gcc-10/reproducibility/0001-strip-build-directory-from-fixincludes.patch @@ -0,0 +1,29 @@ +From a097d475fa8806265f445d11f3074f506baf4a3e Mon Sep 17 00:00:00 2001 +From: Oliver Reiche +Date: Fri, 18 Aug 2023 14:36:57 +0200 +Subject: [PATCH 1/2] Strip build directory from fixincludes + +... to achieve a reproducible binary, which contains the +configure string. For this to work, the user needs to set +"BUILD_ROOT_DIR" before building. +--- + fixincludes/configure | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/fixincludes/configure b/fixincludes/configure +index 6e2d67b65..b7d91c7ab 100755 +--- a/fixincludes/configure ++++ b/fixincludes/configure +@@ -6374,6 +6374,9 @@ cat >"$ac_tmp/defines.awk" <<\_ACAWK || + BEGIN { + _ACEOF + ++# Remove host machine's build path from confdefs.h ++sed -i 's|'${BUILD_ROOT_DIR:-/nonexistent}'|/build|g' confdefs.h ++ + # Transform confdefs.h into an awk script `defines.awk', embedded as + # here-document in config.status, that substitutes the proper values into + # config.h.in to produce config.h. +-- +2.30.2 + diff --git a/etc/patches/gcc-10/reproducibility/0001-strip-build-directory-from-fixinclues.patch b/etc/patches/gcc-10/reproducibility/0001-strip-build-directory-from-fixinclues.patch deleted file mode 100644 index d9a545f..0000000 --- a/etc/patches/gcc-10/reproducibility/0001-strip-build-directory-from-fixinclues.patch +++ /dev/null @@ -1,29 +0,0 @@ -From a097d475fa8806265f445d11f3074f506baf4a3e Mon Sep 17 00:00:00 2001 -From: Oliver Reiche -Date: Fri, 18 Aug 2023 14:36:57 +0200 -Subject: [PATCH 1/2] Strip build directory from fixinclues - -... to achieve a reproducible binary, which contains the -configure string. For this to work, the user needs to set -"BUILD_ROOT_DIR" before building. ---- - fixincludes/configure | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/fixincludes/configure b/fixincludes/configure -index 6e2d67b65..b7d91c7ab 100755 ---- a/fixincludes/configure -+++ b/fixincludes/configure -@@ -6374,6 +6374,9 @@ cat >"$ac_tmp/defines.awk" <<\_ACAWK || - BEGIN { - _ACEOF - -+# Remove host machine's build path from confdefs.h -+sed -i 's|'${BUILD_ROOT_DIR:-/nonexistent}'|/build|g' confdefs.h -+ - # Transform confdefs.h into an awk script `defines.awk', embedded as - # here-document in config.status, that substitutes the proper values into - # config.h.in to produce config.h. --- -2.30.2 - diff --git a/etc/patches/gcc-10/reproducibility/0002-compute-reproducible-checksums.patch b/etc/patches/gcc-10/reproducibility/0002-compute-reproducible-checksums.patch index 3aeb9fb..ee1987e 100644 --- a/etc/patches/gcc-10/reproducibility/0002-compute-reproducible-checksums.patch +++ b/etc/patches/gcc-10/reproducibility/0002-compute-reproducible-checksums.patch @@ -48,7 +48,7 @@ index 8944b9b9f..7ed444c5f 100644 + rm -rf stripped_c_checksum_inputs; \ + mkdir stripped_c_checksum_inputs; \ + cp $(C_OBJS) $(BACKEND) $(LIBDEPS) stripped_c_checksum_inputs/; \ -+ strip -g stripped_c_checksum_inputs/*; \ ++ $(STRIP_FOR_TARGET) -g stripped_c_checksum_inputs/*; \ + build/genchecksum$(build_exeext) $$(ls stripped_c_checksum_inputs/* | LC_ALL=C sort) \ checksum-options > cc1-checksum.c.tmp && \ $(srcdir)/../move-if-change cc1-checksum.c.tmp cc1-checksum.c; \ @@ -65,7 +65,7 @@ index 7896591dd..c65afcb85 100644 + rm -rf stripped_cp_checksum_inputs; \ + mkdir stripped_cp_checksum_inputs; \ + cp $(CXX_OBJS) $(BACKEND) $(CODYLIB) $(LIBDEPS) stripped_cp_checksum_inputs; \ -+ strip -g stripped_cp_checksum_inputs/*; \ ++ $(STRIP_FOR_TARGET) -g stripped_cp_checksum_inputs/*; \ + build/genchecksum$(build_exeext) $$(ls stripped_cp_checksum_inputs/* | LC_ALL=C sort) \ checksum-options > cc1plus-checksum.c.tmp && \ $(srcdir)/../move-if-change cc1plus-checksum.c.tmp cc1plus-checksum.c; \ diff --git a/etc/patches/gcc-10/reproducibility/series b/etc/patches/gcc-10/reproducibility/series index 1ec9fe3..23d38d7 100644 --- a/etc/patches/gcc-10/reproducibility/series +++ b/etc/patches/gcc-10/reproducibility/series @@ -1,2 +1,2 @@ -0001-strip-build-directory-from-fixinclues.patch +0001-strip-build-directory-from-fixincludes.patch 0002-compute-reproducible-checksums.patch diff --git a/etc/patches/gcc-13/reproducibility/0002-strip-build-directory-from-fixincludes.patch b/etc/patches/gcc-13/reproducibility/0002-strip-build-directory-from-fixincludes.patch new file mode 100644 index 0000000..984e529 --- /dev/null +++ b/etc/patches/gcc-13/reproducibility/0002-strip-build-directory-from-fixincludes.patch @@ -0,0 +1,29 @@ +From a6fc1b1f0a05fbd6ba664393695ad20d3577a517 Mon Sep 17 00:00:00 2001 +From: Oliver Reiche +Date: Fri, 18 Aug 2023 14:36:57 +0200 +Subject: [PATCH 2/5] Strip build directory from fixincludes + +... to achieve a reproducible binary, which contains the +configure string. For this to work, the user needs to set +"BUILD_ROOT_DIR" before building. +--- + fixincludes/configure | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/fixincludes/configure b/fixincludes/configure +index bdcc41f6d..9dc499bc1 100755 +--- a/fixincludes/configure ++++ b/fixincludes/configure +@@ -6384,6 +6384,9 @@ cat >"$ac_tmp/defines.awk" <<\_ACAWK || + BEGIN { + _ACEOF + ++# Remove host machine's build path from confdefs.h ++sed -i 's|'${BUILD_ROOT_DIR:-/nonexistent}'|/build|g' confdefs.h ++ + # Transform confdefs.h into an awk script `defines.awk', embedded as + # here-document in config.status, that substitutes the proper values into + # config.h.in to produce config.h. +-- +2.30.2 + diff --git a/etc/patches/gcc-13/reproducibility/0002-strip-build-directory-from-fixinclues.patch b/etc/patches/gcc-13/reproducibility/0002-strip-build-directory-from-fixinclues.patch deleted file mode 100644 index fd1ea04..0000000 --- a/etc/patches/gcc-13/reproducibility/0002-strip-build-directory-from-fixinclues.patch +++ /dev/null @@ -1,29 +0,0 @@ -From a6fc1b1f0a05fbd6ba664393695ad20d3577a517 Mon Sep 17 00:00:00 2001 -From: Oliver Reiche -Date: Fri, 18 Aug 2023 14:36:57 +0200 -Subject: [PATCH 2/5] Strip build directory from fixinclues - -... to achieve a reproducible binary, which contains the -configure string. For this to work, the user needs to set -"BUILD_ROOT_DIR" before building. ---- - fixincludes/configure | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/fixincludes/configure b/fixincludes/configure -index bdcc41f6d..9dc499bc1 100755 ---- a/fixincludes/configure -+++ b/fixincludes/configure -@@ -6384,6 +6384,9 @@ cat >"$ac_tmp/defines.awk" <<\_ACAWK || - BEGIN { - _ACEOF - -+# Remove host machine's build path from confdefs.h -+sed -i 's|'${BUILD_ROOT_DIR:-/nonexistent}'|/build|g' confdefs.h -+ - # Transform confdefs.h into an awk script `defines.awk', embedded as - # here-document in config.status, that substitutes the proper values into - # config.h.in to produce config.h. --- -2.30.2 - diff --git a/etc/patches/gcc-13/reproducibility/0004-compute-reproducible-checksums.patch b/etc/patches/gcc-13/reproducibility/0004-compute-reproducible-checksums.patch index 8eaeaac..ef358d5 100644 --- a/etc/patches/gcc-13/reproducibility/0004-compute-reproducible-checksums.patch +++ b/etc/patches/gcc-13/reproducibility/0004-compute-reproducible-checksums.patch @@ -48,7 +48,7 @@ index b3b12dcff..1733b40a7 100644 + rm -rf stripped_c_checksum_inputs; \ + mkdir stripped_c_checksum_inputs; \ + cp $(C_OBJS) $(BACKEND) $(LIBDEPS) stripped_c_checksum_inputs/; \ -+ strip -g stripped_c_checksum_inputs/*; \ ++ $(STRIP_FOR_TARGET) -g stripped_c_checksum_inputs/*; \ + build/genchecksum$(build_exeext) $$(ls stripped_c_checksum_inputs/* | LC_ALL=C sort) \ checksum-options > cc1-checksum.cc.tmp && \ $(srcdir)/../move-if-change cc1-checksum.cc.tmp cc1-checksum.cc; \ @@ -65,7 +65,7 @@ index 4ee26fad9..30fe695ec 100644 + rm -rf stripped_cp_checksum_inputs; \ + mkdir stripped_cp_checksum_inputs; \ + cp $(CXX_OBJS) $(BACKEND) $(CODYLIB) $(LIBDEPS) stripped_cp_checksum_inputs; \ -+ strip -g stripped_cp_checksum_inputs/*; \ ++ $(STRIP_FOR_TARGET) -g stripped_cp_checksum_inputs/*; \ + build/genchecksum$(build_exeext) $$(ls stripped_cp_checksum_inputs/* | LC_ALL=C sort) \ checksum-options > cc1plus-checksum.cc.tmp && \ $(srcdir)/../move-if-change cc1plus-checksum.cc.tmp cc1plus-checksum.cc; \ diff --git a/etc/patches/gcc-13/reproducibility/series b/etc/patches/gcc-13/reproducibility/series index 996d939..e5411be 100644 --- a/etc/patches/gcc-13/reproducibility/series +++ b/etc/patches/gcc-13/reproducibility/series @@ -1,5 +1,5 @@ 0001-strip-build-directory-from-config-arguments.patch -0002-strip-build-directory-from-fixinclues.patch +0002-strip-build-directory-from-fixincludes.patch 0003-strip-build-directory-from-mkheaders.conf.patch 0004-compute-reproducible-checksums.patch 0005-do-not-hardcode-rpath-into-cc1-libs.patch diff --git a/etc/patches/gcc-4.7.4/reproducibility/0002-compute-reproducible-checksums.patch b/etc/patches/gcc-4.7.4/reproducibility/0002-compute-reproducible-checksums.patch index 7db6c92..c4f3e2b 100644 --- a/etc/patches/gcc-4.7.4/reproducibility/0002-compute-reproducible-checksums.patch +++ b/etc/patches/gcc-4.7.4/reproducibility/0002-compute-reproducible-checksums.patch @@ -31,7 +31,7 @@ index f3cc49fdb..7fb30a13f 100644 + rm -rf stripped_c_checksum_inputs; \ + mkdir stripped_c_checksum_inputs; \ + cp $(C_OBJS) $(BACKEND) $(LIBDEPS) stripped_c_checksum_inputs/; \ -+ strip -g stripped_c_checksum_inputs/*; \ ++ $(STRIP_FOR_TARGET) -g stripped_c_checksum_inputs/*; \ + build/genchecksum$(build_exeext) $$(ls stripped_c_checksum_inputs/* | LC_ALL=C sort) \ checksum-options > cc1-checksum.c.tmp && \ $(srcdir)/../move-if-change cc1-checksum.c.tmp cc1-checksum.c @@ -48,7 +48,7 @@ index 0ce01ac49..0fc43d305 100644 + rm -rf stripped_cp_checksum_inputs; \ + mkdir stripped_cp_checksum_inputs; \ + cp $(CXX_OBJS) $(BACKEND) $(CODYLIB) $(LIBDEPS) stripped_cp_checksum_inputs; \ -+ strip -g stripped_cp_checksum_inputs/*; \ ++ $(STRIP_FOR_TARGET) -g stripped_cp_checksum_inputs/*; \ + build/genchecksum$(build_exeext) $$(ls stripped_cp_checksum_inputs/* | LC_ALL=C sort) \ checksum-options > cc1plus-checksum.c.tmp && \ $(srcdir)/../move-if-change cc1plus-checksum.c.tmp cc1plus-checksum.c -- cgit v1.2.3