Difference between revisions of "GNU Linux Sparc Porting"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (GNU Linux Sparc Porting)
(further notes on Building with gcj)
Line 31: Line 31:
  
 
== Building with gcj ==
 
== Building with gcj ==
Some problems with blackdown java for sparc have forced the sparc port into building with gcj which works fine. The patches for using Ant are based on those used by the debian packagers (thanks to _rene_) but are slightly different because I do not use some debian tools. Recent patches for building GNU Linux Sparc are at i50599 but these will not be committed as they need more work to be included in the config_office project.  
+
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.  
  
 
[http://www.openoffice.org/issues/show_bug.cgi?id=50599 i50599 Build GNU Linux Sparc with gcj]
 
[http://www.openoffice.org/issues/show_bug.cgi?id=50599 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 [http://www.openoffice.org/issues/show_bug.cgi?id=50599 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
 +
 +
 +
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:
 +
[http://www.openoffice.org/issues/show_bug.cgi?id=50599 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 ==
 
== Installing from rpm without root access ==

Revision as of 10:54, 25 November 2005

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 2 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.

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


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