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

View: New views
6 Messages — Rating Filter:   Alert me  

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

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


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

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #1 from ramana at gcc dot gnu dot org  2009-09-01 12:03 -------
This sounds correct to me . Adding one of the libjava maintainers to comment on
this. Patches should be submitted to the correct mailing list.


--

ramana at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aph at redhat dot com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-09-01 12:03:59
               date|                            |


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


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

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #2 from aph at gcc dot gnu dot org  2009-09-01 14:06 -------
Assigning to Tom tromey: this is his area.


--

aph at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #3 from tromey at gcc dot gnu dot org  2009-09-01 16:58 -------
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


--


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


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

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #4 from aph at gcc dot gnu dot org  2009-09-01 17:09 -------
Hmm, I seem to have approved that patch.
I agree with you: I can't see why the specfile change requires ecjx.cc.


--


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


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

by Bugzilla from gcc-bugzilla@gcc.gnu.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



------- Comment #5 from jakub at gcc dot gnu dot org  2009-09-01 21:38 -------
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.


--


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