From 4edff3b6c83ec20da6c96e26cc0fbf669ebee93c Mon Sep 17 00:00:00 2001 From: zhuhongbo Date: Thu, 20 Mar 2025 14:15:47 +0800 Subject: [PATCH 1/2] rebuild for CVE-2020-11023 --- 0001-gcc-anolis-Rebrand-for-OpenAnolis.patch | 25 ------------------- gcc.spec | 26 +++++++++++--------- 2 files changed, 15 insertions(+), 36 deletions(-) delete mode 100644 0001-gcc-anolis-Rebrand-for-OpenAnolis.patch diff --git a/0001-gcc-anolis-Rebrand-for-OpenAnolis.patch b/0001-gcc-anolis-Rebrand-for-OpenAnolis.patch deleted file mode 100644 index c1436ee..0000000 --- a/0001-gcc-anolis-Rebrand-for-OpenAnolis.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 19b22393da77dfbe6b7c792955e41620db423b2f Mon Sep 17 00:00:00 2001 -From: xuehaolin -Date: Thu, 21 Jan 2021 21:09:15 +0800 -Subject: [PATCH] gcc anolis Rebrand for OpenAnolis - ---- - zlib/contrib/minizip/configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/zlib/contrib/minizip/configure.ac b/zlib/contrib/minizip/configure.ac -index 5b1197097..857ced9b5 100644 ---- a/zlib/contrib/minizip/configure.ac -+++ b/zlib/contrib/minizip/configure.ac -@@ -1,7 +1,7 @@ - # -*- Autoconf -*- - # Process this file with autoconf to produce a configure script. - --AC_INIT([minizip], [1.2.7], [bugzilla.redhat.com]) -+AC_INIT([minizip], [1.2.7], [https://bugs.openanolis.cn]) - AC_CONFIG_SRCDIR([minizip.c]) - AM_INIT_AUTOMAKE([foreign]) - LT_INIT --- -2.18.4 - diff --git a/gcc.spec b/gcc.spec index f842bfe..25e0b82 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1,12 +1,12 @@ -%define anolis_release .0.1 %global DATE 20150702 %global SVNREV 225304 # Note, gcc_release must be integer, if you want to add suffixes to # %{release}, append them after %{gcc_release} on Release: line. -%global gcc_release 44 +%global gcc_release 45 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 -%ifarch %{ix86} x86_64 ia64 ppc ppc64 ppc64le ppc64p7 alpha aarch64 %{arm} +%global multilib_64_archs sparc64 ppc64 ppc64p7 s390x x86_64 +%ifarch %{ix86} x86_64 ia64 ppc ppc64 ppc64le ppc64p7 alpha aarch64 %global build_ada 1 %else %global build_ada 0 @@ -79,7 +79,7 @@ Name: gcc %global gcc_version 4.8.5 %endif Version: 4.8.5 -Release: %{gcc_release}%{anolis_release}%{?dist} +Release: %{gcc_release}%{?dist} %if "%{version}" != "%{gcc_version}" %define gcc_provides %{gcc_version}-16%{?dist} %endif @@ -338,8 +338,6 @@ Patch1409: gcc48-rh1537828-7.patch Patch1410: gcc48-rh1537828-8.patch Patch1411: gcc48-rh1537828-9.patch -Patch10000: 0001-gcc-anolis-Rebrand-for-OpenAnolis.patch - # On ARM EABI systems, we do want -gnueabi to be part of the # target triple. %ifnarch %{arm} @@ -1203,7 +1201,7 @@ tar xjf %{SOURCE10} sed -i -e 's/4\.8\.5/4.8.5/' gcc/BASE-VER -echo 'Anolis %{version}-%{gcc_release}%{anolis_release}' > gcc/DEV-PHASE +echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE %if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 # Default to -gdwarf-4 -fno-debug-types-section rather than -gdwarf-2 @@ -1254,8 +1252,6 @@ fi # This test causes fork failures, because it spawns way too many threads rm -f gcc/testsuite/go.test/test/chan/goroutines.go -%patch10000 -p1 - %build # Undo the broken autoconf change in recent Fedora versions @@ -1397,7 +1393,7 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \ | sed 's/ -Werror=format-security / -Wformat -Werror=format-security /'`" \ XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" GCJFLAGS="$OPT_FLAGS" \ ../configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ - --with-bugurl=https://bugs.openanolis.cn --enable-bootstrap \ + --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap \ --enable-shared --enable-threads=posix --enable-checking=release \ --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \ --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu \ @@ -1469,7 +1465,6 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \ %endif %ifarch x86_64 --with-arch_32=x86-64 \ - --disable-multilib \ %endif %else %ifarch %{ix86} @@ -2295,6 +2290,10 @@ echo gcc-%{version}-%{release}.%{_arch} > $FULLPATH/rpmver %check cd obj-%{gcc_target_platform} +# The builds get stuck whilst running the testsuite. +# TODO: Investigate. +%ifnarch s390 s390x + %if %{build_java} export PATH=`pwd`/../fastjar-%{fastjar_ver}/obj-%{gcc_target_platform}${PATH:+:$PATH} %if !%{bootstrap_java} @@ -2320,6 +2319,8 @@ tar cf - testlogs-%{_target_platform}-%{version}-%{release} | bzip2 -9c \ | uuencode testlogs-%{_target_platform}.tar.bz2 || : rm -rf testlogs-%{_target_platform}-%{version}-%{release} +%endif + %clean rm -rf %{buildroot} @@ -3581,6 +3582,9 @@ fi %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_version}/plugin %changelog +* Mon Mar 17 2025 zhuhongbo 4.8.5-45 +- rebuild for CVE-2020-11023 + * Fri Oct 15 2021 Liwei Ge 4.8.5-44.0.1 - Rebrand for Anolis OS -- Gitee From 7ffc431371228e2485dacce698e01f65e7d80db7 Mon Sep 17 00:00:00 2001 From: zhuhongbo Date: Thu, 20 Mar 2025 14:42:40 +0800 Subject: [PATCH 2/2] Rebrand for Anolis OS --- 0001-gcc-anolis-Rebrand-for-OpenAnolis.patch | 25 ++++++++++++++++++++ gcc.spec | 24 ++++++++++--------- 2 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 0001-gcc-anolis-Rebrand-for-OpenAnolis.patch diff --git a/0001-gcc-anolis-Rebrand-for-OpenAnolis.patch b/0001-gcc-anolis-Rebrand-for-OpenAnolis.patch new file mode 100644 index 0000000..c1436ee --- /dev/null +++ b/0001-gcc-anolis-Rebrand-for-OpenAnolis.patch @@ -0,0 +1,25 @@ +From 19b22393da77dfbe6b7c792955e41620db423b2f Mon Sep 17 00:00:00 2001 +From: xuehaolin +Date: Thu, 21 Jan 2021 21:09:15 +0800 +Subject: [PATCH] gcc anolis Rebrand for OpenAnolis + +--- + zlib/contrib/minizip/configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/zlib/contrib/minizip/configure.ac b/zlib/contrib/minizip/configure.ac +index 5b1197097..857ced9b5 100644 +--- a/zlib/contrib/minizip/configure.ac ++++ b/zlib/contrib/minizip/configure.ac +@@ -1,7 +1,7 @@ + # -*- Autoconf -*- + # Process this file with autoconf to produce a configure script. + +-AC_INIT([minizip], [1.2.7], [bugzilla.redhat.com]) ++AC_INIT([minizip], [1.2.7], [https://bugs.openanolis.cn]) + AC_CONFIG_SRCDIR([minizip.c]) + AM_INIT_AUTOMAKE([foreign]) + LT_INIT +-- +2.18.4 + diff --git a/gcc.spec b/gcc.spec index 25e0b82..46adbf0 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 %global DATE 20150702 %global SVNREV 225304 # Note, gcc_release must be integer, if you want to add suffixes to @@ -5,8 +6,7 @@ %global gcc_release 45 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 -%global multilib_64_archs sparc64 ppc64 ppc64p7 s390x x86_64 -%ifarch %{ix86} x86_64 ia64 ppc ppc64 ppc64le ppc64p7 alpha aarch64 +%ifarch %{ix86} x86_64 ia64 ppc ppc64 ppc64le ppc64p7 alpha aarch64 %{arm} %global build_ada 1 %else %global build_ada 0 @@ -79,7 +79,7 @@ Name: gcc %global gcc_version 4.8.5 %endif Version: 4.8.5 -Release: %{gcc_release}%{?dist} +Release: %{gcc_release}%{anolis_release}%{?dist} %if "%{version}" != "%{gcc_version}" %define gcc_provides %{gcc_version}-16%{?dist} %endif @@ -338,6 +338,8 @@ Patch1409: gcc48-rh1537828-7.patch Patch1410: gcc48-rh1537828-8.patch Patch1411: gcc48-rh1537828-9.patch +Patch10000: 0001-gcc-anolis-Rebrand-for-OpenAnolis.patch + # On ARM EABI systems, we do want -gnueabi to be part of the # target triple. %ifnarch %{arm} @@ -1201,7 +1203,7 @@ tar xjf %{SOURCE10} sed -i -e 's/4\.8\.5/4.8.5/' gcc/BASE-VER -echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE +echo 'Anolis %{version}-%{gcc_release}%{anolis_release}' > gcc/DEV-PHASE %if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 # Default to -gdwarf-4 -fno-debug-types-section rather than -gdwarf-2 @@ -1252,6 +1254,8 @@ fi # This test causes fork failures, because it spawns way too many threads rm -f gcc/testsuite/go.test/test/chan/goroutines.go +%patch10000 -p1 + %build # Undo the broken autoconf change in recent Fedora versions @@ -1393,7 +1397,7 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \ | sed 's/ -Werror=format-security / -Wformat -Werror=format-security /'`" \ XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" GCJFLAGS="$OPT_FLAGS" \ ../configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ - --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap \ + --with-bugurl=https://bugs.openanolis.cn --enable-bootstrap \ --enable-shared --enable-threads=posix --enable-checking=release \ --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \ --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu \ @@ -1465,6 +1469,7 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \ %endif %ifarch x86_64 --with-arch_32=x86-64 \ + --disable-multilib \ %endif %else %ifarch %{ix86} @@ -2290,10 +2295,6 @@ echo gcc-%{version}-%{release}.%{_arch} > $FULLPATH/rpmver %check cd obj-%{gcc_target_platform} -# The builds get stuck whilst running the testsuite. -# TODO: Investigate. -%ifnarch s390 s390x - %if %{build_java} export PATH=`pwd`/../fastjar-%{fastjar_ver}/obj-%{gcc_target_platform}${PATH:+:$PATH} %if !%{bootstrap_java} @@ -2319,8 +2320,6 @@ tar cf - testlogs-%{_target_platform}-%{version}-%{release} | bzip2 -9c \ | uuencode testlogs-%{_target_platform}.tar.bz2 || : rm -rf testlogs-%{_target_platform}-%{version}-%{release} -%endif - %clean rm -rf %{buildroot} @@ -3582,6 +3581,9 @@ fi %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_version}/plugin %changelog +* Mon Mar 17 2025 zhuhongbo 4.8.5-45.0.1 +- Rebrand for Anolis OS + * Mon Mar 17 2025 zhuhongbo 4.8.5-45 - rebuild for CVE-2020-11023 -- Gitee