Skip to content

Problem with sub position  #441

Open
@adipi71

Description

@adipi71

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions