rurban/perl-compiler

Problem with sub position

adipi71 opened this issue · 4 comments

Problem with sub position

Is the sub position in perl code a problem for -MO:CC ?
The problem below is not present for -MO=C

Thank you in advance
Adriano

correct code

file: test.pl

sub hi{    print "hello\n"; }
hi();

is compiled correctly with
perl -MO=CC test.pl > out.c

wrong code

file: test.pl

hi();
sub hi{    print "hello\n"; }

creates warning

$ perl -MO=CC  test.pl > out.c
Warning: Label not found at compile time for "last GETFILE"
Warning: Label not found at compile time for "last GETFILE"
test.pl syntax OK

and the compiled file creates segmentation fault

x86_64-linux-gnu-gcc -g -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.30/CORE -o test out.c -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.30/CORE -lperl -ldl -lm -lpthread -lc -lcrypt

That's a B:CC bug, thanks

works ok with cperl5.30. perl5 is broken since 5.26

works ok with cperl5.30. perl5 is broken since 5.26

I've got perl 5.30 and it doesn't work

$ perl -v
This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi
(with 50 registered patches, see perl -V for more detail)
...

Is your same version?
Thank you for taking in consideration this issue
Adriano

Sorry,
I didn't understand you were mentioning cperl
Thanks