blob: aa43f051bf615b1dce4da79e2af85ac0a0b28012 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 6bd6308fcea3541e505651bf8e8127a4a03d22cd Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
3Date: Tue, 12 Nov 2019 09:19:18 +0100
4Subject: [PATCH] Adapt Configure to GCC version 10
5
6I got a notice from Jeff Law <law@redhat.com>:
7
8 Your particular package fails its testsuite. This was ultimately
9 tracked down to a Configure problem. The perl configure script treated
10 gcc-10 as gcc-1 and turned on -fpcc-struct-return. This is an ABI
11 changing flag and caused Perl to not be able to interact properly with
12 the dbm libraries on the system leading to a segfault.
13
14His proposed patch corrected only this one instance of the version
15mismatch. Reading the Configure script revealed more issues. This
16patch fixes all of them I found.
17
18---
19 Configure | 14 +++++++-------
20 cflags.SH | 2 +-
21 2 files changed, 8 insertions(+), 8 deletions(-)
22
23--- a/Configure
24+++ b/Configure
25@@ -4689,7 +4689,7 @@ else
26 fi
27 $rm -f try try.*
28 case "$gccversion" in
29-1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
30+1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
31 esac
32 case "$gccversion" in
33 '') gccosandvers='' ;;
34@@ -4729,7 +4729,7 @@ esac
35 # gcc 3.* complain about adding -Idirectories that they already know about,
36 # so we will take those off from locincpth.
37 case "$gccversion" in
38-3*)
39+3.*)
40 echo "main(){}">try.c
41 for incdir in $locincpth; do
42 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
43@@ -5455,13 +5455,13 @@ fi
44 case "$hint" in
45 default|recommended)
46 case "$gccversion" in
47- 1*) dflt="$dflt -fpcc-struct-return" ;;
48+ 1.*) dflt="$dflt -fpcc-struct-return" ;;
49 esac
50 case "$optimize:$DEBUGGING" in
51 *-g*:old) dflt="$dflt -DDEBUGGING";;
52 esac
53 case "$gccversion" in
54- 2*) if $test -d /etc/conf/kconfig.d &&
55+ 2.*) if $test -d /etc/conf/kconfig.d &&
56 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
57 then
58 # Interactive Systems (ISC) POSIX mode.
59@@ -5470,7 +5470,7 @@ default|recommended)
60 ;;
61 esac
62 case "$gccversion" in
63- 1*) ;;
64+ 1.*) ;;
65 2.[0-8]*) ;;
66 ?*) set strict-aliasing -fno-strict-aliasing
67 eval $checkccflag
68@@ -5588,7 +5588,7 @@ case "$cppflags" in
69 ;;
70 esac
71 case "$gccversion" in
72-1*) cppflags="$cppflags -D__GNUC__"
73+1.*) cppflags="$cppflags -D__GNUC__"
74 esac
75 case "$mips_type" in
76 '');;
77@@ -22957,7 +22957,7 @@ fi
78
79 : add -D_FORTIFY_SOURCE if feasible and not already there
80 case "$gccversion" in
81-[4567].*) case "$optimize$ccflags" in
82+[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
83 *-O*) case "$ccflags$cppsymbols" in
84 *_FORTIFY_SOURCE=*) # Don't add it again.
85 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
86--- a/cflags.SH
87+++ b/cflags.SH
88@@ -156,7 +156,7 @@ esac
89
90 case "$gccversion" in
91 '') ;;
92-[12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
93+[12].*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
94 Intel*) ;; # # Is that you, Intel C++?
95 #
96 # NOTE 1: the -std=c89 without -pedantic is a bit pointless.