pkgsrc on Tru64 5.1B

So after we have a usable GCC for Tru64 we can move on to put it to some good use. I prefer  pkgsrc.

pkgsrc (package source) is a package management system for Unix-like operating systems. It was forked from the FreeBSD ports collection in 1997 as the primary package management system for NetBSD.

There is a nice guide already on https://wiki.netbsd.org/pkgsrc/how_to_use_pkgsrc_on_osf1/ which describes how to bootstrap pkgsrc via gcc or ccc.

You can even download the precompiled GCC 4.3.2 for OSF1 here http://ftp.netbsd.org/pub/pkgsrc/misc/tnn/  but if you want newer GCC you need to compile it yourself (I did not find any newer compiled packages)  https://astr0baby.wordpress.com/2017/04/25/compiling-gcc-4-4-7-on-tru64-5-1b/  GCC dropped support for Tru64 in 4.8  and in 4.7 you need to enable the –enable-legacy flag to build it.

Not surprisingly the 2016Q4 or the 2017Q1 pkgsrc have issues on TRU64 and GCC 4.4.7 and 4.3.2. The bootstrap compilation is broken and throws similar errors

# cd /pkgsrc/bootstrap
# env CC=/data/gcc-new/bin/gcc CFLAGS=-O2 ./bootstrap.sh
....<cut>.....
/data/gcc432/bin/gcc -c -g -O2 -I. -I/pkgsrc/pkgsrc/bootstrap/work/bmake -DHAVE_CONFIG_H -I/pkgsrc/pkgsrc/bootstrap/work/bmake/missing -DMAKE_NATIVE -DUSE_META -DBMAKE_PATH_MAX=1023 -DMAKE_VERSION="20150505" -DMACHINE="alpha" -DPKGSRC_MACHINE_ARCH="" -D_PATH_DEFSYSPATH="/pkgsrc/pkgsrc/bootstrap/work/share/mk" -o main.o /pkgsrc/pkgsrc/bootstrap/work/bmake/main.c
/pkgsrc/pkgsrc/bootstrap/work/bmake/main.c: In function 'Error':
/pkgsrc/pkgsrc/bootstrap/work/bmake/main.c:1677: error: incompatible type for argument 1 of '__builtin_va_start'
/pkgsrc/pkgsrc/bootstrap/work/bmake/main.c:1677: error: 'va_start' used with too many arguments
/pkgsrc/pkgsrc/bootstrap/work/bmake/main.c: In function 'Fatal':
/pkgsrc/pkgsrc/bootstrap/work/bmake/main.c:1706: error: incompatible type for argument 1 of '__builtin_va_start'
/pkgsrc/pkgsrc/bootstrap/work/bmake/main.c:1706: error: 'va_start' used with too many arguments
/pkgsrc/pkgsrc/bootstrap/work/bmake/main.c: In function 'Punt':
/pkgsrc/pkgsrc/bootstrap/work/bmake/main.c:1741: error: incompatible type for argument 1 of '__builtin_va_start'
/pkgsrc/pkgsrc/bootstrap/work/bmake/main.c:1741: error: 'va_start' used with too many arguments
===> exited with status 1
aborted.

No luck with the native ccc compiler as well

# cd /pkgsrc/bootstrap
# env CC=/usr/bin/cc ./bootstrap
...<cut>.....
checking whether INTMAX_MAX is declared... no
checking whether INTMAX_MIN is declared... no
checking whether UINTMAX_MAX is declared... no
checking whether SSIZE_MAX is declared... yes
checking whether EFTYPE is declared... yes
checking whether EILSEQ is declared... yes
checking for wchar_t... yes
checking size of wchar_t... configure: error: in `/pkgsrc/pkgsrc/bootstrap/work/libarchive':
configure: error: cannot compute sizeof (wchar_t)
See `config.log' for more details
===> exited with status 77

29.04.2017 – update The above failures are probably related to libarchive  https://github.com/libarchive/libarchive/issues/728

So I was searching for some older pkgsrc tarball which would have a buildable bootstrap and came up with this archive:

https://asw.iastate.edu/pub/pkgsrc/current/

https://asw.iastate.edu/pub/pkgsrc/current/pkgsrc.tgz

Download the above pkgsrc current snapshot from 2014-05-18, extract it and run the bootstrap as follows. You might think that the packages will be obsolete from 2014 …but we are running an OS that is dead and unsupported anyway :)

# cd /pkgsrc/bootstrap
# env CC=/data/gcc-new/bin/gcc CXX=/data/gcc-new/bin/g++ CFLAGS=-O2 ./bootstrap 
.....<cut>.......

=> Registering installation for pkg_install-20130902nb1
===> running: /sbin/sh /pkgsrc/pkgsrc/bootstrap/work/bin/install-sh -d -o root -g system /usr/pkg/etc
===========================================================================
Please remember to add /usr/pkg/bin to your PATH environment variable
and /usr/pkg/man to your MANPATH environment variable, if necessary.

An example mk.conf file with the settings you provided to "bootstrap"
has been created for you. It can be found in:

/usr/pkg/etc/mk.conf

You can find extensive documentation of the NetBSD Packages Collection
in /pkgsrc/pkgsrc/doc/pkgsrc.txt.

Hopefully everything is now complete.
Thank you for using pkgsrc!

===========================================================================

===> bootstrap started: Thu Apr 27 01:45:46 CEST 2017
===> bootstrap ended: Thu Apr 27 03:47:58 CEST 2017

Add the /usr/pkg/bin to your path in your .cshrc

Also you might want to symlink libgcc_s.so.1 to /usr/lib and /usr/local/lib so you dont get the following error

 /sbin/loader: Fatal Error: Cannot map library libgcc_s.so.1

Once done you can build packages via these sets of  commands

# cd /pkgsrc/net/tnftp 
# env CC=/data/gcc-new/bin/gcc CXX=/data/gcc-new/bin/g++ CFLAGS=-O2 bmake install clean clean-depends
If you get errors during bmake process similar to this 
/usr/include/pthread.h:328:4: error: #error "Please compile the module including pthread.h with -pthread

Run the build command with CFLAGS=-pthread

# env CC=/data/gcc-new/bin/gcc CXX=/data/gcc-new/bin/g++ CFLAGS=-pthread bmake install clean clean-depends 

Of course on the alphavm_free the compilation speeds are something to consider and one should be armed with patience and determination.

But this is nothing compared to the compilation of pkgsrc packages on 133 MHz Hitachi SH3 processor with 32 MB of integrated RAM Jornada 690 I did back in 2006/2007

Advertisements
Gallery | This entry was posted in Uncategorized. Bookmark the permalink.

One Response to pkgsrc on Tru64 5.1B

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s