This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Adapt Configure to GCC version 10
authorPetr Písař <ppisar@redhat.com>
Tue, 12 Nov 2019 08:19:18 +0000 (09:19 +0100)
committerChris Williams <chris@bingosnet.co.uk>
Tue, 12 Nov 2019 11:49:08 +0000 (11:49 +0000)
commit6bd6308fcea3541e505651bf8e8127a4a03d22cd
treef581612b19109ec0167dff39f56092b55e6aafb8
parentbe45a1e1e43579d38b8161de4c42f27ea053a20f
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
Configure
cflags.SH