The build fails early as: """ x86_64-pc-linux-gnu-gcc -c -DPERL_CORE -fwrapv -fpcc-struct-return -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -march=sandybridge -mtune=sandybridge -maes --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=8192 -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -Wall -Wextra -Wstack-protector -g -Wall -fPIC gv.c ... LD_LIBRARY_PATH=/tmp/portage/dev-lang/perl-5.30.1/work/perl-5.30.1 /tmp/portage/dev-lang/perl-5.30.1/work/perl-5.30.1/preload /tmp/portage/dev-lang/perl-5.30.1/work/perl-5.30.1/libperl.so.5.30.1 ./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1' Attempt to free unreferenced scalar: SV 0x5555ed3e1378. /bin/sh: line 1: 4057907 Segmentation fault (core dumped) LD_LIBRARY_PATH=/tmp/portage/dev-lang/perl-5.30.1/work/perl-5.30.1 /tmp/portage/dev-lang/perl-5.30.1/work/perl-5.30.1/preload /tmp/portage/dev-lang/perl-5.30.1/work/perl-5.30.1/libperl.so.5.30.1 ./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' """ Note how x86_64-pc-linux-gnu-gcc command lacks a few crucial flags and adds ancient ones. Here is 9.2.0 build command for comparison: """ x86_64-pc-linux-gnu-gcc-9.2.0 -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 -march=sandybridge -mtune=sandybridge -maes --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=8192 -O2 -pipe -fdiagnostics-show-option -frecord-gcc-switches -Wall -Wextra -Wstack-protector -g -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -fPIC gv.c """ Specifically on gcc-10: - -fpcc-struct-return is passed: that breaks struct-passing ABI - -fno-strict-aliasing is not passed: that makes type punning code to throw away "dead" loads/stores across ponter casts. The bug is already fixed upstream in https://github.com/Perl/perl5/commit/6bd6308fcea3541e505651bf8e8127a4a03d22cd where gcc-10 was detected as gcc-1.
Created attachment 612830 [details, diff] perl-5-gcc-10.patch perl-5-gcc-10.patch fixes perl for me. Note: it's an upstream patch with a tiny change: accidental gcc version "detection" change is reverted.
(In reply to Sergei Trofimovich from comment #1) > Created attachment 612830 [details, diff] [details, diff] > perl-5-gcc-10.patch > > perl-5-gcc-10.patch fixes perl for me. Note: it's an upstream patch with a > tiny change: accidental gcc version "detection" change is reverted. A month has passed. I plan to go ahead and apply it in a few days to stable ebuild as: --- a/dev-lang/perl/perl-5.30.1.ebuild +++ b/dev-lang/perl/perl-5.30.1.ebuild @@ -304,6 +304,7 @@ src_prepare() { if use hppa ; then epatch "${FILESDIR}/${PN}-5.26.2-hppa.patch" # bug 634162 fi + eapply "${FILESDIR}"/${PN}-5.30.1-gcc-10.patch # bug 708744 if [[ ${CHOST} == *-solaris* ]] ; then # do NOT mess with nsl, on Solaris this is always necessary,
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f58732f2213d0453bbbe165c4f08694b3653df7 commit 3f58732f2213d0453bbbe165c4f08694b3653df7 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-03-21 22:56:19 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-03-21 22:59:45 +0000 dev-lang/perl: tweak for gcc-10, bug #708744 Perl's Configure detected gcc-10 as gcc-1 and applied -fpcc-struct-return option that breakw C ABI. This caused mini-interpreter to crash early at bootstrap time. The change is a direct backport of upstreams 6bd6308fcea3541e50565 ("Adapt Configure to GCC version 10"). Closes: https://bugs.gentoo.org/708744 Package-Manager: Portage-2.3.94, Repoman-2.3.21 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> dev-lang/perl/files/perl-5.30.1-gcc-10.patch | 99 ++++++++++++++++++++++++++++ dev-lang/perl/perl-5.30.1.ebuild | 1 + 2 files changed, 100 insertions(+)