683572
From 913582217c96512015fd60f270f0e262824579b7 Mon Sep 17 00:00:00 2001
683572
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
683572
Date: Tue, 12 Nov 2019 09:19:18 +0100
683572
Subject: [PATCH] Adapt Configure to GCC version 10
683572
MIME-Version: 1.0
683572
Content-Type: text/plain; charset=UTF-8
683572
Content-Transfer-Encoding: 8bit
683572
683572
I got a notice from Jeff Law <law@redhat.com>:
683572
683572
    Your particular package fails its testsuite. This was ultimately
683572
    tracked down to a Configure problem. The perl configure script treated
683572
    gcc-10 as gcc-1 and turned on -fpcc-struct-return. This is an ABI
683572
    changing flag and caused Perl to not be able to interact properly with
683572
    the dbm libraries on the system leading to a segfault.
683572
683572
His proposed patch corrected only this one instance of the version
683572
mismatch. Reading the Configure script revealed more issues. This
683572
patch fixes all of them I found.
683572
683572
Please note I did not test it because I don't have GCC 10 available.
683572
683572
Signed-off-by: Petr Písař <ppisar@redhat.com>
683572
---
683572
 Configure | 14 +++++++-------
683572
 cflags.SH |  2 +-
683572
 2 files changed, 8 insertions(+), 8 deletions(-)
683572
683572
diff --git a/Configure b/Configure
683572
index fad1c9f2b1..706c0b64ed 100755
683572
--- a/Configure
683572
+++ b/Configure
683572
@@ -4701,7 +4701,7 @@ else
683572
 fi
683572
 $rm -f try try.*
683572
 case "$gccversion" in
683572
-1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
683572
+1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
683572
 esac
683572
 case "$gccversion" in
683572
 '') gccosandvers='' ;;
683572
@@ -4741,7 +4741,7 @@ esac
683572
 # gcc 3.* complain about adding -Idirectories that they already know about,
683572
 # so we will take those off from locincpth.
683572
 case "$gccversion" in
683572
-3*)
683572
+3.*)
683572
     echo "main(){}">try.c
683572
     for incdir in $locincpth; do
683572
        warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
683572
@@ -5467,13 +5467,13 @@ fi
683572
 case "$hint" in
683572
 default|recommended)
683572
 	case "$gccversion" in
683572
-	1*) dflt="$dflt -fpcc-struct-return" ;;
683572
+	1.*) dflt="$dflt -fpcc-struct-return" ;;
683572
 	esac
683572
 	case "$optimize:$DEBUGGING" in
683572
 	*-g*:old) dflt="$dflt -DDEBUGGING";;
683572
 	esac
683572
 	case "$gccversion" in
683572
-	2*) if $test -d /etc/conf/kconfig.d &&
683572
+	2.*) if $test -d /etc/conf/kconfig.d &&
683572
 			$contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
683572
 		then
683572
 			# Interactive Systems (ISC) POSIX mode.
683572
@@ -5482,7 +5482,7 @@ default|recommended)
683572
 		;;
683572
 	esac
683572
 	case "$gccversion" in
683572
-	1*) ;;
683572
+	1.*) ;;
683572
 	2.[0-8]*) ;;
683572
 	?*)	set strict-aliasing -fno-strict-aliasing
683572
 		eval $checkccflag
683572
@@ -5600,7 +5600,7 @@ case "$cppflags" in
683572
     ;;
683572
 esac
683572
 case "$gccversion" in
683572
-1*) cppflags="$cppflags -D__GNUC__"
683572
+1.*) cppflags="$cppflags -D__GNUC__"
683572
 esac
683572
 case "$mips_type" in
683572
 '');;
683572
@@ -23103,7 +23103,7 @@ fi
683572
 
683572
 : add -D_FORTIFY_SOURCE if feasible and not already there
683572
 case "$gccversion" in
683572
-[456789].*)	case "$optimize$ccflags" in
683572
+[456789].*|[1-9][0-9]*)	case "$optimize$ccflags" in
683572
 	*-O*)	case "$ccflags$cppsymbols" in
683572
 		*_FORTIFY_SOURCE=*) # Don't add it again.
683572
 			echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
683572
diff --git a/cflags.SH b/cflags.SH
683572
index e60742fed1..f1bcd6c38e 100755
683572
--- a/cflags.SH
683572
+++ b/cflags.SH
683572
@@ -156,7 +156,7 @@ esac
683572
 
683572
 case "$gccversion" in
683572
 '') ;;
683572
-[12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
683572
+[12].*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
683572
 Intel*) ;; # # Is that you, Intel C++?
683572
 #
683572
 # NOTE 1: the -std=c89 without -pedantic is a bit pointless.
683572
-- 
683572
2.21.0
683572