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]

Successful GCC 3.0.4 on hppa1.1-hp-hpux10.20


Hi FSF

I just wanted to report a (at last) successful build of GCC 3.0.4 on hppa1.1-hp-hpux10.20.
The machine was fairly unused, so there were not many tools or patches installed on it. 

The HP compiler (usr/bin/cc) is not that advanced since it is mainly available only to compile
kernels. I read somewhere that I should use an earlier release of GCC to compile 3.0.4.

This is the way I succeeded in installing 3.0.4:


INSTALLING DEPENDANT FILES

First I downloaded precompiled packages from http://hpux.connect.org.uk/hppd/hpux/alpha.html

- Binutils 2.11.2
- Autoconf 2.52
- Bison 1.34
- Libiconv 1.7
- Gawk 3.1.0
- Gnu M4 1.4
- Gcc 3.0.1 (to be able to use for compiling 3.0.4)

These packages were gunzipped, untared and then moved to their recommended locations
under /opt. The paths to the /bin-directories were also added to the $path.
The gcc-installation was verified using a very simple compile.


PREPARING GCC 3.0.4 FOR MAKE

I downloaded the uncompiled 'gcc-3.0.4.tar' package and untared it.
At the same directory level as the root of the untared package I created an
objdir (according to the gcc install instructions) and runned configure from there;

# cd tmp
# tar -xvf gcc-3.0.4.tar
# mkdir objdir
# cd objdir
# ../gcc-3.0.4/configure --disable-nls --with-gnu-as --disable-threads 


COMPILING

Many obstacles had to be solved during make (rerun of make), and
several involved dependencies of the Gnu software recommended above.

# make bootstrap	See errors/obstacles below
# su root
$ make install


GNU COMPILER OUTPUT

bisdn@bbseries>  /usr/local/bin/gcc -v
Reading specs from /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0.4/specs
Configured with: ../gcc-3.0.4/configure --disable-nls --with-gnu-as --disable-threads : (reconfigured) 
Thread model: single
gcc version 3.0.4


OBSTACLES (STOPS)


- AUTOCONF: M4 REQUIRED

At some state autoconf was called, and it missed Gnu M4 1.4 despite it was installed.
The reason was that the m4 in /usr/bin was prioritised. I renamed m4 to m4.old and
softlinked in gnu m4 from /opt/m4/bin there instead. That made the trick!


- UNSATISFIED SYMBOLS: BUILTIN_VA_START

At one point the make stopped due to linker (/usr/ccs/bin/ld) error; "unsatisfied symbols: builtin_va_start",
which seems to be due to the fact that HP uses built in stdarg.h/argvar.h in their compiler to resolve
certain problems. Make sure you fully installed the GNU 3.0.1 compiler with includes
(target dir /opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/3.0.1/include). That should handle the problem.
See also for instance http://docs.mikeycarter.com/EBooks/Vol_2/ch29.htm


- COMPILER MISSING OR NOT CONFIGURED

At one point the make stopped at this state:
"Checking whether we are using GNU C... .../objdir/gcc/xgcc ... no"
"Checking whether we are using GNU C++... .../objdir/gcc/xgcc... no"
"Compiler missing or not configured"
This was resolved this way:

# cd /tmp/objdir/gcc
# ln -s /opt/gcc/bin/gcc xgcc


- TIME.H:337: 'EXTERN' CAN ONLY BE SPECIFIED FOR OBJECTS...

Stop occured with this as last part of the error message:
/usr/include/sys/time.h:337: 'extern' can only be specified for objects and functions
This is what is said in the header file at line 336-338:

# ifndef _SYS_SIGEVENT_INCLUDED
	extern struct sigevent; 
# endif /* _SYS_SIGEVENT_INCLUDED */ 

Found solutions suggested in http://gcc.gnu.org/ml/gcc/2001-03/msg01076.html
and http://www.bitmechanic.com/mail-archives/mysql/Apr1998/0450.html; combined
them to this solution:

(This is just a fast remedy and not at all a good solution. Perhaps you should make
sure that the row never compiles, or redeclare it somehow here. Or make sure in some
way that gcc handles the struct as an object. This alter of time.h might in some way 
have affect on a future compile of a new kernel!!!). 

Make a backup of /usr/include/sys/time.h and then alter the code in it.


# ifndef _SYS_SIGEVENT_INCLUDED
# ifndef __CPLUSPLUS
	struct sigevent;
# else
	extern struct sigevent; 
# endif /* __CPLUSPLUS */
# endif /* _SYS_SIGEVENT_INCLUDED */


- SHELL=/BIN/SH: COMMAND NOT FOUND

This was the make output at one stop:
/usr/bin/csh ../../../gcc-3.0.4/gcc/fixinc/genfixes machname.h
SHELL=/bin/sh: Command not found.
export: Command not found.
Variable syntax.

The problem with this seems to be that the script genfixes never runs in 
an /bin/sh environment. The script starts with row '#!/bin/sh' but the shell 
executing the script, /usr/bin/csh, does not seem to handle that.

I used 'find . -exec grep -l ´genfixes´ {} \;' to allocate the calling script;
objdir/gcc/fixinc/Makefile
The SHELL variable is correctly defined in the Makefile, but somehow
replaced (?!) before the machname.h executes. 
The $(SHELL) was replaced by /bin/sh on the required lines...


- MISSING ].

Rigth after the objdir/gcc/fixinc/Makefile checks version of fixincl the
Makefile script seems to fail with message 'Missing ].' which seems
to be caused in an if-case where Makefile tests if file fixinc.sh exists.
Since the if-case syntax is dependant of environment I edited Makefile:

From:	@if [ -f ../fixinc.sh ] ; ...
To:	/bin/sh 'if [ -f ../fixinc.sh ] ; ... ; fi'


- AS: "/VAR/TMP... : Directive name not recognized: STABS

This is probably an error caused by that wrong assembler is called.
Solution: I renamed /usr/ccs/bin/as to as.old and softlinked Gnu as 
from /opt/binutils/bin there instead. That made the trick! 

But even better would have been to run configure with option 
--with-as=/opt/binutils/bin/as



/Tomas



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