On Sat, Aug 12, 2006 at 02:53:47PM -0400, John David Anglin wrote:
> > In order to build gcc 4.1.1 on HP-UX 10.20 I had to install GNU awk
> > and also configure with --disable-threads. The vendor's awk did not
> > build the options.h file correctly; the exact symptom was duplicated
> > OPT_d and OPT_w symbols in the enum. Then, the build blew up when it
> > tried to use pthreads (which don't exist on HP-UX 10.20, or at least
> > not in a form that gcc expects).
>
> Bug reports should be filed for these two problems. Do you have
> PHCO_20721 and PHCO_26158 installed? Locale might the behavior
> of awk in generating options.h.
I have PHCO_20721 installed, but not PHCO_26158. And I just wasted
about a half hour of my life trying to *find* it. It seems that HP
has not only stopped writing patches for HP-UX 10.20 (which is fine,
understandable) but has also removed them all from their machines.
I haven't tried the Bit Torrent networks yet :-/
My locale is set to 'en_US.iso88591'.
Here's the exact sequence (without gawk available):
$ bzip2 -dc gcc-core-4.1.1.tar.bz2 | tar xvf -
$ bzip2 -dc gcc-g++-4.1.1.tar.bz2 | tar xvf -
$ mkdir gcc-build
$ cd gcc-build
$ CC=/net/appl/gcc-3.3/bin/gcc LANG=C ../gcc-4.1.1/configure
--prefix=/net/appl/gcc-4.1 --with-gnu-as --enable-languages=c,c++
$ make CFLAGS='-O' LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2
-fno-implicit-templates' bootstrap
[...]
/net/appl/gcc-3.3/bin/gcc -c -g -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING
-DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-format-attribute-DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild
-I../../gcc-4.1.1/gcc -I../../gcc-4.1.1/gcc/build
-I../../gcc-4.1.1/gcc/../include -I./../intl
-I../../gcc-4.1.1/gcc/../libcpp/include -o build/genmddeps.o
../../gcc-4.1.1/gcc/genmddeps.c
In file included from tm.h:5,
from ../../gcc-4.1.1/gcc/genmddeps.c:21:
options.h:318: error: redefinition of `OPT_d'
options.h:316: error: `OPT_d' previously defined here
options.h:797: error: redefinition of `OPT_w'
options.h:795: error: `OPT_w' previously defined here
make[2]: *** [build/genmddeps.o] Error 1
$ sed -n -e 316,318p -e 795,797p gcc/options.h
OPT_d, /* -d */
OPT_D, /* -D */
OPT_d, /* -d */
OPT_w, /* -w */
OPT_W, /* -W */
OPT_w, /* -w */
$ what /usr/bin/awk
/usr/bin/awk:
$Revision: 78.14.1.16 $
PATCH_10_20: awk.g.o awk.lx.o b.o main.o tran.o lib.o run.o parse.o
proctab.o hpux_rel.o 99/12/17
(Oops... looks like I forgot to set LANG=C on the make as well as the
configure. I don't want to go back and redo the bootstrap now.)
> Personally, I always use GNU tools (e.g., gawk, sed, make, texinfo)
> for my builds as I find this avoids a lot of problems.
Yes, I'm using GNU sed and GNU make already. The issues with HP-UX 10.20's
sed and GCC are well known, but this is the first time I've run into an
awk issue, so I figured it should be documented.
$ cd gcc
$ gawk -f ../../gcc-4.1.1/gcc/opt-gather.awk ../../gcc-4.1.1/gcc/c.opt
../../gcc-4.1.1/gcc/common.opt ../../gcc-4.1.1/gcc/config/pa/pa.opt
../../gcc-4.1.1/gcc/config/pa/pa-hpux.opt
../../gcc-4.1.1/gcc/config/pa/pa-hpux1010.opt > tmp-optionlist
$ /bin/sh ../../gcc-4.1.1/gcc/../move-if-change tmp-optionlist optionlist
$ gawk -f ../../gcc-4.1.1/gcc/opt-functions.awk -f
../../gcc-4.1.1/gcc/opth-gen.awk \
< optionlist > tmp-options.h
$ /bin/sh ../../gcc-4.1.1/gcc/../move-if-change tmp-options.h options.h
$ cd ..
$ make CFLAGS='-O' LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2
-fno-implicit-templates' bootstrap
[...now it gets past the awk problem...]
> Regarding the use of pthreads, that's strange. Without --disable-threads,
> GCC should use DCE threads on hpux10. GCC definitely knows about the
> threads available in HP-UX 10. See for example, gthr-dce.h.
I have GNU pth installed in /usr/local, and (according to gcc/config.log)
it's finding pthread.h. This is probably confusing it.
[...]
./xgcc -B./ -B/net/appl/gcc-4.1/hppa2.0-hp-hpux10.20/bin/ -isystem
/net/appl/gcc-4.1/hppa2.0-hp-hpux10.20/include -isystem
/net/appl/gcc-4.1/hppa2.0-hp-hpux10.20/sys-include
-L/usr/local/src/gcc-build/gcc/../ld -O2 -O2 -O -DIN_GCC-W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include -fPIC -D_T_HPUX10 -g -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -I. -I -I../../gcc-4.1.1/gcc -I../../gcc-4.1.1/gcc/
-I../../gcc-4.1.1/gcc/../include -I./../intl
-I../../gcc-4.1.1/gcc/../libcpp/include -threads -fexceptions -c
../../gcc-4.1.1/gcc/unwind-dw2.c -o libgcc/threads/unwind-dw2.o
In file included from ../../gcc-4.1.1/gcc/gthr.h:103,
from ../../gcc-4.1.1/gcc/unwind-dw2.c:42:
../../gcc-4.1.1/gcc/gthr-dce.h: In function