Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Error build with option -O

2 views
Skip to first unread message

Karl Williamson

unread,
Apr 26, 2017, 2:45:02 PM4/26/17
to Yaroslav Kuzmin, perl...@perl.org, perl5-...@perl.org
On 04/18/2017 01:22 AM, Yaroslav Kuzmin wrote:
> Hi All
>
> We switched to a new version of z/OS 2.02
>
> SO a new version XLC with option -O , building perl with error.
>
>
> > (02:56) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> make miniperl
> > echo @`sh cflags "optimize='-O'" opmini.o` -DPERL_IS_MINIPERL
> -DPERL_EXTERNAL_GLOB opmini.c
> > @c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname
> -qxplink -qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS
> -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC
> -D_POSIX_SOURCE=1 -D_OPEN_SYS_FILE_EXT=1 -O -DPERL_IS_MINIPERL
> -DPERL_EXTERNAL_GLOB opmini.c
> > echo @`sh cflags "optimize='-O'" perlmini.o` -DPERL_IS_MINIPERL
> -DPERL_EXTERNAL_GLOB perlmini.c@c99 -c -DPERL_CORE
> -qlanglvl=extended:extc89:extc99 -qlongname -qxplink -qdll -qfloat=ieee
> -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS
> -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC -D_POSIX_SOURCE=1
> -D_OPEN_SYS_FILE_EXT=1 -O -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
> ...
> > c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname
> -qxplink -qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS
> -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC
> -D_POSIX_SOURCE=1 -D_OPEN_SYS_FILE_EXT=1 -O sv.c
> ...
>
> > c99 -qxplink -qdll -o miniperl 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.o
> doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o
> perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o
> caretx.o dquote.o time64.o miniperlmain.o -lm -lc
>
> > ./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c
> 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1
> > 'Invalid version object at
> /u/pdkuzm/ussport/perl/perl-5.24.0_O/dist/Exporter/lib/Exporter.pm line 3.
> > Compilation failed in require.
> > BEGIN failed--compilation aborted.
> > Failed to build miniperl. Please run make minitest
> > makefile:378: recipe for target 'lib/buildcustomize.pl' failed
> > make: *** [lib/buildcustomize.pl] Error 1
>
>
> Running a small script
>
> --- test.pl --------
> require 5.006;
> printf "test\n"
> -----------------------
>
> (02:58) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> ./miniperl test.pl
> Invalid version object at test.pl line 2.
>
> BUT
>
> If compiling only one file (sv.c) without option -O All corectlly
>
> > c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname
> -qxplink -qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS
> -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC
> -D_POSIX_SOURCE=1 -D_OPEN_SYS_FILE_EXT=1 sv.c
> > c99 -qxplink -qdll -o miniperl 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.o
> doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o
> perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o
> caretx.o dquote.o time64.o miniperlmain.o -lm -lc
>
> > (03:01) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> ./miniperl
> test.pl
> > test
>
> Error message (Invalid version object) in function Perl_vcmp()
>
> And
>
> Adding debugging information (-DDEBUGGING) is all correct ,
>
>
> There are ideas for debugging !?
>

This can be from

1) a bug in the new compiler, though my experience is that this is unlikely.

2) an alignment issue

3) use of some construct which has undefined behavior, but the earlier
compiler gave the expected behavior.

4) probably lots of other things.

If there exists some tool that looks for out-of-bounds kinds of things,
I'd start with that. valgrind or purify or various other ones are
available on some systems.

Getting a stack trace would be helpful. Opening a file in C and
writing the invalid version object out to it might be helpful.
0 new messages