Modern GCC on HP-UX 10.20

LarBob

Administrator
Feb 8, 2019
51
27
18
So, HP-UX is still pretty well supported by GCC. I've successfully compiled 11.2 on HP-UX 11i v2 for PA-RISC, and have gotten pretty far on 11i v3 on IA64 as well, but run into some issues (see bug 61577). In a bout of masochism, I decided to see how far I could get with GCC on HP-UX 10.20 on a C110 with 128 MB of RAM as it seems no one else has compiled modern versions on the platform. So far, my path has roughly been GCC 2.95.3 C, binutils 2.19.1 (both built with HP cc) -> GCC 2.95.3 C -> GCC 3.4.6 C -> GMP 6.1.0, MPFR 3.16, MPC 1.0.3 (all tests passed on each) -> GCC 4.3.6 C -> GCC 4.7.4 C, C++ -> GCC 9.4.0 C, C++. Also, you want to have GNU versions of awk, sed, etc. in your PATH. Make sure you have a modernish tar to unpack newer GCC versions as well. I'm using gawk 3.1.8, gsed 4.2.2, gtar 1.26, and ggrep 2.5.4.

You have to build 4.3.x before building 4.7.4 due to (as far as I can tell) this bug being fixed - I believe it's the latest that can be built without running into the issue.

All of my configure lines are here.

Code:
util % uname -a
HP-UX alouette B.10.20 U 9000/777 2014502315 unlimited-user license
util % gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/util/toolchain/gcc-9.4.0/libexec/gcc/hppa1.1-hp-hpux10.20/9.4.0/lto-wrapper
Target: hppa1.1-hp-hpux10.20
Configured with: ../../sources/gcc-9.4.0/configure --prefix=/usr/util/toolchain/gcc-9.4.0 --disable-nls --disable-libgomp --enable-languages=c,c++ --with-gmp=/usr/util/toolchain/gmp-6.1.0 --with-mpfr=/usr/util/toolchain/mpfr-3.1.6 --with-mpc=/usr/util/toolchain/mpc-1.0.3 --without-gnu-ld --with-gnu-as --with-as=/usr/util/toolchain/binutils-2.19.1/bin/as
Thread model: single
gcc version 9.4.0 (GCC)
Check that out!

For binutils 2.19.1, I used the attached patches from thewrittenword. These I know were necessary, at least to get HP cc to cooperate.

When building 2.95.3 with HP ANSI C, you'll run into this weird error at some point:
Code:
cc: "../gcc/function.c", line 6930: error 1000: Unexpected symbol: "e".
cc: "../gcc/function.c", line 6930: error 1004: Unexpected end of line.
The workaround for this is to just remove the two spaces at the beginning of the line.

I'm hoping to work my way up to 11.2.0, we'll see how this goes. I'm guessing the low amount of memory this machine has may be the killer here and I'll have to go to QEMU, but we'll see. I'll edit this post with updates.

In 11.2, libcody won't build successfully out of the box. You can edit line 12 of libcody/cody.hh to something like:

Code:
#if (defined (__unix__) || defined (__MACH__)) && !defined (__hpux)
so libcody's networking support is not built. 10.20 doesn't have a bunch of things defined that it wants and I decided it'd be easiest to just disable it.
 

Attachments

Last edited:

Elf

Storybook / Retired, ex-staff
Feb 4, 2019
792
252
63
Mountain West (US)
I'll watch this with interest. All I have these days is one of the later C-series Visualize workstations, but I used to have a HP Apollo, maybe a 715/50 (?) running 10.20 that I did a lot of homework with in high school. One of the big holdups with it was I never had a working compiler. If I ever come across another one I think I'd like to get it going again...
 
  • Like
Reactions: LarBob

LarBob

