This is the mail archive of the java-prs@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]

[Bug libgcj/40868] New: ecjx.cc should be compiled by host gcc


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 $@ $<; \


-- 
           Summary: ecjx.cc should be compiled by host gcc
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dsdsdds at 126 dot com
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: arm-none-linux-gnueabi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40868


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