develooper Front page | perl.perl5.porters | Postings from July 2019

[perl #134241] Perl 5.30.0 fails with LTO optimisation

Thread Previous | Thread Next
From:
Tony Cook via RT
Date:
July 3, 2019 05:20
Subject:
[perl #134241] Perl 5.30.0 fails with LTO optimisation
Message ID:
rt-4.0.24-2168-1562131185-571.134241-15-0@perl.org
On Mon, 01 Jul 2019 23:17:21 -0700, tonyc wrote:
> On Sun, 30 Jun 2019 16:00:02 -0700, kloczko.tomasz@gmail.com wrote:
> > When Perl 5.30.0 is build with LTO optimisation linking of the
> > miniperl fails with:
> >
> > rm -rf mpdtrace
> > mkdir mpdtrace
> > cp opmini.o perlmini.o gv.o toke.o perly.o pad.o regcomp.o dump.o
> > util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o run.o pp_hot.o
> > sv.o pp.o scope.o pp_ctl.o pp_sys.
> > CFLAGS="`sh  cflags "optimize='-g'" dtrace_mini.o`" /usr/bin/dtrace
> > -G -s perldtrace.d -o dtrace_mini.o     mpdtrace/opmini.o
> > mpdtrace/perlmini.o mpdtrace/gv.o mpdtrace
> > gcc -Wl,-z,relro -Wl,--as-needed -Wl,-z,now
> > -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto
> > -fuse-linker-plugin -fstack-protector-strong -L/usr/local/lib -o
> > miniperl mpdtrace/opmini.o mpdtrace/perlmini.o mpdtrace/gv.o
> > mpdtrace/toke.o mpdtrace/perly.o mpdtrace/pad.o mpdtrace/regcomp.o
> > mpdtrace/dump.o mpdtrace/util.o mpdtrace/mg.o
> > perl.h:7278:19: warning: type of 'PL_nan' does not match original
> > declaration [-Wlto-type-mismatch]
> >  7278 | INFNAN_NV_U8_DECL PL_nan;
> >       |   ^
> > perl.h:7248:19: note: 'PL_nan' was previously declared here
> >  7248 | INFNAN_U8_NV_DECL PL_nan = { { DOUBLENANBYTES } };
> >       |   ^
> > perl.h:7277:19: warning: type of 'PL_inf' does not match original
> > declaration [-Wlto-type-mismatch]
> >  7277 | INFNAN_NV_U8_DECL PL_inf;
> >       |   ^
> > perl.h:7212:19: note: 'PL_inf' was previously declared here
> >  7212 | INFNAN_U8_NV_DECL PL_inf = { { DOUBLEINFBYTES } };
> >       |   ^
> > /usr/bin/ld:
> > /tmp/miniperl.bCBaN7.ltrans19.ltrans.o:(.note.stapsdt+0x24):
> > undefined reference to `perl_phase__change_semaphore'
> > /usr/bin/ld:
> > /tmp/miniperl.bCBaN7.ltrans19.ltrans.o:(.note.stapsdt+0x120):
> > undefined reference to `perl_sub__return_semaphore'
> > /usr/bin/ld:
> > /tmp/miniperl.bCBaN7.ltrans2.ltrans.o:(.note.stapsdt+0x24):
> > undefined reference to `perl_loading__file_semaphore'
> > /usr/bin/ld:
> > /tmp/miniperl.bCBaN7.ltrans2.ltrans.o:(.note.stapsdt+0x6c):
> > undefined reference to `perl_loaded__file_semaphore'
> > collect2: error: ld returned 1 exit status
> > make: *** [makefile:398: lib/buildcustomize.pl] Error 1
> > error: Bad exit status from /var/tmp/rpm-tmp.Mv5rO5 (%build)
> 
> Please provide the options you supplied to Configure.

I managed to reproduce some missing symbols (but not these) with:

./Configure -des -Dusedevel -Dusedtrace -Doptimize='-O1 -g -flto' -Dusethreads -Dusequadmath && make test-prep

Adding:

 -Dar=gcc-ar

fixed them, but there are some test failures, of which there seem to be five basic causes:

1) goto fails in some way, or crashes (op/eval.t, op/goto.t, lib/croak.t)

2) libperl.t fails because it insists on using /usr/bin/nm rather than $Config{nm} if you set -Dnm=gcc-nm, if you fix that...

3) libperl.t doesn't handle some constants being moved to the text segment

4) PL_ppaddr despite not being constant is moved to the text segment, which libperl.t correctly complains about

5) cpan/ExtUtils-MakeMaker/t/03-xsstatic.t fails its staticmulti test



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=134241

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About