This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compilation problems with ecj.jar


>>>>> "Marco" == Marco Trudel <mtrudel@gmx.ch> writes:

>> GCJ_FOR_ECJX="${with_cross_host}-gcj"

Marco> Yes, this is what I would expect. With my host=Linux, target=minGW and
Marco> build=Linux, it evaluates to "i686-pc-linux-gnu-gcj".

Ok...  you are building an "ordinary" cross compiler, not a Canadian
cross.

So, we want to end up with an ecj1 which runs on your host machine
(linux).  So we pick i686-pc-linux-gnu-gcj... should be correct.

Marco> i686-pc-linux-gnu-gcj -o ecjx.exe -findirect-dispatch
Marco> --main=org.eclipse.jdt.internal.compiler.batch.GCCMain
Marco> /usr/local/src/gcc/libjava/.././libjava/../ecj.jar

What version of i686-pc-linux-gnu-gcj is this?

Using '-findirect-dispatch --main=...', as in the above, is a new
feature first introduced on the gcj-eclipse branch.  So, for this to
work you will want a native linux gcc 4.3 first.


Offhand though the errors you are seeing look more like a bad install
of gcj.  I was surprised that it worked... did you try compiling a
.java file to an executable?  "Hello world" should do.


Finally, I think the code to pick host_exeext in configure.ac is
wrong.  It defaults to $ac_exeext -- but this is the target value.
The appended is an untested patch which may help.  The idea is to
default to nothing, and use $with_cross_host for crosses, and $host
for natives.  

Tom

Index: configure.ac
===================================================================
--- configure.ac	(revision 120901)
+++ configure.ac	(working copy)
@@ -293,7 +293,7 @@
 
 # Which gcj and host gcj (for ecjx) do we use?
 which_gcj=default
-host_exeext=${ac_exeext}
+host_exeext=
 GCJ_FOR_ECJX=
 built_gcc_dir="`cd ${builddotdot}/../../${host_subdir}/gcc && ${PWDCMD-pwd}`"
 if test -n "${with_cross_host}"; then
@@ -320,6 +320,12 @@
      which_gcj=cross
   fi
 else
+  case "${host}" in
+     *mingw* | *cygwin*)
+         host_exeext=.exe
+     ;;
+  esac
+
   # We are being configured with a native or crossed-native compiler
   if test -x "${built_gcc_dir}/gcj${ac_exeext}"; then
      if test x"$build" = x"$host"; then


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]