This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: building gcc 4.1.1 on HP-UX 10.20


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 '__gthread_key_create':
../../gcc-4.1.1/gcc/gthr-dce.h:444: warning: implicit declaration of function 'pthread_keycreate'
../../gcc-4.1.1/gcc/gthr-dce.h: In function '__gthread_getspecific':
../../gcc-4.1.1/gcc/gthr-dce.h:458: error: too many arguments to function 'pthread_getspecific'
../../gcc-4.1.1/gcc/gthr-dce.h: In function '__gthread_mutex_init_function':
../../gcc-4.1.1/gcc/gthr-dce.h:474: error: 'pthread_mutexattr_default' undeclared (first use in this function)
../../gcc-4.1.1/gcc/gthr-dce.h:474: error: (Each undeclared identifier is reported only once
../../gcc-4.1.1/gcc/gthr-dce.h:474: error: for each function it appears in.)
../../gcc-4.1.1/gcc/gthr-dce.h: In function '__gthread_recursive_mutex_init_function':
../../gcc-4.1.1/gcc/gthr-dce.h:512: warning: implicit declaration of function 'pthread_mutexattr_create'
../../gcc-4.1.1/gcc/gthr-dce.h:514: warning: implicit declaration of function 'pthread_mutexattr_setkind_np'
../../gcc-4.1.1/gcc/gthr-dce.h:514: error: 'MUTEX_RECURSIVE_NP' undeclared (first use in this function)
../../gcc-4.1.1/gcc/gthr-dce.h:516: warning: passing argument 2 of 'pthread_mutex_init' makes pointer from integer without a cast
../../gcc-4.1.1/gcc/gthr-dce.h:518: warning: implicit declaration of function 'pthread_mutexattr_delete'
../../gcc-4.1.1/gcc/unwind-dw2.c: In function 'uw_init_context_1':
../../gcc-4.1.1/gcc/unwind-dw2.c:1259: error: 'pthread_once_init' undeclared (first use in this function)
make[3]: *** [libgcc/threads/unwind-dw2.o] Error 1

Looks like it found the pthread.h header in /usr/local/include but didn't
link with the libpthread.{a,la,sl*} in /usr/local/lib.

> GCC 4.2.0 will be the first release supporting libjava on PA-RISC HP-UX.
> Currently, this only works with the 32-bit HP-UX 11 port.  We don't yet
> have a 64-bit port of libffi.  It's needed to build libjava.  Also,
> boehm-gc and libjava need POSIX threads for full functionality, and
> the don't support DCE threads.  For this reason, the toplevel configure
> file disables building libjava on HP-UX 10.  These libraries will build
> without threads and it's possible that this will work under HP-UX 10,
> but I haven't had a chance to test this.

All right.  Thanks for the information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]