1 https://bugs.gentoo.org/708744
3 From 6bd6308fcea3541e505651bf8e8127a4a03d22cd Mon Sep 17 00:00:00 2001
4 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
5 Date: Tue, 12 Nov 2019 09:19:18 +0100
6 Subject: [PATCH] Adapt Configure to GCC version 10
8 I got a notice from Jeff Law <law@redhat.com>:
10 Your particular package fails its testsuite. This was ultimately
11 tracked down to a Configure problem. The perl configure script treated
12 gcc-10 as gcc-1 and turned on -fpcc-struct-return. This is an ABI
13 changing flag and caused Perl to not be able to interact properly with
14 the dbm libraries on the system leading to a segfault.
16 His proposed patch corrected only this one instance of the version
17 mismatch. Reading the Configure script revealed more issues. This
18 patch fixes all of them I found.
20 Please note I do not have GCC 10 available, I tested it by faking the version
25 @@ -4701,7 +4701,7 @@ else
29 -1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
30 +1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
33 '') gccosandvers='' ;;
34 @@ -4741,7 +4741,7 @@ esac
35 # gcc 3.* complain about adding -Idirectories that they already know about,
36 # so we will take those off from locincpth.
41 for incdir in $locincpth; do
42 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
43 @@ -5467,13 +5467,13 @@ fi
47 - 1*) dflt="$dflt -fpcc-struct-return" ;;
48 + 1.*) dflt="$dflt -fpcc-struct-return" ;;
50 case "$optimize:$DEBUGGING" in
51 *-g*:old) dflt="$dflt -DDEBUGGING";;
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
58 # Interactive Systems (ISC) POSIX mode.
59 @@ -5482,7 +5482,7 @@ default|recommended)
66 ?*) set strict-aliasing -fno-strict-aliasing
68 @@ -5600,7 +5600,7 @@ case "$cppflags" in
72 -1*) cppflags="$cppflags -D__GNUC__"
73 +1.*) cppflags="$cppflags -D__GNUC__"
77 @@ -23103,7 +23103,7 @@ fi
79 : add -D_FORTIFY_SOURCE if feasible and not already there
81 -[456789].*) 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
88 @@ -156,7 +156,7 @@ esac
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++?
96 # NOTE 1: the -std=c89 without -pedantic is a bit pointless.