OpenSolaris

You are not signed in. Sign in or register.

Building with GCC

You will need the same tools and sources to build with GCC as you would use to build with Studio. The only requirements are:

  • You must have SUNWgcc* (gcc as found in /usr/sfw/bin) from build 22 or newer. Older compilers, including those previously distributed here, will not work.
  • ON sources from build 38 or newer

You will need to set some or all of the following environment variables (your nightly(1) env file is the best place for this):

  • __GNUC – should be set to the empty value
  • __GNUC64 – should be set to the empty value (the default in build 24 and newer is the value of ${__GNUC}).
  • GNU_ROOT – Set only if using a custom compiler (not recommended); ${GNU_ROOT}/bin/gcc should exist.
  • If you do not have Studio tools installed, you will need to override the definitions for LINT. You can do this by setting LINT to $(ONBLD_TOOLS)/bin/fake-lint. You will also have to use make rather than dmake if you build manually, and should not use nightly's 'd' option.

You should also include t in NIGHTLY_OPTIONS to pick up any required changes in the compiler wrapper cw.

Otherwise you should follow the usual build instructions included with the release notes for your build.

When building ON, you can just set the __GNUC variable in your environment (see Makefile.master) and try to build whatever you're interested in. Something like:

{root:reliant:2} bldenv -d on-fixes
Build type   is  DEBUG
RELEASE      is
VERSION is reliant:on-fixes:05-31-2005 RELEASE_DATE is
The top-level 'setup' target is available to build headers and tools. Using csh as shell. {root:reliant:1} cd $SRC/cmd/ls {root:reliant:2} (setenv __GNUC; dmake install)
/builds1/on-fixes/usr/src/cmd/ls/i386
/ws/onnv-tools/onbld/bin/i386/cw -_gcc -O  -xspace -Xa  -xildoff 
…

This works because we use the compiler wrapper (cw). Do NOT set $(CC), ever!

Note that __GNUC and __GNUC64 are described in the Developer's Reference Guide.