Difference between revisions of "Solaris Build Environment"
(Created page with "This page contains notes on the setup of a Solaris buildbot worker. Our current Solaris build hardware is a Sun Fire V240 running Solaris 10 U10. Solaris 10 includes a varie...") |
(No difference)
|
Revision as of 19:45, 11 November 2016
This page contains notes on the setup of a Solaris buildbot worker.
Our current Solaris build hardware is a Sun Fire V240 running Solaris 10 U10.
Solaris 10 includes a variety of free software tools in /usr/sfw, but not the full set of dependencies needed to checkout, build, and test the krb5 tree. Our chosen approach to building these additional dependencies is to use the NetBSD pkgsrc collection.
Building a newer gcc
/usr/sfw contains gcc 3.4.3, which is adequate for building most free software but has several problems for building new packages: it defaults to the gnu89 standards environment, which leads to build failures when including C99 Solaris headers such as <stdbool.h>. It also does not understand the -pthread or -print-multiarch options, which some pkgsrc packages rely on. Therefore, we begin by building gcc 5.4 into /usr/local, using the following steps:
1. Set up a shell with a path containing the needed system utilities:
/bin/bash export PATH=/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin
2. Create /usr/local/src:
mkdir /usr/local/src cd /usr/local/src
3. From ftp.gnu.org, fetch the latest versions of gmp, mpfr, and mpc, and fetch gcc 5.4.0. Untar them in /usr/local/src.
4. Build gmp, mpfr, and mcc as follows. Without "ABI=32" in the configure line, gmp chooses the 64-bit ABI over the default 32-bit ABI for performance reasons.
cd /usr/local/src/gmp-version ./configure LDFLAGS="-L/usr/local/lib -R/usr/local/lib" ABI=32 gmake && gmake install cd /usr/local/src/mpfr-``version`` ./configure LDFLAGS="-L/usr/local/lib -R/usr/local/lib" gmake && gmake install cd /usr/local/src/mcc-``version`` ./configure LDFLAGS="-L/usr/local/lib -R/usr/local/lib" gmake && gmake install
5. Build gcc as follows. The gcc build system does not appear to use LDFLAGS when building some of its internal programs which use dependencies, so configure options to give the install prefix for each dependency are required. This build takes many hours.
cd /usr/local/src/gcc-5.4.0 ./configure --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local LDFLAGS=-R/usr/local/lib gmake && gmake install