script You currently have JavaScript disabled. This site requires JavaScript to work properly.
For more details on how this site uses JavaScript see the JavaScript page.
 
Building GCC 4.7.4 for Tru64 UNIX 5.1B - zxnet

Menu:

Digital UNIX

Building GCC 4.7.4 for Tru64 UNIX 5.1B

These are a few quick notes on building the final release of GCC for the final release of Tru64 UNIX (5.1B) based on this page. It was done across three days in November 2023 with it taking around 40 hours all up on an AlphaServer 800 5/500 (500Mhz EV56) with 512MB RAM. The version of Tru64 was 5.1B-6 with the Developers ToolKit installed. This isn't the only way to build GCC 4.7.4, or even the best way, but it worked for me. Your mileage may vary.

In order to build GCC 4.7.4 you'll need:

If you don't have enough swap you can put another disk in the machine and partition it with the Disk utility under Application Manager\System_Admin\Configuration, then add the created swap partition to /etc/sysconfigtab:

	vm:
		swapdevice = /dev/disk/dsk0b,/dev/disk/dsk1a
				

Once the swap partition is added to sysconfigtab you can activate it with swapon -a (no need for a reboot).

You'll also probably need to adjust the vm_swap_eager, per_proc_stack_size and per_proc_data_size settings in /etc/sysconfigtab. The following values worked for me:

	vm:
		swapdevice = /dev/disk/dsk0b,/dev/disk/dsk1a
		vm_swap_eager = 0
	proc:
		per_proc_stack_size = 33554432
		per_proc_data_size = 801326592

You'll need to reboot for these changes to sysconfigtab to take effect.

Download source code

Building GCC 4.7.4 means building all of the following - download it all and get it on to the Tru64 box. If you don't have gzip or bzip2 there you might want to decompress them on a linux box before sending them over:

Newer versions may work too, but these versions are known to work.

Build prerequisites

These will all be built using Compaq C and installed to /opt/gcc47. Were ever you're building things, all of the packages should be decompressed and in that location ready to be extracted when required. Don't extract the GCC archives using Tru64 tar - they need GNU tar which we'll build.

Build libiconv:

	# tar -xvf libiconv-1.8.tar
	# cd libiconv-1.8
	# env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure --prefix=/opt/gcc47
	# make
	# make install
	# cd ..

Build gmp:

	# tar -xvf gmp-5.0.5.tar
	# cd gmp-5.0.5
	# env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure --prefix=/opt/gcc47
	# make
	# make install
	# cd ..

Build mpfr:

	# tar -xvf mpfr-2.4.2.tar
	# cd mpfr-2.4.2
	# env LD_LIBRARY_PATH=/opt/gcc47/lib CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure --prefix=/opt/gcc47 --with-gmp=/opt/gcc47
	# make
	# make install
	# cd ..

Build mpc:

	# tar -xvf mpc-0.8.2.tar
	# cd mpc-0.8.2
	# env LD_LIBRARY_PATH=/opt/gcc47/lib CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure --prefix=/opt/gcc47 --with-gmp=/opt/gcc47 --with-mpfr=/opt/gcc47
	# make
	# make install
	# cd ..

Build GNU make:

	# tar -xvf make-3.80.tar
	# cd make-3.80
	# env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure --prefix=/opt/gcc47
	# make
	# make install
	# cd ..

Build Gawk:

	# tar -xvf gawk-3.0.1.tar
	# cd gawk-3.0.1
	# env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure --prefix=/opt/gcc47
	# make
	# make install 
	# cd ..

Build GNU tar:

	# tar -xvf tar-1.26.tar
	# cd tar-1.26
	# env CPPFLAGS=-I/usr/local/include LDFLAGS=-s FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/opt/gcc47
	# make
	# make install
	# cd ..

Build GCC 4.4.7

Compaq C can't build GCC 4.7.4, so we've got to build an earlier version of GCC first. We'll then use that earlier version, 4.4.7, to build the version we're actually after. Note that Tru64s tar isn't good enough here - you've got to use the previously built GNU Tar to extract the GCC distribution.

	# cp -R /opt/gcc47 /opt/gcc44
	# env PATH=/opt/gcc44/bin:$PATH tar -xvf gcc-4.4.7.tar
	# cd gcc-4.4.7
	# env LD_LIBRARY_PATH=/opt/gcc44/lib PATH=/opt/gcc44/bin:$PATH ./configure --prefix=/opt/gcc44 --enable-threads=posix --disable-nls --enable-languages=c,c++ --without-gnu-ld --with-ld=/usr/ccs/bin/ld --without-gnu-as --with-as=/usr/bin/as --disable-libssp --with-libiconv-prefix=/opt/gcc44 --with-gmp=/opt/gcc44 --with-mpfr=/opt/gcc44 --with-mpc=/opt/gcc44
	# env LD_LIBRARY_PATH=/opt/gcc44/lib PATH=/opt/gcc44/bin:$PATH make
	# env LD_LIBRARY_PATH=/opt/gcc44/lib PATH=/opt/gcc44/bin:$PATH make install
	# cd ..

This should leave you with a working GCC 4.4.7 in /opt/gcc44.

Build GCC 4.7.4

Build GCC 4.7.4 using the previously build GCC 4.4.7. Note that Tru64s tar isn't good enough here - you've got to use the previously built GNU Tar.

	# env PATH=/opt/gcc47/bin:$PATH tar -xvf gcc-4.7.4.tar
	# cd gcc-4.7.4
	# env LD_LIBRARY_PATH=/opt/gcc47/lib:/opt/gcc44/lib PATH=/opt/gcc47/bin:/opt/gcc44/bin:$PATH CC="gcc -Wa,-oldas" ./configure --prefix=/opt/gcc47 --enable-threads=posix --disable-nls --enable-languages=c,c++ --without-gnu-ld --with-ld=/usr/ccs/bin/ld --without-gnu-as --with-as=/usr/bin/as --disable-libssp --with-libiconv-prefix=/opt/gcc47 --with-gmp=/opt/gcc47 --with-mpfr=/opt/gcc47 --with-mpc=/opt/gcc47 --enable-obsolete
	# env LD_LIBRARY_PATH=/opt/gcc47/lib:/opt/gcc44/lib PATH=/opt/gcc47/bin:/opt/gcc44/bin:$PATH CC="gcc -Wa,-oldas" make
	# env LD_LIBRARY_PATH=/opt/gcc47/lib PATH=/opt/gcc47/bin:$PATH make install
	# cd ..

This should leave you with a working GCC 4.7.4 in /opt/gcc47. You can now get rid of the previously built GCC 4.4 in /opt/gcc44 if you need the space and don't think you'll ever need it again.

To use your newly built GCC 4.7, you'll need /opt/gcc47/bin on your PATH and /opt/gcc47/lib on your LD_LIBRARY_PATH:

	# env LD_LIBRARY_PATH=/opt/gcc47/lib PATH=/opt/gcc47/bin:$PATH gcc --version
	gcc (GCC) 4.7.4
	Copyright (C) 2012 Free Software Foundation, Inc.
	This is free software; see the source for copying conditions.  There is NO
	warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.