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.

last modified by admin on 2009/10/26 12:11
Collectives
Project


© Sun Microsystems Inc. 2009
XWiki Enterprise 1.8.2.19075 - Documentation
Terms Of Use | Privacy | Trademarks | Copyright Policy | Site Guidelines | Site map | Help
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.