ecj1 in cross-compile

Andrew Haley aph@redhat.com
Wed Jun 11 08:35:00 GMT 2008


Matthijs van de Water wrote:

> I've got my GCC 4.3 toolchain working ok now, but for some reason I
> fail to get an ecj1 binary.
> 
> I'm cross-compiling for ARM and I've tried --with-ecj-jar=XXX (which
> doesn't result in an ecj1) and also tried putting ecj.jar in my build
> dir (which complains about a missing java compiler).
> I must be doing something wrong, but I'm not sure what.
> 
> I expect an i686 ecj1 binary to be compiled from the ecj-latest.jar
> that I download in my build. Preferably standalone, like the Ubuntu
> one.
> The build machine doesn't have an i686 GCJ or JAVAC installed, is that
> a problem?
> 
> What am I missing?

I don't know how you think this is going to work.  ecj1 is a Java program
and thus it needs some sort of Java runtime library.  You are going to need
an i686 gcj installed.  Of course we can install an ecj1 binary if we're
compiling for the host machine, but that can't possibly work if we're
cross-compiling because there is no Java runtime on which ecj1 can run.

ecj1 can be a small shell script that invokes the compiler; I've
appended it.

Andrew.


cat ~/bin/ecj1
#!/bin/sh
gij -cp /home/aph/gcc/trunk/ecj.jar \
    org.eclipse.jdt.internal.compiler.batch.GCCMain \
    ${1+"$@"}



More information about the Java mailing list