Subject: Re: Runaway miniperl in attempt to build perl5-base pkg under SPARC64
To: None <martin@duskware.de>
From: Greg Earle <earle@isolar.DynDNS.ORG>
List: port-sparc
Date: 02/06/2001 06:12:01
>> the "miniperl" runs away with the CPU, and "ktrace" shows that it's doing
>> nothing but spinning its wheels in the compile.  Note the "TIME" field below:
> 
> All I can say is that I still can build Perl on sparc64-current.
> 
> That means: I'm using a different kernel and a different toolchain, while
> probably the pkgsrc changes to the Perl distribution didn't change.
> 
> At least one of the Perl patches especially works around some sparc64 
> toolchain bug, so...

I decided to try again with the -current pkgsrc version of "perl5-base",
including the sparc64 workaround patch, and I didn't get much further.

First problem: The top-level Makefile contains

CONFIGURE_ARGS+=	-sde -Dprefix=${PREFIX} -Doptimize="${CFLAGS}" \
			-Darchname=${MACHINE_ARCH}-${LOWER_OPSYS} \
			-Dcc=gcc -D usemymalloc=false

"configure" bitched about there being no space after the "-D", and demanded
that "-sde" be split out into separate arguments.  I had to change this to

CONFIGURE_ARGS+=	-s -d -e -D prefix=${PREFIX} -D optimize="${CFLAGS}" \
			-D archname=${MACHINE_ARCH}-${LOWER_OPSYS} \
			-D cc=gcc -D usemymalloc=false

to make it work.  (I don't understand how everyone isn't affected by this?!?)

Next problem: config.sh contains

	optimize='-g -msoft-quad-float -O2 -DGCC2952_SPARC64_WORKAROUND'

When built with "-g", the assembler gags:

gcc -DPERL_CORE -c -fno-strict-aliasing -I/usr/pkg/include -g -msoft-quad-float -O2 -DGCC2952_SPARC64_WORKAROUND miniperlmain.c
/var/tmp/cccyS2ja.s: Assembler messages:
/var/tmp/cccyS2ja.s:471: Fatal error: Can't extend frag 99. chars

If I remove "-g" from the config.sh line, it builds - up to and including
"miniperl", anyway; but then it croaks trying to use it:

        AutoSplitting perl library
./miniperl -Ilib -e 'use AutoSplit;  autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
Segmentation fault - core dumped
*** Error code 139

netbsd4me# gdb ./miniperl
GNU gdb 4.17
[...]
This GDB was configured as "sparc64--netbsd"...
(gdb) run -Ilib -e 'use AutoSplit;  autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
Starting program: /usr/pkgsrc-1.5/lang/perl5-base/work/perl-5.6.0/./miniperl -Ilib -e 'use AutoSplit;  autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm

Program received signal SIGSEGV, Segmentation fault.
0x1451e4 in Perl_safemalloc ()
    at /home5/src/src/lib/csu/sparc64/../common_elf/crtbegin.c:92
92      }
(gdb) list 85,92
85      static void
86      __ctors()
87      {
88      	void (**p)(void) = __CTOR_LIST__ + 1;
89      
90      	while (*p)
91      		(**p++)();
92      }

Anyone?  Anyone?  Bueller?

	- Greg