gcc version: 4.4.1 with gcc-4.4.1-branch_update-1.patch host system: Ubuntu 9.04 x86_64 configured by: ./configure --prefix=/usr --build=x86_64-linux-gnu \ --host=x86_64-linux-gnu \ --target=arm-none-linux-gnueabi --with-sysroot=$TOOLCHAIN_DIR \ --with-gmp=$STATIC_LIB_DIR --with-mpfr=$STATIC_LIB_DIR \ --disable-multilib --disable-nls --enable-shared \ --enable-__cxa_atexit --enable-c99 --enable-long-long \ --enable-threads=posix --enable-languages=c,c++,java \ --with-float=soft --with-cpu=arm926ej-s \ --enable-libgcj-bc --disable-sjlj-exceptions \ --with-ecj-jar=/source/ecj.jar compiled by: make AS_FOR_TARGET=arm-none-linux-gnueabi-as LD_FOR_TARGET=arm-none-linux-gnueabi-ld error message: architecture of input file `ecjx.o' is incompatible with i386:x86_64 output I solved this error message as follows: First chdir to 'arm-none-linux-gnueabi/libjava', then run 'gcc ecjx.cc -o ecjx.o' then run 'make AS_FOR_TARGET=arm-none-linux-gnueabi-as LD_FOR_TARGET=arm-none-linux-gnueabi-ld' and no more error happens, and the toolchain works without problem. This error is because ecjx.cc is compiled by arm-none-linux-gnueabi-gcc, not by gcc. I think that libjava/Makefile.in should be changed, as diff -Narup gcc-4.4.1.origin/libjava/Makefile.in gcc-4.4.1/libjava/Makefile.in --- gcc-4.4.1.origin/libjava/Makefile.in 2009-07-22 15:43:59.000000000 +0800 +++ gcc-4.4.1/libjava/Makefile.in 2009-07-27 08:40:50.702375251 +0800 @@ -9739,6 +9739,9 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +ecjx.o: + gcc -c -o $@ $< + .cc.o: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`; \ @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $<; \
This sounds correct to me . Adding one of the libjava maintainers to comment on this. Patches should be submitted to the correct mailing list.
Assigning to Tom tromey: this is his area.
I think it isn't correct to use "gcc" directly. You probably have to introduce a new variable. But, I don't see why we need ecjx.cc at all. I think it must be to work around some other problem. Maybe instead we could just fix that problem directly. Apparently it came in here, though I don't see why: http://gcc.gnu.org/ml/java-patches/2008-q4/msg00067.html See also PR 38396
Hmm, I seem to have approved that patch. I agree with you: I can't see why the specfile change requires ecjx.cc.
I believe libtool wasn't doing the right thing without any sources, but it has been a while, so I don't remember the details.
Created attachment 19222 [details] Proposed patch With this patch applied, gcj cross-builds fine (not a canadian cross though).
(In reply to comment #6) > Created an attachment (id=19222) [edit] > Proposed patch > > With this patch applied, gcj cross-builds fine (not a canadian cross though). > Please submit patches to gcc-patches@gcc.gnu.org
Bug cannot be resolved with updates in libjava/Makefile. You could see my comments in issue #40868 (clone of #30591)
*** Bug 42311 has been marked as a duplicate of this bug. ***
Subject: Bug 40868 Author: rwild Date: Fri Aug 27 04:27:40 2010 New Revision: 163580 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163580 Log: Fix building ecjx in cross compile mode. libjava/: PR libgcj/40868 * configure.ac: Add GCC_FOR_ECJX variable. Ensure GCJ_FOR_ECJX is always set. * Makefile.am [!NATIVE] (ecjx.$(OBJEXT)): New rule. * Makefile.in: Regenerate. * configure: Regenerate. * gcj/Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. Modified: trunk/libjava/ChangeLog trunk/libjava/Makefile.am trunk/libjava/Makefile.in trunk/libjava/configure trunk/libjava/configure.ac trunk/libjava/gcj/Makefile.in trunk/libjava/include/Makefile.in trunk/libjava/testsuite/Makefile.in
Fixed.
Hi Ralf, i tried destilling your rev 163580 patches into one accumulated backport to gcc-4.4.4. in our openembedded cross development toolchain. http://pastebin.com/pU3zF6MP the patch actually does apply correctly, but during compile time, fails in the libjava directory: ... libtool: link: ( cd ".libs" && rm -f "libgcj_bc.la" && ln -s "../libgcj_bc.la" "libgcj_bc.la" ) /bin/bash: GCC_FOR_ECJX@: command not found turns out that the generated Makefile has the line GCC_FOR_ECJX = @GCC_FOR_ECJX@ in it, so the variable wasn't substituted correctly during configure, even though config.log says GCC_FOR_ECJX='x86_64-linux-gcc' i probably need to backport other parts to be able to apply this patch correctly on gcc release 4.4.4. but unfortunately the revision log http://gcc.gnu.org/viewcvs/trunk/libjava/configure.ac?view=log&pathrev=163580 doesn't have information about the releases is there an easy way to find out what else i need? greetings, fraxinas
On 23/09/10 23:36, andreas.frisch@multimedia-labs.de wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40868 > > Fraxinas <andreas.frisch@multimedia-labs.de> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |andreas.frisch@multimedia-l > | |abs.de > > --- Comment #12 from Fraxinas <andreas.frisch@multimedia-labs.de> 2010-09-23 22:36:05 UTC --- > Hi Ralf, > i tried destilling your rev 163580 patches into one accumulated backport to > gcc-4.4.4. in our openembedded cross development toolchain. > http://pastebin.com/pU3zF6MP > > the patch actually does apply correctly, but during compile time, fails in the > libjava directory: > ... > libtool: link: ( cd ".libs" && rm -f "libgcj_bc.la" && ln -s "../libgcj_bc.la" > "libgcj_bc.la" ) > /bin/bash: GCC_FOR_ECJX@: command not found > > turns out that the generated Makefile has the line GCC_FOR_ECJX = > @GCC_FOR_ECJX@ in it, so the variable wasn't substituted correctly during > configure, even though config.log says GCC_FOR_ECJX='x86_64-linux-gcc' > > i probably need to backport other parts to be able to apply this patch > correctly on gcc release 4.4.4. but unfortunately the revision log > http://gcc.gnu.org/viewcvs/trunk/libjava/configure.ac?view=log&pathrev=163580 > doesn't have information about the releases > > is there an easy way to find out what else i need? It's hard to say. I'd just import libgcj from gcc trunk. Andrew.
Created attachment 21898 [details] backport This is the backport I use against gcc-4.4
(In reply to comment #14) > Created attachment 21898 [details] > backport > > This is the backport I use against gcc-4.4 dear dima, thanks for that patch but it's not sufficient. it even applies and configures right but too many things had changed between release 4.4.4 and revision 163580. so the resulting generated makefile is faulty and leaves the variable @GCC_FOR_ECJX@ unsubtituted which causes compile to fail. instead, i did it like Andrew proposed and simply imported the entire libjava directory from svn head with which it works correctly. now i am struggeling to cross compile statically linked mipsel java code with a c++ .so linked to it...
(In reply to comment #15) > (In reply to comment #14) > > Created attachment 21898 [details] [details] > > backport > > > > This is the backport I use against gcc-4.4 > > dear dima, thanks for that patch but it's not sufficient. it even applies and > configures right but too many things had changed between release 4.4.4 and > revision 163580. so the resulting generated makefile is faulty and leaves the > variable @GCC_FOR_ECJX@ unsubtituted which causes compile to fail. This patch does apply against snapshot gcc-4.4 branch 26-09-2010. And does build libgcj & java cross-compiler from i386|x86_64-gnu-linux to i686-w64-mingw32. After the patch is applied you do need to rerun correct autoreconf (2.59). Buildlog - http://launchpadlibrarian.net/56490712/buildlog_ubuntu-lucid-i386.w64-toolchain_1.0b%2B201009260029-0w2228g93841b22110p11~lucid1_FULLYBUILT.txt.gz