Skip to content

Commit 6bd6308

Browse files
ppisarbingos
authored andcommitted
Adapt Configure to GCC version 10
I got a notice from Jeff Law <law@redhat.com>: Your particular package fails its testsuite. This was ultimately tracked down to a Configure problem. The perl configure script treated gcc-10 as gcc-1 and turned on -fpcc-struct-return. This is an ABI changing flag and caused Perl to not be able to interact properly with the dbm libraries on the system leading to a segfault. His proposed patch corrected only this one instance of the version mismatch. Reading the Configure script revealed more issues. This patch fixes all of them I found. Please note I do not have GCC 10 available, I tested it by faking the version with: --- a/Configure +++ b/Configure @@ -4672,7 +4672,7 @@ $cat >try.c <<EOM int main() { #if defined(__GNUC__) && !defined(__INTEL_COMPILER) #ifdef __VERSION__ - printf("%s\n", __VERSION__); + printf("%s\n", "10.0.0"); #else printf("%s\n", "1"); #endif
1 parent be45a1e commit 6bd6308

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Configure

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4701,7 +4701,7 @@ else
47014701
fi
47024702
$rm -f try try.*
47034703
case "$gccversion" in
4704-
1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4704+
1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
47054705
esac
47064706
case "$gccversion" in
47074707
'') gccosandvers='' ;;
@@ -4741,7 +4741,7 @@ esac
47414741
# gcc 3.* complain about adding -Idirectories that they already know about,
47424742
# so we will take those off from locincpth.
47434743
case "$gccversion" in
4744-
3*)
4744+
3.*)
47454745
echo "main(){}">try.c
47464746
for incdir in $locincpth; do
47474747
warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
@@ -5467,13 +5467,13 @@ fi
54675467
case "$hint" in
54685468
default|recommended)
54695469
case "$gccversion" in
5470-
1*) dflt="$dflt -fpcc-struct-return" ;;
5470+
1.*) dflt="$dflt -fpcc-struct-return" ;;
54715471
esac
54725472
case "$optimize:$DEBUGGING" in
54735473
*-g*:old) dflt="$dflt -DDEBUGGING";;
54745474
esac
54755475
case "$gccversion" in
5476-
2*) if $test -d /etc/conf/kconfig.d &&
5476+
2.*) if $test -d /etc/conf/kconfig.d &&
54775477
$contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
54785478
then
54795479
# Interactive Systems (ISC) POSIX mode.
@@ -5482,7 +5482,7 @@ default|recommended)
54825482
;;
54835483
esac
54845484
case "$gccversion" in
5485-
1*) ;;
5485+
1.*) ;;
54865486
2.[0-8]*) ;;
54875487
?*) set strict-aliasing -fno-strict-aliasing
54885488
eval $checkccflag
@@ -5600,7 +5600,7 @@ case "$cppflags" in
56005600
;;
56015601
esac
56025602
case "$gccversion" in
5603-
1*) cppflags="$cppflags -D__GNUC__"
5603+
1.*) cppflags="$cppflags -D__GNUC__"
56045604
esac
56055605
case "$mips_type" in
56065606
'');;
@@ -23103,7 +23103,7 @@ fi
2310323103

2310423104
: add -D_FORTIFY_SOURCE if feasible and not already there
2310523105
case "$gccversion" in
23106-
[456789].*) case "$optimize$ccflags" in
23106+
[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
2310723107
*-O*) case "$ccflags$cppsymbols" in
2310823108
*_FORTIFY_SOURCE=*) # Don't add it again.
2310923109
echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4

cflags.SH

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ esac
156156

157157
case "$gccversion" in
158158
'') ;;
159-
[12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
159+
[12].*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
160160
Intel*) ;; # # Is that you, Intel C++?
161161
#
162162
# NOTE 1: the -std=c89 without -pedantic is a bit pointless.

0 commit comments

Comments
 (0)