diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2024-05-13 10:39:04 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2024-05-13 18:13:38 +0200 |
commit | 89dc13243b7311669e5e4ad0ff8abbc0c7216dfd (patch) | |
tree | 3721220e7efbc62be985911fd0f74077b77c55c0 /etc/patches/gcc-14 | |
parent | a1512f1ad7a143493d0d38a0b715e06d8ba62759 (diff) | |
download | bootstrappable-toolchain-89dc13243b7311669e5e4ad0ff8abbc0c7216dfd.tar.gz |
Add gcc 14.1.0
Diffstat (limited to 'etc/patches/gcc-14')
6 files changed, 202 insertions, 0 deletions
diff --git a/etc/patches/gcc-14/reproducibility/0001-strip-build-directory-from-config-arguments.patch b/etc/patches/gcc-14/reproducibility/0001-strip-build-directory-from-config-arguments.patch new file mode 100644 index 0000000..6cd1d63 --- /dev/null +++ b/etc/patches/gcc-14/reproducibility/0001-strip-build-directory-from-config-arguments.patch @@ -0,0 +1,42 @@ +From 5ff2165c35eeae5df04df564663cadf6a889fb7c Mon Sep 17 00:00:00 2001 +From: Oliver Reiche <oliver.reiche@huawei.com> +Date: Mon, 14 Aug 2023 12:33:04 +0200 +Subject: [PATCH 1/5] Strip build directory from config arguments + +... to achieve a reproducible binary, which contains the +configure string. For this to work, the user needs to set +"BUILD_ROOT_DIR" before building. +--- + gcc/configure | 2 ++ + gcc/configure.ac | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/gcc/configure b/gcc/configure +index 23da7d55d..43561c617 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -13370,6 +13370,8 @@ fi + sed -e 's/\\/\\\\/g; s/"/\\"/g' <<EOF >conftest.out + $gcc_config_arguments + EOF ++# Remove host machine's build path from config arguments ++sed -i 's|'${BUILD_ROOT_DIR:-/nonexistent}'|/build|g' conftest.out + gcc_config_arguments_str=`cat conftest.out` + rm -f conftest.out + +diff --git a/gcc/configure.ac b/gcc/configure.ac +index d7cf0b92c..5be002278 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -2200,6 +2200,8 @@ fi + sed -e 's/\\/\\\\/g; s/"/\\"/g' <<EOF >conftest.out + $gcc_config_arguments + EOF ++# Remove host machine's build path from config arguments ++sed -i 's|'${BUILD_ROOT_DIR:-/nonexistent}'|/build|g' conftest.out + gcc_config_arguments_str=`cat conftest.out` + rm -f conftest.out + +-- +2.30.2 + diff --git a/etc/patches/gcc-14/reproducibility/0002-strip-build-directory-from-fixincludes.patch b/etc/patches/gcc-14/reproducibility/0002-strip-build-directory-from-fixincludes.patch new file mode 100644 index 0000000..8ce7a8a --- /dev/null +++ b/etc/patches/gcc-14/reproducibility/0002-strip-build-directory-from-fixincludes.patch @@ -0,0 +1,29 @@ +From 561f33bc220ba86947a7f99cc503d4dee13be089 Mon Sep 17 00:00:00 2001 +From: Oliver Reiche <oliver.reiche@huawei.com> +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 | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/fixincludes/configure b/fixincludes/configure +index 662c94dc1..c316bd6f9 100755 +--- a/fixincludes/configure ++++ b/fixincludes/configure +@@ -6397,6 +6397,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-14/reproducibility/0003-strip-build-directory-from-mkheaders.conf.patch b/etc/patches/gcc-14/reproducibility/0003-strip-build-directory-from-mkheaders.conf.patch new file mode 100644 index 0000000..f37fb43 --- /dev/null +++ b/etc/patches/gcc-14/reproducibility/0003-strip-build-directory-from-mkheaders.conf.patch @@ -0,0 +1,25 @@ +From fab4c6f6bf312f867ffec0cdf46f31b5e1fe48f9 Mon Sep 17 00:00:00 2001 +From: Oliver Reiche <oliver.reiche@huawei.com> +Date: Fri, 8 Sep 2023 16:16:29 +0200 +Subject: [PATCH 3/5] Strip build directory from mkheaders.conf + +--- + gcc/Makefile.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index a74761b7a..2e656c540 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -4182,6 +4182,8 @@ install-mkheaders: stmp-int-hdrs install-itoolsdirs \ + >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf + echo 'STMP_FIXINC="$(STMP_FIXINC)"' \ + >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf ++ sed -i 's|'$${BUILD_ROOT_DIR:-/nonexistent}'|/build|g' \ ++ $(DESTDIR)$(itoolsdatadir)/mkheaders.conf + + # Use this target to install the program `collect2' under the name `collect2'. + install-collect2: collect2 installdirs +-- +2.30.2 + diff --git a/etc/patches/gcc-14/reproducibility/0004-compute-reproducible-checksums.patch b/etc/patches/gcc-14/reproducibility/0004-compute-reproducible-checksums.patch new file mode 100644 index 0000000..ad18a34 --- /dev/null +++ b/etc/patches/gcc-14/reproducibility/0004-compute-reproducible-checksums.patch @@ -0,0 +1,75 @@ +From 3d2d2999d07cd7425e6a8a96047e72ebbc842ea0 Mon Sep 17 00:00:00 2001 +From: Oliver Reiche <oliver.reiche@huawei.com> +Date: Mon, 21 Aug 2023 18:03:56 +0200 +Subject: [PATCH 4/5] Compute reproducible checksums + +... for variable toolchain paths: +* remove linker path from gcc's checksum-options +* disable thin archives (for stripping libbackend.a) +* strip debug info before computing checksums +For removing the linker path, the user needs to set +"BUILD_ROOT_DIR" before building. +--- + gcc/Makefile.in | 3 ++- + gcc/c/Make-lang.in | 6 +++++- + gcc/cp/Make-lang.in | 6 +++++- + 3 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index 2e656c540..9da99cb5c 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -321,7 +321,7 @@ USE_THIN_ARCHIVES = no + ifeq ($(THIN_ARCHIVE_SUPPORT),yes) + ifeq ($(AR_FLAGS),rc) + ifeq ($(RANLIB_FLAGS),) +-USE_THIN_ARCHIVES = yes ++#USE_THIN_ARCHIVES = yes + endif + endif + endif +@@ -2273,6 +2273,7 @@ gcc-cross$(exeext): xgcc$(exeext) + + checksum-options: + echo "$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS)" > checksum-options.tmp \ ++ && sed -i 's|'$${BUILD_ROOT_DIR:-/nonexistent}'|/build|g' checksum-options.tmp \ + && $(srcdir)/../move-if-change checksum-options.tmp checksum-options + + # +diff --git a/gcc/c/Make-lang.in b/gcc/c/Make-lang.in +index 905ab9e79..583eb1cac 100644 +--- a/gcc/c/Make-lang.in ++++ b/gcc/c/Make-lang.in +@@ -77,7 +77,11 @@ cc1-checksum.cc : build/genchecksum$(build_exeext) checksum-options \ + && cmp -s ../stage_current ../stage_final; then \ + cp ../prev-gcc/cc1-checksum.cc cc1-checksum.cc; \ + else \ +- build/genchecksum$(build_exeext) $(C_OBJS) $(BACKEND) $(LIBDEPS) \ ++ rm -rf stripped_c_checksum_inputs; \ ++ mkdir stripped_c_checksum_inputs; \ ++ cp $(C_OBJS) $(BACKEND) $(LIBDEPS) 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; \ + fi +diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in +index f153891a1..52cc5d33c 100644 +--- a/gcc/cp/Make-lang.in ++++ b/gcc/cp/Make-lang.in +@@ -135,7 +135,11 @@ cc1plus-checksum.cc : build/genchecksum$(build_exeext) checksum-options \ + && cmp -s ../stage_current ../stage_final; then \ + cp ../prev-gcc/cc1plus-checksum.cc cc1plus-checksum.cc; \ + else \ +- build/genchecksum$(build_exeext) $(CXX_OBJS) $(BACKEND) $(CODYLIB) $(LIBDEPS) \ ++ rm -rf stripped_cp_checksum_inputs; \ ++ mkdir stripped_cp_checksum_inputs; \ ++ cp $(CXX_OBJS) $(BACKEND) $(CODYLIB) $(LIBDEPS) 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; \ + fi +-- +2.30.2 + diff --git a/etc/patches/gcc-14/reproducibility/0005-do-not-hardcode-rpath-into-cc1-libs.patch b/etc/patches/gcc-14/reproducibility/0005-do-not-hardcode-rpath-into-cc1-libs.patch new file mode 100644 index 0000000..0387da6 --- /dev/null +++ b/etc/patches/gcc-14/reproducibility/0005-do-not-hardcode-rpath-into-cc1-libs.patch @@ -0,0 +1,26 @@ +From 324a42a4cc1b9152ee73c285725038b9a610d7f1 Mon Sep 17 00:00:00 2001 +From: Oliver Reiche <oliver.reiche@huawei.com> +Date: Fri, 8 Sep 2023 14:59:34 +0200 +Subject: [PATCH 5/5] Do not hardcode rpath into cc1 libs + +... which is a temporary path anyway. +--- + libcc1/configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libcc1/configure b/libcc1/configure +index ea689a353..07ff4cde4 100755 +--- a/libcc1/configure ++++ b/libcc1/configure +@@ -17453,7 +17453,7 @@ finish_cmds=$lt_finish_cmds + finish_eval=$lt_finish_eval + + # Whether we should hardcode library paths into libraries. +-hardcode_into_libs=$hardcode_into_libs ++hardcode_into_libs=no #$hardcode_into_libs + + # Compile-time system search path for libraries. + sys_lib_search_path_spec=$lt_sys_lib_search_path_spec +-- +2.30.2 + diff --git a/etc/patches/gcc-14/reproducibility/series b/etc/patches/gcc-14/reproducibility/series new file mode 100644 index 0000000..e5411be --- /dev/null +++ b/etc/patches/gcc-14/reproducibility/series @@ -0,0 +1,5 @@ +0001-strip-build-directory-from-config-arguments.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 |