]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/perl-5.30.0-fix-build-failure-against-gcc-10.patch
suricata: Change midstream policy to "pass-flow"
[ipfire-2.x.git] / src / patches / perl-5.30.0-fix-build-failure-against-gcc-10.patch
1 https://bugs.gentoo.org/708744
2
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
7
8 I got a notice from Jeff Law <law@redhat.com>:
9
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.
15
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.
19
20 Please note I do not have GCC 10 available, I tested it by faking the version
21 with:
22
23 --- a/Configure
24 +++ b/Configure
25 @@ -4701,7 +4701,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 @@ -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.
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 @@ -5467,13 +5467,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 @@ -5482,7 +5482,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 @@ -5600,7 +5600,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 @@ -23103,7 +23103,7 @@ fi
78
79 : add -D_FORTIFY_SOURCE if feasible and not already there
80 case "$gccversion" in
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
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.
97 --
98 2.25.0
99