So I've got this environment where I carefully use an old version of my GNU utilities to build the new version: First, I rebuild all the stuff I need to make gcc, then I build the new gcc, then I rebuild everything using the new gcc, then I build everything else. (Refer to my thread about bootstrap and binutils for why.) Anyway, this works (mostly) great on SunOS and Linux, but crashes and burns on HP-UX (B.10.20). The error symptom occurs when "make" is rebuilding with the new gcc, but since the problem is an assembler syntax error, it's hard to pin the problem on make. A small hello-world program compiles correctly, though, so the compiler is demonstrably functional.
Anyway, the error I get is:
make[2]: Entering directory `/tmp/make.2a/glob' if gcc -DHAVE_CONFIG_H -I. -I/media/gnu/make-3.80/glob -I.. -g -O2 -MT glob.o -MD -MP -MF ".deps/glob.Tpo" \ -c -o glob.o `test -f '/media/gnu/make-3.80/glob/glob.c' || echo '/media/gnu/make-3.80/glob/'`/media/gnu/make-3.80/glob/glob.c; \ then mv ".deps/glob.Tpo" ".deps/glob.Po"; \ else rm -f ".deps/glob.Tpo"; exit 1; \ fi In file included from /media/gnu/make-3.80/glob/glob.c:203: /media/gnu/make-3.80/glob/glob.c: In function `glob': /media/gnu/make-3.80/glob/glob.c:197: warning: passing arg of `my_realloc' from incompatible pointer type In file included from /media/gnu/make-3.80/glob/glob.c:203: /media/gnu/make-3.80/glob/glob.c:197: warning: passing arg of `my_realloc' from incompatible pointer type In file included from /media/gnu/make-3.80/glob/glob.c:203: /media/gnu/make-3.80/glob/glob.c:197: warning: passing arg of `my_realloc' from incompatible pointer type In file included from /media/gnu/make-3.80/glob/glob.c:203: /media/gnu/make-3.80/glob/glob.c: In function `glob_in_dir': /media/gnu/make-3.80/glob/glob.c:197: warning: passing arg of `my_realloc' from incompatible pointer type /var/tmp//cc1asr4R.s: Assembler messages: /var/tmp//cc1asr4R.s:641: Error: bad expression /var/tmp//cc1asr4R.s:641: Warning: rest of line ignored; first ignored character is `g' /var/tmp//cc1asr4R.s:647: Error: bad expression /var/tmp//cc1asr4R.s:647: Warning: rest of line ignored; first ignored character is `g' /var/tmp//cc1asr4R.s:670: Error: bad expression /var/tmp//cc1asr4R.s:670: Warning: rest of line ignored; first ignored character is `g'
... and on like this for pages.
So, I delve into the mess, running GCC from the same environment manually (with the same effective command line, only I added -v):
++ gcc -DHAVE_CONFIG_H -I. -I/media/gnu/make-3.80/glob -I.. -g -O2 -MT glob.o -MD -MP -MF ".deps/glob.Tpo" -v -c -o glob.o /media/gnu/make-3.80/glob/glob.c
Reading specs from /tmp/GNU_temp/lib/gcc-lib/hppa2.0-hp-hpux10.20/3.3.1/specs
Configured with: /media/gnu/gcc-3.3.1/configure --prefix=/tmp/GNU_temp --enable-languages=c,c++ --disable-nls --with-gnu-as --with-as=/tmp/GNU_temp/bin/as --without-gnu-ld
Thread model: single
gcc version 3.3.1
/tmp/GNU_temp/lib/gcc-lib/hppa2.0-hp-hpux10.20/3.3.1/cc1 -quiet -v -I. -I/media/gnu/make-3.80/glob -I.. -MD glob.d -MF .deps/glob.Tpo -MP -MT glob.o -MQ glob.o -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 -DHAVE_CONFIG_H /media/gnu/make-3.80/glob/glob.c -quiet -dumpbase glob.c -auxbase-strip glob.o -g -O2 -version -o /var/tmp//cc4gwrhe.s
GNU C version 3.3.1 (hppa2.0-hp-hpux10.20)
compiled by GNU C version 3.0.4.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/tools/GNU/004/HP-UX_B.10.20/include"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/tmp/GNU_temp/hppa2.0-hp-hpux10.20/include"
ignoring duplicate directory "/tmp/GNU_temp/include"
#include "..." search starts here:
#include <...> search starts here:
.
/media/gnu/make-3.80/glob
..
/tmp/GNU_temp/include
/tmp/GNU_temp/lib/gcc-lib/hppa2.0-hp-hpux10.20/3.3.1/include
/usr/include
End of search list.
In file included from /media/gnu/make-3.80/glob/glob.c:203:
/media/gnu/make-3.80/glob/glob.c: In function `glob':
/media/gnu/make-3.80/glob/glob.c:197: warning: passing arg of `my_realloc' from incompatible pointer type
In file included from /media/gnu/make-3.80/glob/glob.c:203:
/media/gnu/make-3.80/glob/glob.c:197: warning: passing arg of `my_realloc' from incompatible pointer type
In file included from /media/gnu/make-3.80/glob/glob.c:203:
/media/gnu/make-3.80/glob/glob.c:197: warning: passing arg of `my_realloc' from incompatible pointer type
In file included from /media/gnu/make-3.80/glob/glob.c:203:
/media/gnu/make-3.80/glob/glob.c: In function `glob_in_dir':
/media/gnu/make-3.80/glob/glob.c:197: warning: passing arg of `my_realloc' from incompatible pointer type
/tmp/GNU_temp/bin/as --traditional-format -o glob.o /var/tmp//cc4gwrhe.s
/var/tmp//cc4gwrhe.s: Assembler messages:
/var/tmp//cc4gwrhe.s:641: Error: bad expression
/var/tmp//cc4gwrhe.s:641: Warning: rest of line ignored; first ignored character is `g'
Note that my previously compiled packages (make, binutils, etc, are installed in /tmp/GNU_temp).
If I compile to a .s file, the syntax around line 641 is
635 glob64 636 .PROC 637 .CALLINFO FRAME=320,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=18 638 .ENTRY 639 stw %r2,-20(%r30) 640 copy %r3,%r1 641 .stabn 68,0,375,L$M17-*glob64 642 L$M17: 643 L$BB0011 644 comiclr,= 0,%r23,%r0 645 comiclr,<> 0,%r26,%r19 646 ldi 1,%r19 647 .stabn 68,0,368,L$M18-*glob64 648 L$M18:
I don't even come remotely close to speaking the language of "as", but it seems that the issue revolves around the "*glob64", since that's the first 'g' on each of the offending lines.
One thing that I suppose could be an issue is that I'm compiling with --disable-nls. I haven't tried configuring without this, but that same configuration does work on every other platform (Sparc and Linux).
I've looked at the source, but I can't figure out what translates into the .stabn lines so that I can try and simplify this problem down. It does look like maybe the 375 and 368 are file line numbers, but I have no idea why they're being produced.
Help me Obi-Wan Kenobi! You're my only hope!!!
-- Mario