I started this thread last week when I reported the following errors (see below) when compiling gcc-2.52.2-gpc-19991030 on HP-UX 10.20.
There had been a series of discussions on how to compile GCC (without GPC) on HP. I try to summarize the issues here. 1. you need GBU binutils to get the assemler (as); HP’s as seemed not working well in building GCC 2. GNU linker (ld), which is a part from GNU binutuils, could not be built. A poster (in comp.sys.hp.hpux) commented on building GNU ld on HP below. “You can't -- it's not supported. Reason: HP's odd binary format.” 3. Now even if you have GNU “as” and HP’s “as” on your HP box, and you have GNU “as” before HP “as” in your $PATH, GCC compilation cannot be guaranteed to use GNU “as”. One trick a poster (in gpc.gnu.de) had suggested is to soft-link GNU “as” to GCC’s build directory. This same trick was also suggested by another poster in in comp.sys.hp.hpux. 4. HP’s sed was buggy in that it put time stamps onto some files, making the build to complain. The resolution was two fold : get a patch from HP to patch HP’s sed, or get GNU sed. 5. GNU autoconf may be necessary; although I did hack a Makefile to get rid of the “autoheader not found” error without having GNU autoconf installed. But lately I just install GNU autoconf to get rid of the trouble. 6. A script suggested by a poster (in comp.sys.hp.hpux) help in the building of GCC-2.95.2. I modified it a bit to add comment and add log-files. See the scripted attached at the end of this message.
I have succeeded in build GCC-2.95.2 (without GPC) using this script (and the pre-requsites : autoconf, gnu sed, gnu as). Yet I got the same errors (attached at the end) using the same script for GCC-2.95.2-plus-GPC-19991030. So, it seemed to be a GPC bug when comparing the two builds (GCC built OK; GCC-GPC built failed).
I hope someone could reproduce the problem on their HP-UX, just to rule out error due to my inexperience on HP-UX.
Thanks a lot for your attention. (two attachments below)
-- A) build-gcc script started here – #!/bin/sh # building gcc-2.95.2 on HP-UX build_root=/opt/OV/tmp cd $build_root
# gunzip -qc gcc-2.95.2.tar.gz | tar xvf - # assume $build_root/gcc-2.95.2 contains source for gcc (and gpc)
mkdir gcc-2.95.2-hpux-objs # $build_root/gcc-2.95.2-hpux-objs as a separate dir to hold the objects cd gcc-2.95.2-hpux-objs
touch config.log1 # $build_root/gcc-2.95.2-hpux-objs/config.log1 as log-file to configure ../gcc-2.95.2/configure --enable-shared --with-gnu-as --without-gnu-ld --enable-cpp --prefix=/opt/GCC2952 >> config.log1 2>&1
cd gcc ln -s /opt/binutils/bin/as as # $build_root/gcc-2.95.2-hpux-objs/gcc/as now points to /opt/binutils/bin/as cd ..
touch make.log1 # $build_root/gcc-2.95.2-hpux-objs/make.log1 as log-file to make echo make bootstrap started at `date` >> make.log1 make bootstrap >> make.log1 2>&1 echo make bootstrap started at `date` >> make.log1 -- build_gcc script end --
-- B) error messages start here -- tail -20 make.log1 ../.././xgpc -B../.././ -c -I. -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -O2 -g -O2 -DRTS_RELEASE_STRING="'__GPC_RTS_VERSION_`cat /opt/OV/tmp/gcc-2.95.2/gcc/p/rts/rts_release`__'" -DBSD_RTS=0 `if [ x@with_shared@ = xyes ] ; then echo -fPIC; fi` --unit-path=/opt/OV/tmp/gcc-2.95.2/gcc/p/rts --automake /opt/OV/tmp/gcc-2.95.2/gcc/p/rts/heap.pas ../.././xgpc -B../.././ -c -I. -W -Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -O2 -g -O2 -DRTS_RELEASE_STRING="'__GPC_RTS_VERSION_`cat /opt/OV/tmp/gcc-2.95.2/gcc/p/rts/rts_release`__'" -DBSD_RTS=0 `if [ x@with_shared@ = xyes ] ; then echo -fPIC; fi` --unit-path=/opt/OV/tmp/gcc-2.95.2/gcc/p/rts --automake /opt/OV/tmp/gcc-2.95.2/gcc/p/rts/files.pas /opt/OV/tmp/gcc-2.95.2/gcc/p/rts/string2.pas: In function `Getenv': /opt/OV/tmp/gcc-2.95.2/gcc/p/rts/string2.pas:193: internal error--unrecognizable insn: (insn 15 14 17 (set (zero_extract:SI (reg:SI 97) (const_int 32 [0x20]) (const_int 0 [0x0])) (reg:SI 98)) -1 (insn_list 12 (insn_list 14 (nil))) (expr_list:REG_DEAD (reg:SI 98) (nil))) gpc1: ../.././xgpc exited with status 1 /opt/OV/tmp/gcc-2.95.2/gcc/p/rts/files.pas:30: module/unit `string2' could not be compiled make[3]: *** [files.o] Error 1 make[3]: Leaving directory `/opt/OV/tmp/gcc-2.95.2-hpux-objs/gcc/p/rts' make[2]: *** [pascal.rts] Error 2 make[2]: Leaving directory `/opt/OV/tmp/gcc-2.95.2-hpux-objs/gcc' make[1]: *** [bootstrap] Error 2 make[1]: Leaving directory `/opt/OV/tmp/gcc-2.95.2-hpux-objs/gcc' make: *** [bootstrap] Error 2 - error message end here –