Re: building mozilla 1.8 on sun sparc

Nicolas Pioch <[email protected]>
Newsgroups gmane.comp.mozilla.devel.unix
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
bl8n8r wrote:
> I've also moved the ucb linker to _ld and symlinked the gnu-ld to
> /usr/ucb/ld (which is in my path before /usr/ccs/bin/ld) thinking that
> may have made the difference in the build , but am still getting
> strange errors.

Generic advices for Solaris Sparc, for *any* compilation w/ gcc:

never use gnu-ld or gas or GNU binutils -- even better, never install them!
They only cause trouble when you least expect it, while the native 
Sun-supplied tools work much better.

always use the native ld and as in /usr/ccs/bin

always have /usr/ccs/bin/ before in your $PATH

Here's my default path for instance on Solaris:
/usr/local/bin/usr/ccs/bin:/usr/bin:/bin:/usr/sbin:/sbin:\
/usr/5bin:/usr/ucb:/etc:/usr/dt/bin:/usr/openwin/bin

Always have both 32-bit and 64-bit Solaris packages/libraries installed, 
EVEN if your hardware doesn't support 64-bit, EVEN if you'll never run 
any 64-bit app, because otherwise recent GCC versions won't build! 
(error in linking, some shared libs missing!)

I used to produce GCC builds of Mozilla on Sparc -- I've given up since 
it's impossible to get Java to work (it requires a Sun Workshop/Forte 
build).

However, for histerical purposes, you'll find below the old README I 
used to maintain detailing how to build Mozilla on Solaris Sparc w/gcc.

Hope this helps,
Cheers,
-- N.


This build of Mozilla/1.4rc3 was produced
- with GCC 3.3 (and gmake 3.79.1)
- on a sparc-sun-solaris2.8 platform (sparcv9)
- 26 Jun 2003
- Build ID: 20030626

$Id: README,v 1.17 2003/06/26 13:10:09 pioch Exp pioch $
============================================
PREREQUISITES - IT WILL NOT WORK OTHERWISE !
============================================

This is a SOLARIS 8 (UltraSparc) build!
---------------------------------------
Solaris 8, AKA SunOS 5.8, AKA sparc-sun-solaris2.8
It will most certainly not run on previous Solaris versions.

Check the Mozilla Release Notes for the System Requirements:

   http://www.mozilla.org/releases/mozilla1.4rc3/#require
   http://www.mozilla.org/releases/mozilla1.4rc3/#reqs_solaris

indicates that Solaris 8 requires the installation at least patches
109147, 108434, and 108435 from http://sunsolve.sun.com/

It is probably a good idea to also install the SunSolve
"Recommended" patch cluster for your Operating System (and reboot).

However do NOT believe the paragraph stating:

   Requires GTK+ and glib libraries (libraries must be compiled with
   Sun Workshop/Forte. GTK+/glib compiled with gcc are incompatible
   with Mozilla binaries build with Sun Workshop/Forte, GTK+/glib
   libraries compiled with Sun Workshop/Forte are compatible to
   binaries compiled with both Sun Workshop and gcc. (Bug 136144, bug
   141415, bug 186534, bug 194127 and many others)

I have been able to use Forte-compiled binaries with my GCC libs...
The only incompatibility resides specifically with the
Sun Microsystems-supplied Forte build, which is specifically incompatible
with GCC libs (other Forte builds, such as Roland Mainz, work fine!)


This is a GCC build!
--------------------
I made this build with GCC 3.3, which produces C++ libraries in a format
that is GCC-only compatible (incompatible with Sun's Workshop/Forte 
compilers)

Hence, this build will only work on machines where all C++ dependant 
libraries
have also being built with GCC !

Fortunately, almost all developers are aware of the non-portability of C++
libraries, and that's why they provide C ABIs instead, such as plugins,
or common libraries such as GTK+ or GLIBC.

One major exception is Java. Because the java ABI (OJI) is C++,
you will only be able to use Java with this Mozilla build if you locate
a Java OJI plugin compiled with GCC 3.3x

This is NOT the case with the Sun-supplied Java plugin, which will NOT
work on this build. Someone has to volunteer to recompile the Java plugin
from the source code available on http://java.sun.com/.
I tried, and since it looks like an inextricable mess I gave up quickly...
Please let me know if someone managed to get this to work.

(I am told the current beta version of the next J2SE release from
Sun Microsystems includes a GCC 3.2x-compiled Java plugin already)

"Normal" plugin (such as Flash or any other) use the C-style plugin API
instead and should not encounter any issue, no matter which compiler and
version they have been built with.


1) You need bzip2 and GNU tar to extract the files (Solaris tar won't work)

Extraction of the archives mentionned below will require:
   - bzip2 (I use version 1.0.2), http://sources.redhat.com/bzip2/
   - GNU tar (I use version 1.13), ftp://ftp.gnu.org/gnu/tar/

Because the POSIX "tar" file format is limited to store path/file names
under 100 characters, vendors have implemented "extensions" to workaround
these limitations. GNU tar's extention, @LongLink, is not compatible
with Solaris native "tar" command, so you will need GNU TAR to extract
some of the files below properly. More details are available in the GNU tar
manual, http://www.gnu.org/manual/tar/html_node/tar_117.html

I encourage you to build and install these programs properly (from the
relevant source distributions) on your system.


2) This build uses the latest shared libraries of:

   gettext-0.12.1.tar.gz
         GNU gettext, ftp://ftp.gnu.org/pub/gnu/gettext/

   libiconv-1.9.1.tar.gz
         GNU libiconv, ftp://ftp.gnu.org/pub/gnu/libiconv/
         configured with --enable-extra-encodings
         Note that GNU gettext and libiconv depend on each other
         (check libiconv documentation), so if you install gettext first,
         then build libiconv, you must recompile and reinstall gettext 
after!

   jpegsrc.v6b
         IJG JPEG library, source code: http://www.ijg.org/files/

   zlib-1.1.4
         Zlib source code: http://www.gzip.org/zlib/

   libpng-1.2.5
         libPNG source code: http://www.libpng.org/pub/png/libpng.html

   libmng-1.0.5
         libMNG source code: http://www.libmng.com/downloadlibmng.html

All shared libraries above were installed in /usr/local/lib on my machine.

I encourage you to build and install these libraries properly (from the
relevant source distributions) on your system.



3) This build also uses the latest shared libraries of:

   glib-1.2.10
         Source code: ftp://ftp.gimp.org/pub/gtk/v1.2/
         installed under /usr/local/pack/glib-1.2.10 on my machine
         configured with:
           ./configure --prefix=/usr/local/pack/glib-1.2.10

   gtk+-1.2.10
         Source code: ftp://ftp.gimp.org/pub/gtk/v1.2/
         installed under /usr/local/pack/gtk+-1.2.10 on my machine
         configured with:
           PATH="/usr/local/pack/glib-1.2.10/bin:$PATH"
 
LD_LIBRARY_PATH="/usr/local/pack/glib-1.2.10/lib:$LD_LIBRARY_PATH"
           export PATH LD_LIBRARY_PATH
           ./configure --prefix=/usr/local/pack/gtk+-1.2.10

   libIDL-0.6.8
         Source code: ftp://ftp.mozilla.org/pub/mozilla/libraries/source/
         installed under /usr/local/pack/libIDL-0.6.8 on my machine

   freetype-2.1.4
         Source code: http://www.freetype.org/download.html#stable
               or http://sourceforge.net/project/showfiles.php?group_id=3157
         installed under /usr/local/pack/freetype-2.1.4 on my machine
         Note: I am not sure how this is useful at this point
         or how to configure it...
         cf http://bugzilla.mozilla.org/show_bug.cgi?id=126919

I also encourage you to build and install these libraries properly (from the
relevant source distributions) on your system.


4) Finally, this build requires runtime shared libraries from GCC 3.3,
more specifically:
   /usr/local/lib/libgcc_s.so.1
   /usr/local/lib/libstdc++.so.5

I also encourage you to build and install GCC 3.3 properly (from the
relevant source distributions) on your system.

Make sure libgcc_s.so.1 and libstdc++.so.5 are in your LD_LIBRARY_PATH,
either from /usr/local/lib, or adding /usr/local/pack/gcc-3.3/lib
to the LD_LIBRARY_PATH in the "mozilla" script below.

Source code: ftp://ftp.gnu.org/gnu/gcc/gcc-3.3/
GCC was configured and installed according to the instructions at
   http://gcc.gnu.org/install/
and the following commands:
   ../srcdir/configure --prefix=/usr/local/pack/gcc-3.3
   gmake bootstrap
   gmake install


===================
INSTALLATION NOTES:
===================

# Download mozilla-1.4rc3.sparc-sun-solaris2.8.tar.bz2
#   (store in /tmp on your local system for example)

# Extract under /usr/local/pack/mozilla/

test -d /usr/local/pack/mozilla || mkdir -p /usr/local/pack/mozilla

cd /usr/local/pack/mozilla

bzcat /tmp/mozilla-1.4rc3.sparc-sun-solaris2.8.tar.bz2 | gtar -xvf -

# Rename directory according to version so that you can keep multiple
# copies concurrently for testing

mv -i mozilla 1.4rc3

You should get a file called
   /usr/local/pack/mozilla/1.4rc3/mozilla

You probably want to create a wrapper shell script, /usr/local/bin/mozilla,
that sets the environment variables correctly.

Here is my suggestion:

-------------------8<------------------- save as /usr/local/bin/mozilla
#!/bin/sh

BASEDIR="1.4rc3"

MOZILLA_FIVE_HOME="/usr/local/pack/mozilla/$BASEDIR"

LD_LIBRARY_PATH="/usr/local/pack/libIDL-0.6.8/lib:\
/usr/local/pack/glib-1.2.10/lib:\
/usr/local/pack/gtk+-1.2.10/lib:\
/usr/local/pack/freetype-2.1.4/lib:\
/usr/local/pack/gcc-3.3/lib:\
/usr/local/lib:$LD_LIBRARY_PATH"

export LD_LIBRARY_PATH MOZILLA_FIVE_HOME

exec "$MOZILLA_FIVE_HOME/mozilla" "$@"
-------------------8<------------------- then chmod 755 
/usr/local/bin/mozilla


After installing the files in this package you must run mozilla as the
user who installed the files (e.g. root if the files are owned by
root) once to create a few files, including

   components/compreg.dat
   components/xpti.dat
   chrome/chrome.rdf
   chrome/overlayinfo/

If you don't, mozilla will crash on startup.  This is documented
behavior that Mozilla has so far declined to fix; see
http://bugzilla.mozilla.org/show_bug.cgi?id=42184
for details.

For obvious security reasons, my suggestion is to chown recursively
the mozilla directory to some unprivileged user, run mozilla once as
this user, exit mozilla and chown back the mozilla directory to root
once the above files have been created and populated (yes, this is
annoying).

===========================
HOW THIS PACKAGE WAS BUILT:
===========================

To build this package, I used the following .mozconfig:

-------------------8<------------------- $HOME/.mozconfig
# Options for 'configure' (same as command-line options).
ac_add_options --with-pthreads
ac_add_options --with-system-jpeg=/usr/local
ac_add_options --with-system-zlib=/usr/local
ac_add_options --with-system-png=/usr/local
ac_add_options --with-system-mng=/usr/local
ac_add_options --enable-toolkit-gtk
ac_add_options --with-gtk-prefix=/usr/local/pack/gtk+-1.2.10
ac_add_options --with-glib-prefix=/usr/local/pack/glib-1.2.10
ac_add_options --with-libIDL-prefix=/usr/local/pack/libIDL-0.6.8
ac_add_options --enable-js-ultrasparc
ac_add_options --disable-debug
ac_add_options --enable-strip
ac_add_options --disable-tests
ac_add_options --enable-optimize
ac_add_options --enable-freetype2
ac_add_options --with-ft-prefix=/usr/local/pack/freetype-2.1.4
ac_add_options --with-freetype-prefix=/usr/local/pack/freetype-2.1.4
ac_add_options --enable-crypto
ac_add_options --enable-extensions
ac_add_options 
--with-default-mozilla-five-home=/usr/local/pack/mozilla/1.4rc3
ac_add_options --prefix=/usr/local/pack/mozilla/1.4rc3
-------------------8<------------------- $HOME/.mozconfig


Unlike what Noah writes below, I haven't changed anything in my
/etc/system (empty, default one) and Mozilla runs fine on an Ultra-10
running Solaris 8 in 64-bit mode. Your mileage may vary :-)





The Mozilla/1.4rc3 source distribution was pulled from the CVS 
repository and
built using:

-------------------8<-------------------
mkdir -p /train/tmp/mozilla && cd /train/tmp/mozilla

# Use one of the following methods to get the source code

# -----------------------------
# Method 1: (easiest, if source available)
# Download source code from ftp://ftp.mozilla.org/pub/mozilla/releases/
# look under version-number/src, grab mozilla-source-1.4rc3.tar.bz2
# Extract the source, use

bzcat /tmp/mozilla-source-1.4rc3.tar.bz2 | gtar -xvf -
cd mozilla

# End Method 1
# -----------------------------
# Method 2: pull from CVS (takes 1 to 3 hours depending on load)
export CVSROOT=":pserver:[email protected]:/cvsroot"

# Need only to do the "cvs login" once ever, to create ~/.cvspass
# (no password)

cvs login

cvs co -r MOZILLA_1_4_BRANCH mozilla/client.mk

cd mozilla

gmake -f client.mk checkout

# End Method 2
# -----------------------------
# Make sure you are in the "mozilla" subdirectory before proceeding!
# There should be a file called "client.mk" in the current directory

# Proceed with build

export MOZILLA_OFFICIAL=1

export BUILD_OFFICIAL=1

export LD_LIBRARY_PATH="/usr/local/pack/libIDL-0.6.8/lib:\
/usr/local/pack/glib-1.2.10/lib:\
/usr/local/pack/gtk+-1.2.10/lib:\
/usr/local/pack/freetype-2.1.4/lib:\
/usr/local/pack/gcc-3.3/lib:\
/usr/local/lib:$LD_LIBRARY_PATH"

export PATH="/usr/local/pack/libIDL-0.6.8/bin:\
/usr/local/pack/glib-1.2.10/bin:\
/usr/local/pack/gtk+-1.2.10/bin:\
/usr/local/pack/freetype-2.1.4/bin:\
/usr/local/pack/gcc-3.3/bin:\
/usr/local/bin:$PATH"

gmake -f client.mk build

cp ~/mozilla/README dist/bin/

cd xpinstall/packager

gmake

cd ../../..

mv -i mozilla/dist/mozilla-sparc-sun-solaris2.8.tar.gz .

ls -la mozilla-sparc-sun-solaris2.8.tar.gz

gunzip mozilla-sparc-sun-solaris2.8.tar.gz

mv -i mozilla-sparc-sun-solaris2.8.tar \
   mozilla-1.4rc3.sparc-sun-solaris2.8.tar

bzip2 -9k mozilla-1.4rc3.sparc-sun-solaris2.8.tar

ls -la mozilla-1.4rc3.sparc-sun-solaris2.8.tar*
sha1 mozilla-1.4rc3.sparc-sun-solaris2.8.tar.bz2
-------------------8<-------------------

For the build to succeed on Solaris, you must NOT have GNU binutils
installed/in your path, as the build system assumes the Solaris linker
interface and must use the ld, as, ar and ranlib binaries available in
/usr/ccs/bin !

For more details:
   http://bugzilla.mozilla.org/show_bug.cgi?id=181382
   http://bugzilla.mozilla.org/show_bug.cgi?id=177113

Before starting the build, check with one of the commands
      "whence -a ld" (zsh)
   or "type ld" (sh)
   or "which ld" (various shells)
to ensure the /usr/ccs/bin/ld native Solaris linker will be used.

Enjoy!
-- Nicolas

===============================================
COMPLETE LIST OF SHARED LIBRARIES DEPENDANCIES:
===============================================

This list was obtained with the following commands:

-------------------8<-------------------
export LD_LIBRARY_PATH="/usr/local/pack/libIDL-0.6.8/lib:\
/usr/local/pack/glib-1.2.10/lib:\
/usr/local/pack/gtk+-1.2.10/lib:\
/usr/local/pack/freetype-2.1.4/lib:\
/usr/local/pack/gcc-3.3/lib:\
/usr/local/lib:$LD_LIBRARY_PATH"

cd /train/tmp/mozilla/dist/bin
ldd mozilla-bin components/*.so | sort -u | grep '=' | grep -v 'not 
found' | \
      cut -f 3 -d " " | sort -u
-------------------8<-------------------

Output:

/usr/lib/libICE.so.6
/usr/lib/libSM.so.6
/usr/lib/libX11.so.4
/usr/lib/libXext.so.0
/usr/lib/libXt.so.4
/usr/lib/libaio.so.1
/usr/lib/libc.so.1
/usr/lib/libdl.so.1
/usr/lib/libm.so.1
/usr/lib/libmp.so.2
/usr/lib/libnsl.so.1
/usr/lib/libpthread.so.1
/usr/lib/librt.so.1
/usr/lib/libsocket.so.1
/usr/lib/libthread.so.1
/usr/local/lib/libiconv.so.2
/usr/local/lib/libintl.so.2
/usr/local/lib/libjpeg.so.62
/usr/local/lib/libmng.so.1
/usr/local/lib/libpng.so.3
/usr/local/lib/libz.so
/usr/local/pack/gcc-3.3/lib/libgcc_s.so.1
/usr/local/pack/gcc-3.3/lib/libstdc++.so.5
/usr/local/pack/glib-1.2.10/lib/libglib-1.2.so.0
/usr/local/pack/glib-1.2.10/lib/libgmodule-1.2.so.0
/usr/local/pack/gtk+-1.2.10/lib/libgdk-1.2.so.0
/usr/local/pack/gtk+-1.2.10/lib/libgtk-1.2.so.0
/usr/openwin/lib/libXp.so.1
/usr/openwin/lib/libdga.so.1


===============================================
ORIGINAL README REPRODUCED BELOW FOR REFERENCE:
===============================================

The above README was inspired from Noah Friedman's README of the Mozilla/1.1
Solaris build, which is included below as a reference for histerical 
reasons.

-------------------------------------------------------------------------
This build of mozilla 1.1 was produced on a sparc-sun-solaris2.7 
platformby Noah Friedman.

This build was made from the MOZILLA_1_1_RELEASE tagged sources in the CVS
repository.

Installation notes:

     * Executables are dynamically linked against Gtk.  You may need to set
       LD_LIBRARY_PATH to the directory where your Gtk 1.2 shared libraries
       are installed.  You can do this before starting mozilla or edit
       run-mozilla.sh.

     * After installing the files in this package you must run mozilla as
       the user who installed the files (e.g. root if the files are owned by
       root) once to create the file `components.reg'.  If you don't,
       mozilla will crash on startup.  This is documented behavior that
       Netscape has so far declined to fix; see
       http://bugzilla.mozilla.org/show_bug.cgi?id=49345 for details.

     * If you get a lot of warnings on startup like

           Gdk-WARNING **: shmat failed!

       then you may want to increase your shared memory segment sizes.
       On Solaris 7, you can add the following lines to /etc/system and
       reboot:

           * Set for libgtk shared memory usage
           set shmsys:shminfo_shmmax = 8388608
           set shmsys:shminfo_shmmni = 0x1000
           set shmsys:shminfo_shmseg = 0x100

       I've received reports that this isn't sufficient to quiet errors on
       Solaris 8.  Please let me know if you find settings which work.

The following tools/libraries were used for compilation:
     GCC 2.95.2
     GNU Make 3.78.1
     GTK 1.2.5

The following commands were issued to check out and build the distribution:

   $ cvs -d :pserver:[email protected]:/cvsroot co -r 
MOZILLA_1_1_
RELEASE mozilla/client.mk
   $ cd mozilla
   $ ed .mozconfig
   a
   ac_add_options --disable-tests
   ac_add_options --disable-debug
   ac_add_options --enable-optimize
   ac_add_options --disable-freetype2
   ac_add_options --enable-crypto
   ac_add_options --enable-extensions
   ac_add_options --enable-toolkit-gtk
   ac_add_options --with-gtk-prefix=/opt/lude
   ac_add_options --with-pthreads
   ac_add_options --without-system-jpeg
   ac_add_options --without-system-mng
   ac_add_options --without-system-nspr
   ac_add_options --without-system-png
   ac_add_options --without-system-zlib
   .
   w
   q
   $ export MOZILLA_OFFICIAL=1
   $ export BUILD_OFFICIAL=1
   $ make -f client.mk checkout
   $ make -f client.mk build
   $ cd xpinstall/packager
   $ make
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.