Administrator
Feb 8, 2019
51
27
18
I'll watch this with interest. All I have these days is one of the later C-series Visualize workstations, but I used to have a HP Apollo, maybe a 715/50 (?) running 10.20 that I did a lot of homework with in high school. One of the big holdups with it was I never had a working compiler. If I ever come across another one I think I'd like to get it going again...
Sweet; I'm thinking of eventually trying to pick up a J5000 or something similar which can run 10.20 and is a lot more powerful than this thing. VUE is really nice in my opinion. Recently unrestricted application CDs have been dumped with the latest versions of HP aCC, CC, and cc as well so that's nice.
 
  • Like
Reactions: Elf

LarBob

Administrator
Feb 8, 2019
51
27
18
Here are all of my configure lines:

First GCC 2.95.3
Code:
../../sources/gcc-2.95.3-patched/configure --prefix=/usr/util/toolchain/gcc-2.95.3 --disable-nls --enable-languages=c --without-gnu-as --without-gnu-ld
Binutils 2.19.1
Code:
../../sources/binutils-2.19.1-patched/configure MAKEINFO=/bin/true CC=cc CFLAGS="-Ae -Wp,-H32768 +O2 +Onofltacc +ESlit +DAportable +Oentrysched +Odataprefetch +Onolimit" --target=hppa1.1-hp-hpux10.20 --build=hppa1.1-hp-hpux10.20 --disable-shared --disable-dependency-tracking --disable-werror --disable-nls --prefix=/usr/util/toolchain/binutils-2.19.1
Second GCC 2.95.3 (with binutils)
Code:
../../sources/gcc-2.95.3-patched/configure --prefix=/usr/util/toolchain/gcc-2.95.3 --disable-nls --enable-languages=c --without-gnu-ld --with-gnu-as --with-as=/usr/util/toolchain/binutils-2.19.1/bin/as
GCC 3.4.6
Code:
../../sources/gcc-3.4.6/configure --prefix=/usr/util/toolchain/gcc-3.4.6 --disable-nls --without-gnu-ld --with-gnu-as --with-as=/usr/util/toolchain/binutils-2.19.1/bin/as --enable-languages=c
GCC 4.3.6
Code:
../../sources/gcc-4.3.6/configure --prefix=/usr/util/toolchain/gcc-4.3.6 --disable-nls --without-gnu-ld --with-gnu-as --with-as=/usr/util/toolchain/binutils-2.19.1/bin/as --with-gmp=/usr/util/toolchain/gmp-6.1.0 --with-mpfr=/usr/util/toolchain/mpfr-3.1.6 --with-mpc=/usr/util/toolchain/mpc-1.0.3 --enable-languages=c
GCC 4.7.4
Code:
../../sources/gcc-4.7.4/configure --disable-nls --with-gmp=/usr/util/toolchain/gmp-6.1.0 --with-mpfr=/usr/util/toolchain/mpfr-3.1.6 --with-mpc=/usr/util/toolchain/mpc-1.0.3 --without-gnu-ld --with-gnu-as --with-as=/usr/util/toolchain/binutils-2.19.1/bin/as --enable-languages=c,c++ --prefix=/usr/util/toolchain/gcc-4.7.4
GCC 9.4.0
Code:
../../sources/gcc-9.4.0/configure --prefix=/usr/util/toolchain/gcc-9.4.0 --disable-nls --disable-libgomp --enable-languages=c,c++ --with-gmp=/usr/util/toolchain/gmp-6.1.0 --with-mpfr=/usr/util/toolchain/mpfr-3.1.6 --with-mpc=/usr/util/toolchain/mpc-1.0.3 --without-gnu-ld --with-gnu-as --with-as=/usr/util/toolchain/binutils-2.19.1/bin/as
 
  • Like
Reactions: TruHobbyist and Elf

wvalcke

New member
Nov 5, 2023
1
0
1
It seems like a dream to have a compiler 9.4.0 on the HPUX 10.20.
Does this really mean you have a full C++11 compiler on HPUX 10.20?
Could it be used to compile cmake 3.24 for example ? (it needs a c++11 compiler)
Is it possible to elaborate a bit how the tools like gawk 3.1.8, gsed 4.2.2, gtar 1.26, and ggrep 2.5.4 were installed ?
 

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu