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.
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:
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:
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.
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: