GNU Linux Sparc Porting

From Apache OpenOffice Wiki
Revision as of 12:45, 10 December 2005 by Sparcmoz (Talk | contribs)

Jump to: navigation, search

GNU Linux Sparc Porting

The objective is to maintain the complete upstream sources so that the GNU/Linux sparc platform can be packaged for example by debian, gentoo and others. Also to provide an upstream "benchmark" released version that can be used for confirming who owns any bugs.

For GNU/Linux sparc all building now is done with gcj. As gcj is developing rapidly it is preferred to use the latest version. The latest gcj version that can be used comes with gcc4.0.x pre-release which is updated approximately weekly.

It should be better to use gcc4.1 but see below.

Other projects that need more work:

- fix multimedia (sound is working but needs Java Media Framework with gij)

- qa with testtool

- very slow startup (depends on javaldx?)

The latest upstream release is on mirrors under pub/OpenOffice.org/contrib/linuxsparc

Building with GCC 4.1

There are 3 main issues listed below, and a few others yet...

i57855 Bad uses of getCppuType

Some patches for this isssue are in cws, for details see the dev@porting mail thread 
dev@porting

i58141 extra qualification on member

This affects many unrelated projects.

i58937 Build binfilter with gcc4.1

The entire product SRC680_m141 has been built on GNU/Linux Sparc using the patches mentioned plus a possible few extra patches will be attached to the issues soon when I have worked out which ones are not already in cws_src680_gcc41. No modules are excluded by the configure step which is:

./configure --enable-crashdump=STATIC --enable-symbols=SMALL --with-java=gij --with-jdk-home=/usr/local/4.1

Building SRC680_m145 with gcc 4.1

I hope I have described the following steps correctly, but let me know if there is any problem to reproduce this and I will fix it.

GCC 4.1 is built using gcc.gnu.org sources checked out from HEAD and installed in /usr/local/4.1:

jim@sun:~/build680$ /usr/local/4.1/bin/g++ --version
g++ (GCC) 4.1.0 20051026 (experimental)
Copyright (C) 2005 Free Software Foundation, Inc.

With so many patches from different places it is easy to get muddled so i like to make everything explicit, and visible:

(a) first checkout the sources for SRC680_m145

cvs -z4 co -r SRC680_m145 OpenOffice2

(b) then make patches for the 2 required cws from $SRC_ROOT (top directory)

jim@sun:~/build680$ cvs diff -u -r SRC680_m145 -r cws_src680_sb41 > sb41.patch
jim@sun:~/build680$ cvs diff -u -r SRC680_m145 -r cws_src680_gcc41 > gcc41.patch

(c) apply those patches but notice this method does not allow for new files, so there are 2 new files to add in cppu, using cvs update:

inc/cppu/unotype.hxx
qa/test_unotype.cxx

(d) I also apply some patches specifically for building GNU/Linux Sparc with my peculiar installations of gcj and ant in /usr/local which are explained at issue 50599

(e) For GNU/Linux Sparc at least it is also necessary to have the bridges patches from cws_src680_sb40 but those are still work-in-progress and I do not know the current status.

(f) I had a look and it seems all the required patches for issue 58141 are already in gcc41, but we shall soon find out if the build stops.

(g) To run dmake runtest in testtools/source/bridgetest/pyuno it was necessary to update PYTHONPATH and revert the makefile ( see issue 40091 ). This may be useful to remember later...

Building with gcj

This is mainly intended as a diary to remind myself what i am doing. Building with gcj is not fully supported "out of the box" and anyone seeking to build this way will need to figure out some things for themselves. Recent patches for building GNU Linux Sparc with gcj are at i50599 but these will not be committed as they are specific to my building environment.

i50599 Build GNU Linux Sparc with gcj

The following describes how I build with gcj. I believe the work to make this possible was mostly done by Caolan and Rene showed me how to get Ant working.

Step 1: get a version of gcc with suitable gcj. 

I think that gcc >= 4.0 is necessary, in my case I get the latest preview gcc4.0 sources by cvs and build gcc into /usr/local because gcj was for some time not working on debian/unstable. And it is easier to see what is happening without the various workarounds to provide commands such as java that do not really exist.

Step 2: set up the required commands for build tools

Note that the required compiler can be specified by setting environment variables CC and CXX before running configure, but the same is not possible for some related programs. The current state of code expects these commands to be available, normally in /usr/bin: java javadoc javac jar

But building gcc provides instead the corresponding commands: gij gjdoc gcj fastjar

Some distributions will arrange for the java etc commands to be available, but the method to provide these varies between distributions and over time. In my opion it will be better to let these be defined by the configuration step, but I am a long way from knowing how that should be done!

Currently it is possible to define the following for the configurator: JAVADOC=/usr/local/bin/gjdoc

Configuration --with-java=gij and --with-jdk-home=/usr/local takes care of gij and gcj in most cases. Patches are needed to workaround one case of hardcoding for each of java and jar.

Ant is more complicated, the basic idea is to set up the required command line and parameters to invoke Ant in solenv/inc/ant.mk depending on how Ant is installed, and is better explained by reviewing the patches here i50599 Build GNU Linux Sparc with gcj


Step 3: configure

In my case the configure commands may be like this:

$ export JAVADOC=/usr/local/bin/gjdoc

$ export CC="/usr/local/bin/gcc -m32"

$ export CXX="/usr/local/bin/g++ -m32"

$ ./configure --with-jdk-home=/usr/local --with-java=gij


For my patches to avoid using java and jar commands I will also define the following:

$ export JAR=/usr/local/bin/fastjar <-- something better is needed as JAR already represents db.jar

$ export JAVA=/usr/local/bin/gij <-- needed for berkeleydb


Step 4: packaging

Finally the build fails when preregistering java components. Until this is solved I just ignore the error, and the product seems to work anyway. For an example how this is done, review the patch for solenv/bin/modules/installer/servicesfile.pm attached here: i50599 Build GNU Linux Sparc with gcj

Maybe someone can explain what preregistering does, and why it seems to work anyway?

Installing from rpm without root access

The GNU Linux Sparc packages from contrib/linuxsparc should not interfere with installations provided by the various distribution packagers such as debian, gentoo etc. Therefore the supplied rpms can be installed in the user's home directory using the install_linux.sh script which is available on mirrors at pub/OpenOffice.org/developer/install_scripts/

The rpm command is required but root access is not required
Personal tools