...
| Code Block | ||||
|---|---|---|---|---|
| ||||
sudo pkg install -v \ pkg:/data/docbook \ pkg:/developer/astdev \ pkg:/developer/build/make \ pkg:/developer/build/onbld \ pkg:/developer/illumos-gcc-3 \ pkg:/developer/gnu-binutils \ pkg:/developer/opensolaris/osnet \ pkg:/developer/java/jdk \ pkg:/developer/lexer/flex \ pkg:/developer/object-file \ pkg:/developer/parser/bison \ pkg:/developer/versioning/mercurial \ pkg:/library/glib2 \ pkg:/library/libxml2 \ pkg:/library/libxslt \ pkg:/library/nspr/header-nspr \ pkg:/library/perl-5/xml-parser \ pkg:/library/security/trousers \ pkg:/print/cups \ pkg:/print/filter/ghostscript \ pkg:/runtime/perl-510 \ pkg:/runtime/perl-510/extra \ pkg:/runtime/perl-510/module/sun-solaris \ pkg:/system/library/math/header-math \ pkg:/system/library/install \ pkg:/system/library/dbus \ pkg:/system/library/libdbus \ pkg:/system/library/libdbus-glib \ pkg:/system/library/mozilla-nss/header-nss \ pkg:/system/header \ pkg:/system/management/product-registry \ pkg:/system/management/snmp/net-snmp \ pkg:/text/gnu-gettext \ pkg:/library/python-2/python-extra-24 \ pkg:/web/server/apache-13 |
...
The source code was traditionally built using Sun's closed-source compiler suite, which was named Sun Studio at the time of the illumos fork. The specific versions of Studio required are no longer publicly available, so we have made it is possible to build illumos with GCC; this is the only option for "new" people in the project who do not have access to the distribution archives of required Sun Studio versions. You will still need some tools from Sun Studio even if you use GCC as your compilers, but those are available as packages in the legacy OpenSolaris repository.
...
It is possible to build illumos using GCC (the GNU Compiler Collection, specifically its C and C++ compilers), and you should generally prefer to do this unless you have access to the versions of Sun Studio described in the next section., though it is convenient to still see build results from Studio in RTIs
The primary version of GCC necessary for development and integration 4.4.4 (34.4.3 (csl4-sol210-3_4-20050802)) is already il-2) should have been installed on your system as part of the build dependencies.
It is now also possible to build with a specially patched version of GCC 4.4.4, see when you installed the prerequisites above. If for some reason that didn't happen (old build system, or the like) tarballs are available as described in the initial heads-up notice 2012-06-15 Illumos will now build with GCC 4.4.4 + patches for details on its installation and configuration of the build environment.
Unfortunately, Sun Studio dmake (Distributed Make) and lint are currently required even for GCC-only builds. We currently deliver Lint libraries built using the closed Sun Studio version of lint. We believe that The lint from the unpatched (but redistributable) version of Sun Studio 12.1 in the opensolaris.org repository can be used, regardless of its utility for actually checking the software.
...
If you wish to build with Sun Studio, you need specifically patched versions of both Studio 12 (used to compile) and 12.1 (used for lint) to get consistent results. If you do not have access to these versions, skip this section and use GCC.
illumos-gate has not yet been validated with newer versions of Oracle Solaris Studio (although there were reports of successful building with version 12.3), and using an unpatched older compiler produces noise and, we have reason to believe, slightly incorrect output. The patched compilers used to be available from Sun Microsystems, but weren't redistributabledoes not build correctly with Sun Studio versions released after 12.0. Reportedly using a newer version of the compiler will produce a system containing grave, data-corrupting bugs. Patched compilers were previously available from Sun Microsystems, however not licensed for redistribution. After a recent Oracle site reorganization, they the necessary compilers are no longer available.
If you have the patched versions of both Sun Studio 12 and 12.1, they should be installed in /opt/SUNWspro (Studio 12), and /opt/SUNWspro/sunstudio12.1 (Studio 12.1), respectively. Pay attention, the Studio 12.1 location is different from how it was in OpenSolaris, i.e. it's not /opt/sunstudio12.1.
...
You may use the Git or Mercurial source code management systems to retrieve the illumos source code. Both tools will be able to retrieve the same history. Ensure about 6 gigabytes of free space for the source and binaries combined.
...
Mercurial pulls a complete replica (clone) of the repository, including all history, from a remote source, and then updates a working copy of the files from this clone. The working copy is the files you may edit and compile. You may update the working copy from any versions of files in the repository history.
| Note |
|---|
When cloning an external source code repository, Mercurial starts by creating a new directory, and fails if one already exists and is not empty. The directory may be a mountpoint for an empty ZFS dataset. Mercurial creates a |
The following example creates a clone of the "Mercurial repository" ssh://anonhg@hg.illumos.org/illumos-gate containing the illumos source code under /code; this will create a sub-directory illumos-gate under that.
...
Updating the source with Mercurial
Mercurial pulls a complete replica (clone) of the repository from a remote source, and then updates your working copy of the files from this clone. The working copy is the files you may edit and compile. You may update the working copy from any versions of files in the repository history.
If you want to get latest version of illumos-gate merged with your private development code, you need to hg pull new changes into your repository clone and hg update the working copy. This can be done in one command as hg pull -u. If you have committed changes prior to updating, you may be wish to hg merge them with the new changes.
For more details see: http://mercurial.selenic.com/wiki/FAQ.
...
| Code Block |
|---|
export ONNV_BUILDNUM=152 |
to the illumos.sh script.
Building with GCC-4.4.4 (i.e. without Sun Studio)
If you are building with GCC 4.4.4 (i.e. you do NOT have Sun Studio with appropriate patches), you must append these lines to illumos.sh:
| Code Block |
|---|
# The following are added to build with GCC (no Sun Studio) export __GNUC="" export CW_NO_SHADOW=1 export ONLY_LINT_DEFS=-I${SPRO_ROOT}/sunstudio12.1/prod/include/lint # The following select the proper version of GCC GCC_ROOT=/opt/gcc/4.4.4; export GCC_ROOT CW_GCC_DIR=${GCC_ROOT}/bin; export CW_GCC_DIR |
Explanation of these settings:
__GNUC- Set this to "" (the empty string), andexportit. This causes GCC to be used as the main compiler. Studio takes its place as the "shadow compiler".CW_NO_SHADOW- Set this to 1 to prevent the shadow compiler from running (for instance, if you do not have Studio at all).
See 2012-06-15 Illumos will now build with GCC 4.4.4 + patches for details on configuration for building with GCC 4.4.4.
...
- ONLY_LINT_DEFS - This is needed so the
lintis able to find the propernote.hinclude file.
The last two lines make sure the patched version of GCC-4.4.4 is used (the default gcc version shipped with e.g. OpenIndiana, gcc-3.4.3, is not suitable for building illumos), as described here.
For the moment we still require that contributed changes build with Sun Studio as the compiler. We understand that the required version of Sun Studio is no longer publicly available and will accept contributions that were tested only with GCC. For the time being, GCC 3.4.3 is the primary compiler for GCC builds (i.e. your integrations should not break full builds with this compiler), but after a while
If you are trying to build with GCC 4.4.4 is likely to be promoted to this role.
Preparing build tools
A few tools have to be prepared before we can build the rest of illumos. To build them, you should run commands in a new shell which sets some environment variables:
...
and your build fails because of some invalid GCC warning options, try setting the variables GCC_ROOT and CW_GCC_DIR as shown above and described here.
Starting the build
You are now ready to start the illumos build.
...
- Advanced - non-debug install describes different
onuoptions for the different set of built packages. - Redistributing built packages and Installing built illumos packages into BEs on a remote host and non-onu updates describe how to install illumos using the package depot server over the network, perhaps on a machine different from your build host. This recipe bypasses the
onuscript automation and manipulates your boot environments withbeadmandpkgcommands directly.
Possible problems
GCC and debugging information
When building illumos with GCC, the CTF information in certain closed kernel modules is likely to become inconsistent with that of genunix (because the closed code is not being rebuilt).
If after booting a GCC-built kernel DTrace fails to work complaining about NFS-related types:
| Code Block |
|---|
mcs -d -n .SUNW_ctf /kernel/misc/klmmod
mcs -d -n .SUNW_ctf /kernel/misc/klmops
mcs -d -n .SUNW_ctf /kernel/misc/amd64/klmmod
mcs -d -n .SUNW_ctf /kernel/misc/amd64/klmops |
These commands should help, at the expense of making the closed lock manager even harder to debug. You will need to cause the modules to reload after doing this (e.g. by rebooting).
Localization bugs #167 and #168
...