From 8705d0f16a7d844b1c6b14f171bde7d37bacce9b3447cdd0319cf646bc7ba01a Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 3 Aug 2023 13:34:13 +0000 Subject: [PATCH 1/2] Accepting request 1102050 from home:Andreas_Schwab:Factory - gdcflags.patch: Use substituted GDCFLAGS - Filter out -Werror=return-type from D compile flags OBS-URL: https://build.opensuse.org/request/show/1102050 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gcc13?expand=0&rev=57 --- cross-aarch64-gcc13-bootstrap.spec | 53 ++++++++++++++++-------- cross-aarch64-gcc13.spec | 53 ++++++++++++++++-------- cross-amdgcn-gcc13.spec | 53 ++++++++++++++++-------- cross-arm-gcc13.spec | 53 ++++++++++++++++-------- cross-arm-none-gcc13-bootstrap.spec | 53 ++++++++++++++++-------- cross-arm-none-gcc13.spec | 53 ++++++++++++++++-------- cross-avr-gcc13-bootstrap.spec | 53 ++++++++++++++++-------- cross-avr-gcc13.spec | 53 ++++++++++++++++-------- cross-bpf-gcc13.spec | 53 ++++++++++++++++-------- cross-epiphany-gcc13-bootstrap.spec | 53 ++++++++++++++++-------- cross-epiphany-gcc13.spec | 53 ++++++++++++++++-------- cross-hppa-gcc13-bootstrap.spec | 53 ++++++++++++++++-------- cross-hppa-gcc13.spec | 53 ++++++++++++++++-------- cross-m68k-gcc13.spec | 53 ++++++++++++++++-------- cross-mips-gcc13.spec | 53 ++++++++++++++++-------- cross-nvptx-gcc13.spec | 53 ++++++++++++++++-------- cross-ppc64-gcc13.spec | 53 ++++++++++++++++-------- cross-ppc64le-gcc13.spec | 53 ++++++++++++++++-------- cross-pru-gcc13-bootstrap.spec | 53 ++++++++++++++++-------- cross-pru-gcc13.spec | 53 ++++++++++++++++-------- cross-riscv64-elf-gcc13-bootstrap.spec | 53 ++++++++++++++++-------- cross-riscv64-elf-gcc13.spec | 53 ++++++++++++++++-------- cross-riscv64-gcc13-bootstrap.spec | 53 ++++++++++++++++-------- cross-riscv64-gcc13.spec | 53 ++++++++++++++++-------- cross-rx-gcc13-bootstrap.spec | 53 ++++++++++++++++-------- cross-rx-gcc13.spec | 53 ++++++++++++++++-------- cross-s390x-gcc13.spec | 53 ++++++++++++++++-------- cross-sparc-gcc13.spec | 53 ++++++++++++++++-------- cross-sparc64-gcc13.spec | 53 ++++++++++++++++-------- cross-x86_64-gcc13.spec | 53 ++++++++++++++++-------- gcc.spec.in | 53 ++++++++++++++++-------- gcc13-testresults.spec | 53 ++++++++++++++++-------- gcc13.changes | 6 +++ gcc13.spec | 53 ++++++++++++++++-------- gdcflags.patch | 57 ++++++++++++++++++++++++++ 35 files changed, 1284 insertions(+), 528 deletions(-) create mode 100644 gdcflags.patch diff --git a/cross-aarch64-gcc13-bootstrap.spec b/cross-aarch64-gcc13-bootstrap.spec index 2a03f52..44ffda4 100644 --- a/cross-aarch64-gcc13-bootstrap.spec +++ b/cross-aarch64-gcc13-bootstrap.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-aarch64-gcc13.spec b/cross-aarch64-gcc13.spec index 8a0f08b..fff11f7 100644 --- a/cross-aarch64-gcc13.spec +++ b/cross-aarch64-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-amdgcn-gcc13.spec b/cross-amdgcn-gcc13.spec index c97a406..74ba1fc 100644 --- a/cross-amdgcn-gcc13.spec +++ b/cross-amdgcn-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-arm-gcc13.spec b/cross-arm-gcc13.spec index 1a47d70..c645571 100644 --- a/cross-arm-gcc13.spec +++ b/cross-arm-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-arm-none-gcc13-bootstrap.spec b/cross-arm-none-gcc13-bootstrap.spec index 045ee0b..2277a57 100644 --- a/cross-arm-none-gcc13-bootstrap.spec +++ b/cross-arm-none-gcc13-bootstrap.spec @@ -134,6 +134,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -338,6 +339,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -360,26 +362,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -461,9 +479,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-arm-none-gcc13.spec b/cross-arm-none-gcc13.spec index f13deaf..433f880 100644 --- a/cross-arm-none-gcc13.spec +++ b/cross-arm-none-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-avr-gcc13-bootstrap.spec b/cross-avr-gcc13-bootstrap.spec index 7828783..7622575 100644 --- a/cross-avr-gcc13-bootstrap.spec +++ b/cross-avr-gcc13-bootstrap.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-avr-gcc13.spec b/cross-avr-gcc13.spec index 151e9ac..708ef74 100644 --- a/cross-avr-gcc13.spec +++ b/cross-avr-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-bpf-gcc13.spec b/cross-bpf-gcc13.spec index a1bcbd6..abc860d 100644 --- a/cross-bpf-gcc13.spec +++ b/cross-bpf-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-epiphany-gcc13-bootstrap.spec b/cross-epiphany-gcc13-bootstrap.spec index 68e5614..b2a1d3d 100644 --- a/cross-epiphany-gcc13-bootstrap.spec +++ b/cross-epiphany-gcc13-bootstrap.spec @@ -134,6 +134,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -338,6 +339,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -360,26 +362,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -461,9 +479,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-epiphany-gcc13.spec b/cross-epiphany-gcc13.spec index 70dfaa9..d066ca8 100644 --- a/cross-epiphany-gcc13.spec +++ b/cross-epiphany-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-hppa-gcc13-bootstrap.spec b/cross-hppa-gcc13-bootstrap.spec index 4858456..ec210c7 100644 --- a/cross-hppa-gcc13-bootstrap.spec +++ b/cross-hppa-gcc13-bootstrap.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-hppa-gcc13.spec b/cross-hppa-gcc13.spec index a6b3d41..1ca4db9 100644 --- a/cross-hppa-gcc13.spec +++ b/cross-hppa-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-m68k-gcc13.spec b/cross-m68k-gcc13.spec index 1c7948a..707241d 100644 --- a/cross-m68k-gcc13.spec +++ b/cross-m68k-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-mips-gcc13.spec b/cross-mips-gcc13.spec index 4c15f1e..ab47c8a 100644 --- a/cross-mips-gcc13.spec +++ b/cross-mips-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-nvptx-gcc13.spec b/cross-nvptx-gcc13.spec index bf00ed3..37ff2ce 100644 --- a/cross-nvptx-gcc13.spec +++ b/cross-nvptx-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-ppc64-gcc13.spec b/cross-ppc64-gcc13.spec index 87799a7..189e19c 100644 --- a/cross-ppc64-gcc13.spec +++ b/cross-ppc64-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-ppc64le-gcc13.spec b/cross-ppc64le-gcc13.spec index d2deb50..e0c1256 100644 --- a/cross-ppc64le-gcc13.spec +++ b/cross-ppc64le-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-pru-gcc13-bootstrap.spec b/cross-pru-gcc13-bootstrap.spec index 8527750..123f550 100644 --- a/cross-pru-gcc13-bootstrap.spec +++ b/cross-pru-gcc13-bootstrap.spec @@ -134,6 +134,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -338,6 +339,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -360,26 +362,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -461,9 +479,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-pru-gcc13.spec b/cross-pru-gcc13.spec index 8959e4c..9d4f566 100644 --- a/cross-pru-gcc13.spec +++ b/cross-pru-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-riscv64-elf-gcc13-bootstrap.spec b/cross-riscv64-elf-gcc13-bootstrap.spec index 31ac996..fb460a6 100644 --- a/cross-riscv64-elf-gcc13-bootstrap.spec +++ b/cross-riscv64-elf-gcc13-bootstrap.spec @@ -134,6 +134,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -338,6 +339,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -360,26 +362,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -461,9 +479,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-riscv64-elf-gcc13.spec b/cross-riscv64-elf-gcc13.spec index 089a4f9..618d725 100644 --- a/cross-riscv64-elf-gcc13.spec +++ b/cross-riscv64-elf-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-riscv64-gcc13-bootstrap.spec b/cross-riscv64-gcc13-bootstrap.spec index 28f6753..2a31a45 100644 --- a/cross-riscv64-gcc13-bootstrap.spec +++ b/cross-riscv64-gcc13-bootstrap.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-riscv64-gcc13.spec b/cross-riscv64-gcc13.spec index 8a4e79c..faf8aba 100644 --- a/cross-riscv64-gcc13.spec +++ b/cross-riscv64-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-rx-gcc13-bootstrap.spec b/cross-rx-gcc13-bootstrap.spec index e76289d..ac4b8a1 100644 --- a/cross-rx-gcc13-bootstrap.spec +++ b/cross-rx-gcc13-bootstrap.spec @@ -134,6 +134,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -338,6 +339,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -360,26 +362,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -461,9 +479,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-rx-gcc13.spec b/cross-rx-gcc13.spec index f643a2d..7d2380f 100644 --- a/cross-rx-gcc13.spec +++ b/cross-rx-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-s390x-gcc13.spec b/cross-s390x-gcc13.spec index 8674508..4216ac3 100644 --- a/cross-s390x-gcc13.spec +++ b/cross-s390x-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-sparc-gcc13.spec b/cross-sparc-gcc13.spec index 07efc23..3e2bb80 100644 --- a/cross-sparc-gcc13.spec +++ b/cross-sparc-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-sparc64-gcc13.spec b/cross-sparc64-gcc13.spec index 38b6bda..b9a020f 100644 --- a/cross-sparc64-gcc13.spec +++ b/cross-sparc64-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/cross-x86_64-gcc13.spec b/cross-x86_64-gcc13.spec index f02ad0e..9cc666c 100644 --- a/cross-x86_64-gcc13.spec +++ b/cross-x86_64-gcc13.spec @@ -133,6 +133,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -337,6 +338,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -359,26 +361,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -460,9 +478,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/gcc.spec.in b/gcc.spec.in index e83c608..5ff2c00 100644 --- a/gcc.spec.in +++ b/gcc.spec.in @@ -385,6 +385,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -1348,6 +1349,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -1370,26 +1372,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -1471,9 +1489,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/gcc13-testresults.spec b/gcc13-testresults.spec index 10ec3d4..8489f0e 100644 --- a/gcc13-testresults.spec +++ b/gcc13-testresults.spec @@ -401,6 +401,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -539,6 +540,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -561,26 +563,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -662,9 +680,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/gcc13.changes b/gcc13.changes index 74c67dc..6ce68c8 100644 --- a/gcc13.changes +++ b/gcc13.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 2 08:01:18 UTC 2023 - Andreas Schwab + +- gdcflags.patch: Use substituted GDCFLAGS +- Filter out -Werror=return-type from D compile flags + ------------------------------------------------------------------- Thu Jul 20 09:04:51 UTC 2023 - Richard Biener diff --git a/gcc13.spec b/gcc13.spec index 464c41c..a8f4b1e 100644 --- a/gcc13.spec +++ b/gcc13.spec @@ -380,6 +380,7 @@ Patch17: gcc9-reproducible-builds-buildid-for-checksum.patch Patch18: gcc10-amdgcn-llvm-as.patch Patch19: gcc11-gdwarf-4-default.patch Patch20: gcc11-amdgcn-disable-hot-cold-partitioning.patch +Patch21: gdcflags.patch # A set of patches from the RH srpm Patch51: gcc41-ppc32-retaddr.patch # Some patches taken from Debian @@ -2356,6 +2357,7 @@ ln -s newlib-4.3.0.20230120/newlib . %if %{suse_version} < 1550 %patch19 -p1 %endif +%patch21 -p1 %patch51 %patch60 -p1 %patch61 -p1 @@ -2378,26 +2380,42 @@ echo "This is a dummy package to provide a dependency." > README rm -rf obj-%{GCCDIST} mkdir obj-%{GCCDIST} cd obj-%{GCCDIST} -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector[^ ]*//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g'` +# Filter out unwanted flags from $RPM_OPT_FLAGS +optflags= +optflags_d= +for flag in $RPM_OPT_FLAGS; do + add_flag= + case $flag in + -U_FORTIFY_SOURCE|-D_FORTIFY_SOURCE=*) ;; + -fno-rtti|-fno-exceptions|-Wmissing-format-attribute|-fstack-protector*) ;; + -ffortify=*|-Wall|-m32|-m64) ;; %ifarch %ix86 -# -mcpu is superceded by -mtune but -mtune is not supported by -# our bootstrap compiler. -mcpu gives a warning that stops -# the build process, so remove it for now. Also remove all other -# -march and -mtune flags. They are superseeded by proper -# default compiler settings now. -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-mcpu=i.86//g' -e 's/-march=i.86//g' -e 's/-mtune=i.86//g'` + # -mcpu is superseded by -mtune but -mtune is not supported by + # our bootstrap compiler. -mcpu gives a warning that stops + # the build process, so remove it for now. Also remove all other + # -march and -mtune flags. They are superseded by proper + # default compiler settings now. + -mcpu=i?86|-march=i?86|-mtune=i?86) ;; %endif %ifarch s390 s390x -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fsigned-char//g'` -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-O1/-O2/g'` + -fsigned-char) ;; + -O1) add_flag=-O2 ;; %endif %if 0%{?gcc_target_arch:1} -# Kill all -march/tune/cpu because that screws building the target libs -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'` + # Kill all -march/tune/cpu because that screws building the target libs + -march=*|-mtune=*|-mcpu=*) ;; %endif -# Replace 2 spaces by one finally -RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ / /g'` + *) add_flag=$flag ;; + esac + if test -n "$add_flag"; then + optflags+=" $add_flag" + case $add_flag in + # Filter out -Werror=return-type for D (only valid for C and C++) + -Werror=return-type) ;; + *) optflags_d+=" $add_flag" ;; + esac + fi +done languages=c %if %{build_cp} @@ -2479,9 +2497,12 @@ export GDC=gdc-11 CONFARGS="$CONFARGS --disable-libsanitizer" %endif -CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ -TCFLAGS="$RPM_OPT_FLAGS" \ ../configure \ + CFLAGS="$optflags" \ + CXXFLAGS="$optflags" \ + XCFLAGS="$optflags" \ + TCFLAGS="$optflags" \ + GDCFLAGS="$optflags_d" \ --prefix=%{_prefix} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ diff --git a/gdcflags.patch b/gdcflags.patch new file mode 100644 index 0000000..8083125 --- /dev/null +++ b/gdcflags.patch @@ -0,0 +1,57 @@ +From 1ed21e23d6d4da8201a09558b71d9a34281e54dd Mon Sep 17 00:00:00 2001 +From: Andreas Schwab +Date: Sun, 16 Jul 2023 19:43:56 +0200 +Subject: [PATCH] Use substituted GDCFLAGS + +Use the substituted value for GCDFLAGS instead of hardcoding $(CFLAGS) so +that the subdir configure scripts use the configured value. + + * configure.ac (GDCFLAGS): Set default from ${CFLAGS}. + * configure: Regenerate. + * Makefile.in (GDCFLAGS): Substitute @GDCFLAGS@. +--- + Makefile.in | 2 +- + configure | 1 + + configure.ac | 1 + + 3 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 04307ca561b..144bccd2603 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -444,7 +444,7 @@ LIBCFLAGS = $(CFLAGS) + CXXFLAGS = @CXXFLAGS@ + LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates + GOCFLAGS = $(CFLAGS) +-GDCFLAGS = $(CFLAGS) ++GDCFLAGS = @GDCFLAGS@ + GM2FLAGS = $(CFLAGS) + + # Pass additional PGO and LTO compiler options to the PGO build. +diff --git a/configure b/configure +index 0d3f5c6455d..3269da9829f 100755 +--- a/configure ++++ b/configure +@@ -12947,6 +12947,7 @@ fi + + + ++GDCFLAGS=${GDCFLAGS-${CFLAGS}} + + # Target tools. + +diff --git a/configure.ac b/configure.ac +index dddab2a56d8..d07a0fa7698 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3662,6 +3662,7 @@ AC_SUBST(CFLAGS) + AC_SUBST(CXXFLAGS) + AC_SUBST(GDC) + AC_SUBST(GDCFLAGS) ++GDCFLAGS=${GDCFLAGS-${CFLAGS}} + + # Target tools. + AC_ARG_WITH([build-time-tools], +-- +2.41.0 + From 9a981f80168d19745b82c6001f8279f8a226f8a51736e85517743a34370a3705 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 3 Aug 2023 13:38:41 +0000 Subject: [PATCH 2/2] - Bump to cc279d6c64562f05019e1d12d0d825f9391b5553, git7683 * Includes GCC 13.2 release * Includes patch to fix broken testcase in libbacktrace, fixing build problems on SLES 12 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gcc13?expand=0&rev=58 --- cross-aarch64-gcc13-bootstrap.spec | 2 +- cross-aarch64-gcc13.spec | 2 +- cross-amdgcn-gcc13.spec | 2 +- cross-arm-gcc13.spec | 2 +- cross-arm-none-gcc13-bootstrap.spec | 2 +- cross-arm-none-gcc13.spec | 2 +- cross-avr-gcc13-bootstrap.spec | 2 +- cross-avr-gcc13.spec | 2 +- cross-bpf-gcc13.spec | 2 +- cross-epiphany-gcc13-bootstrap.spec | 2 +- cross-epiphany-gcc13.spec | 2 +- cross-hppa-gcc13-bootstrap.spec | 2 +- cross-hppa-gcc13.spec | 2 +- cross-m68k-gcc13.spec | 2 +- cross-mips-gcc13.spec | 2 +- cross-nvptx-gcc13.spec | 2 +- cross-ppc64-gcc13.spec | 2 +- cross-ppc64le-gcc13.spec | 2 +- cross-pru-gcc13-bootstrap.spec | 2 +- cross-pru-gcc13.spec | 2 +- cross-riscv64-elf-gcc13-bootstrap.spec | 2 +- cross-riscv64-elf-gcc13.spec | 2 +- cross-riscv64-gcc13-bootstrap.spec | 2 +- cross-riscv64-gcc13.spec | 2 +- cross-rx-gcc13-bootstrap.spec | 2 +- cross-rx-gcc13.spec | 2 +- cross-s390x-gcc13.spec | 2 +- cross-sparc-gcc13.spec | 2 +- cross-sparc64-gcc13.spec | 2 +- cross-x86_64-gcc13.spec | 2 +- gcc-13.1.1+git7597.tar.xz | 3 --- gcc-13.2.1+git7683.tar.xz | 3 +++ gcc.spec.in | 2 +- gcc13-testresults.spec | 2 +- gcc13.changes | 8 ++++++++ gcc13.spec | 2 +- 36 files changed, 44 insertions(+), 36 deletions(-) delete mode 100644 gcc-13.1.1+git7597.tar.xz create mode 100644 gcc-13.2.1+git7683.tar.xz diff --git a/cross-aarch64-gcc13-bootstrap.spec b/cross-aarch64-gcc13-bootstrap.spec index 44ffda4..f8d1d7d 100644 --- a/cross-aarch64-gcc13-bootstrap.spec +++ b/cross-aarch64-gcc13-bootstrap.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-aarch64-gcc13.spec b/cross-aarch64-gcc13.spec index fff11f7..d925ab9 100644 --- a/cross-aarch64-gcc13.spec +++ b/cross-aarch64-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-amdgcn-gcc13.spec b/cross-amdgcn-gcc13.spec index 74ba1fc..07e5637 100644 --- a/cross-amdgcn-gcc13.spec +++ b/cross-amdgcn-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-arm-gcc13.spec b/cross-arm-gcc13.spec index c645571..9816828 100644 --- a/cross-arm-gcc13.spec +++ b/cross-arm-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-arm-none-gcc13-bootstrap.spec b/cross-arm-none-gcc13-bootstrap.spec index 2277a57..5050ca3 100644 --- a/cross-arm-none-gcc13-bootstrap.spec +++ b/cross-arm-none-gcc13-bootstrap.spec @@ -108,7 +108,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-arm-none-gcc13.spec b/cross-arm-none-gcc13.spec index 433f880..eaee242 100644 --- a/cross-arm-none-gcc13.spec +++ b/cross-arm-none-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-avr-gcc13-bootstrap.spec b/cross-avr-gcc13-bootstrap.spec index 7622575..50d91c0 100644 --- a/cross-avr-gcc13-bootstrap.spec +++ b/cross-avr-gcc13-bootstrap.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-avr-gcc13.spec b/cross-avr-gcc13.spec index 708ef74..dcdcf32 100644 --- a/cross-avr-gcc13.spec +++ b/cross-avr-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-bpf-gcc13.spec b/cross-bpf-gcc13.spec index abc860d..662f963 100644 --- a/cross-bpf-gcc13.spec +++ b/cross-bpf-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-epiphany-gcc13-bootstrap.spec b/cross-epiphany-gcc13-bootstrap.spec index b2a1d3d..fc669ab 100644 --- a/cross-epiphany-gcc13-bootstrap.spec +++ b/cross-epiphany-gcc13-bootstrap.spec @@ -108,7 +108,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-epiphany-gcc13.spec b/cross-epiphany-gcc13.spec index d066ca8..ccf9266 100644 --- a/cross-epiphany-gcc13.spec +++ b/cross-epiphany-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-hppa-gcc13-bootstrap.spec b/cross-hppa-gcc13-bootstrap.spec index ec210c7..e208ba4 100644 --- a/cross-hppa-gcc13-bootstrap.spec +++ b/cross-hppa-gcc13-bootstrap.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-hppa-gcc13.spec b/cross-hppa-gcc13.spec index 1ca4db9..dd064a8 100644 --- a/cross-hppa-gcc13.spec +++ b/cross-hppa-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-m68k-gcc13.spec b/cross-m68k-gcc13.spec index 707241d..0d664f4 100644 --- a/cross-m68k-gcc13.spec +++ b/cross-m68k-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-mips-gcc13.spec b/cross-mips-gcc13.spec index ab47c8a..709bc45 100644 --- a/cross-mips-gcc13.spec +++ b/cross-mips-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-nvptx-gcc13.spec b/cross-nvptx-gcc13.spec index 37ff2ce..0658422 100644 --- a/cross-nvptx-gcc13.spec +++ b/cross-nvptx-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-ppc64-gcc13.spec b/cross-ppc64-gcc13.spec index 189e19c..f42d1d5 100644 --- a/cross-ppc64-gcc13.spec +++ b/cross-ppc64-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-ppc64le-gcc13.spec b/cross-ppc64le-gcc13.spec index e0c1256..0fc5a8f 100644 --- a/cross-ppc64le-gcc13.spec +++ b/cross-ppc64le-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-pru-gcc13-bootstrap.spec b/cross-pru-gcc13-bootstrap.spec index 123f550..ef49ee5 100644 --- a/cross-pru-gcc13-bootstrap.spec +++ b/cross-pru-gcc13-bootstrap.spec @@ -108,7 +108,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-pru-gcc13.spec b/cross-pru-gcc13.spec index 9d4f566..202a09b 100644 --- a/cross-pru-gcc13.spec +++ b/cross-pru-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-riscv64-elf-gcc13-bootstrap.spec b/cross-riscv64-elf-gcc13-bootstrap.spec index fb460a6..a9a55fd 100644 --- a/cross-riscv64-elf-gcc13-bootstrap.spec +++ b/cross-riscv64-elf-gcc13-bootstrap.spec @@ -108,7 +108,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-riscv64-elf-gcc13.spec b/cross-riscv64-elf-gcc13.spec index 618d725..0e04c40 100644 --- a/cross-riscv64-elf-gcc13.spec +++ b/cross-riscv64-elf-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-riscv64-gcc13-bootstrap.spec b/cross-riscv64-gcc13-bootstrap.spec index 2a31a45..b02e593 100644 --- a/cross-riscv64-gcc13-bootstrap.spec +++ b/cross-riscv64-gcc13-bootstrap.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-riscv64-gcc13.spec b/cross-riscv64-gcc13.spec index faf8aba..28883e4 100644 --- a/cross-riscv64-gcc13.spec +++ b/cross-riscv64-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-rx-gcc13-bootstrap.spec b/cross-rx-gcc13-bootstrap.spec index ac4b8a1..d2f6586 100644 --- a/cross-rx-gcc13-bootstrap.spec +++ b/cross-rx-gcc13-bootstrap.spec @@ -108,7 +108,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-rx-gcc13.spec b/cross-rx-gcc13.spec index 7d2380f..00b43c4 100644 --- a/cross-rx-gcc13.spec +++ b/cross-rx-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-s390x-gcc13.spec b/cross-s390x-gcc13.spec index 4216ac3..66c6f71 100644 --- a/cross-s390x-gcc13.spec +++ b/cross-s390x-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-sparc-gcc13.spec b/cross-sparc-gcc13.spec index 3e2bb80..6ee8d1d 100644 --- a/cross-sparc-gcc13.spec +++ b/cross-sparc-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-sparc64-gcc13.spec b/cross-sparc64-gcc13.spec index b9a020f..3a80168 100644 --- a/cross-sparc64-gcc13.spec +++ b/cross-sparc64-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/cross-x86_64-gcc13.spec b/cross-x86_64-gcc13.spec index 9cc666c..5abc3f8 100644 --- a/cross-x86_64-gcc13.spec +++ b/cross-x86_64-gcc13.spec @@ -107,7 +107,7 @@ Name: %{pkgname} %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/gcc-13.1.1+git7597.tar.xz b/gcc-13.1.1+git7597.tar.xz deleted file mode 100644 index 1a61ec6..0000000 --- a/gcc-13.1.1+git7597.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aab55d8437f8ba3cebf512b8e5016fa3785089cfdddbe5f56cdf13f692e2a30f -size 86895024 diff --git a/gcc-13.2.1+git7683.tar.xz b/gcc-13.2.1+git7683.tar.xz new file mode 100644 index 0000000..687a184 --- /dev/null +++ b/gcc-13.2.1+git7683.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0de8347c3e57032fe680dd4ae7244c2fd1053afdacd131c1b7be3af3edf8012d +size 87200052 diff --git a/gcc.spec.in b/gcc.spec.in index 5ff2c00..1aa8833 100644 --- a/gcc.spec.in +++ b/gcc.spec.in @@ -204,7 +204,7 @@ %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 1 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/gcc13-testresults.spec b/gcc13-testresults.spec index 8489f0e..0e9a6ea 100644 --- a/gcc13-testresults.spec +++ b/gcc13-testresults.spec @@ -221,7 +221,7 @@ %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/') diff --git a/gcc13.changes b/gcc13.changes index 6ce68c8..bc3fd2d 100644 --- a/gcc13.changes +++ b/gcc13.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Aug 3 13:34:26 UTC 2023 - Richard Biener + +- Bump to cc279d6c64562f05019e1d12d0d825f9391b5553, git7683 + * Includes GCC 13.2 release + * Includes patch to fix broken testcase in libbacktrace, fixing + build problems on SLES 12 + ------------------------------------------------------------------- Wed Aug 2 08:01:18 UTC 2023 - Andreas Schwab diff --git a/gcc13.spec b/gcc13.spec index a8f4b1e..d2141eb 100644 --- a/gcc13.spec +++ b/gcc13.spec @@ -200,7 +200,7 @@ %define biarch_targets x86_64 s390x powerpc64 powerpc sparc sparc64 URL: https://gcc.gnu.org/ -Version: 13.1.1+git7597 +Version: 13.2.1+git7683 Release: 0 %define gcc_dir_version %(echo %version | sed 's/+.*//' | cut -d '.' -f 1) %define gcc_snapshot_revision %(echo %version | sed 's/[3-9]\.[0-9]\.[0-6]//' | sed 's/+/-/')