How to build Phoenix on Solaris

Here is a rudimentary set of instructions to get mozilla/phoenix built on Solaris 7 and 8 using gcc 2.95.x and GNU ld.

This should prove helpful when building on Solaris 2.6/7/9 as well.

If this looks like way too much pain (and trust me, it is), just download the pre-built Phoenix 0.5 package for Solaris 7 or for Solaris 8.

Before you start:

Before you start, you will need the following:

Rudimentary steps to building:

  1. mkdir mozilla-pain
  2. cd mozilla-pain

  3. Now you have a choice:
  4. By the seat of your pants (probably better code): Use a known good tarball (is known for sure to build under Solaris):
      Always make sure that you're using the absolute latest nightly tarball. Not doing so is asking for extra pain.
    • tar -zxvf mozilla-source.tar.gz

    • Pull the parts that are different for Phoenix:
    • cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot checkout mozilla/browser mozilla/toolkit
    tar -zxvf mozilla-known-good.tar.gz

  5. Create .mozconfig: [or use the UNIX Build Configurator (Warning: May change disk requirements.)]

  6. mk_add_options MOZ_PHOENIX=1
    ac_add_options --enable-crypto
    ac_add_options --disable-tests
    ac_add_options --disable-debug
    ac_add_options --disable-mailnews
    ac_add_options --disable-composer
    ac_add_options --enable-strip
    ac_add_options --enable-strip-libs
    ac_add_options --enable-optimize="-O2"
    

  7. cp .mozconfig mozilla/

  8. Yes! I am telling you to build in a different directory from the source:
  9. mkdir mozbuild
  10. cd mozbuild
  11. MOZ_PHOENIX=1 ../mozilla/configure
  12. gmake

  13. Optionally, if you want to pass it around to all your friends, make a nice compact tarball as follows:
  14. cd xpinstall/packager
  15. make MOZ_PKG_APPNAME=phoenix MOZILLA_BIN="\$(DIST)/bin/phoenix-bin"

  16. This will make a tarball in the mozbuild/dist directory.

Hah, only if it were that easy. Here is a list of problems that I ran into:


Problem 1:

Refuses to link or improperly parses the link line.

Fix:

Change path variable to put /usr/local/bin at the very end so that /usr/ccs/bin/ld is the ld that it finds.

This will also require you to symlink gmake to make in /usr/local/bin so that you don't accidentally run /usr/ccs/bin/make

After you do this, you will need to run configure again. i.e go back to step 9 in the instructions above.


Problem 2:

Build bombs out with a error similar to this:

file format not recognized: */gnu-ld-scripts/components-mapfile

Fix:

cd mozbuild/config
edit autoconf.mk

Change from:
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS = -Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile

To:
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS =


Problem 3:

Build bombs out with message:

File::Spec version 0.8 required--this is only version 0.6 at ../../mozilla/config/preprocessor.pl line 74.

Fix:

Install File::Spec >= 0.8

This is the way I like to do it:

  perl -MCPAN -e shell

  > install File::Spec

To make your life better however, I do recommend that you install a recent perl. 5.6 or newer. I'm using 5.8, now. Also, make sure that the version of perl that you are running is the one you think you are running. i.e. Make sure that its not trying to run /usr/bin/perl and you are upgrading /usr/local/bin/perl.

Here's a list of problems experienced by others:

Problem A1: (Solaris 7)
Contributed by Ben Stern

Build bombs out with the following error:

ld.so.1: /usr/ccs/bin/sparcv9/strip: fatal: libelf.so.1: version `SUNW_1.4' not found (required by file /usr/ccs/bin/sparcv9/strip)

This appears to be due to a Solaris 7 patch to ld gone awry.

Fix:

For it to work properly, you need to hide the broken Solaris "binutils" from the good ones.

cd /usr/ccs/bin/sparcv9
mkdir naughty
mv nm [a-mo-z]* naughty


Copyright ©1997 - 2009, Bulent Yilmaz