From: David Daney <ddaney@caviumnetworks.com>
To: Eduardo Costa <eduardo.m.costa@gmail.com>
Cc: java@gcc.gnu.org
Subject: Re: Crosscompile of ecjx fails
Date: Wed, 10 Jun 2009 18:06:00 -0000 [thread overview]
Message-ID: <4A2FF60E.2040504@caviumnetworks.com> (raw)
In-Reply-To: <23967391.post@talk.nabble.com>
Eduardo Costa wrote:
> I'm doing a canadian cross with build=x86_64-linux, host=mingw32,
> target=arm-eabi. Everything is fine, except gcj. For some reason, when I
> compile ecjx, it uses "target" to compile ecjx.o and "host" to compile ecjx:
>
It is indeed somewhat broken for building cross compilers. Your
workaround may be the best solution, unless you feel like doing some
hacking on the libgcj Makefiles.
David Daney
> $ make ecjx
> depbase=`echo ecjx.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; \
> if arm-eabi-c++ -DHAVE_CONFIG_H -I. -I../../../../gcc-4.4.0/libjava
> -I./include -I./gcj -I../../../../gcc-4.4.0/libjava -Iinclude
> -I../../../../gcc-4.4.0/libjava/include
> -I../../../../gcc-4.4.0/libjava/classpath/include -Iclasspath/include
> -I../../../../gcc-4.4.0/libjava/classpath/native/fdlibm
> -I../../../../gcc-4.4.0/libjava/../boehm-gc/include -I../boehm-gc/include
> -I../../../../gcc-4.4.0/libjava/.././libjava/../gcc
> -I../../../../gcc-4.4.0/libjava/../zlib -fno-rtti -fnon-call-exceptions
> -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSET_BITS=64 -Wextra -Wall
> -D_GNU_SOURCE -DPREFIX="\"/home/ecosta/devkitpro/devkitARM\""
> -DTOOLEXECLIBDIR="\"/home/ecosta/devkitpro/devkitARM/arm-eabi/lib\""
> -DJAVA_HOME="\"/home/ecosta/devkitpro/devkitARM\""
> -DBOOT_CLASS_PATH="\"/home/ecosta/devkitpro/devkitARM/share/java/libgcj-4.4.0.jar\""
> -DJAVA_EXT_DIRS="\"/home/ecosta/devkitpro/devkitARM/share/java/ext\""
> -DGCJ_ENDORSED_DIRS="\"/home/ecosta/devkitpro/devkitARM/share/java/gcj-endorsed\""
> -DGCJ_VERSIONED_LIBDIR="\"/home/ecosta/devkitpro/devkitARM/lib/gcj-4.4.0-10\""
> -DPATH_SEPARATOR="\":\""
> -DECJ_JAR_FILE="\"/home/ecosta/devkitpro/devkitARM/libexec/ecj-4.3.jar\""
> -DLIBGCJ_DEFAULT_DATABASE="\"/home/ecosta/devkitpro/devkitARM/lib/gcj-4.4.0-10/classmap.db\""
> -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL="\"gcj-4.4.0-10/classmap.db\"" -g -O2
> -MT ecjx.o -MD -MP -MF "$depbase.Tpo" -c -o ecjx.o
> ../../../../gcc-4.4.0/libjava/ecjx.cc; \
> then mv -f "$depbase.Tpo" "$depbase.Po"; else rm -f "$depbase.Tpo";
> exit 1; fi
> mingw32-gcj -o ecjx -findirect-dispatch
> --main=org.eclipse.jdt.internal.compiler.batch.GCCMain ecjx.o
> /home/ecosta/cross/lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld: unknown
> architecture of input file `ecjx.o' is incompatible with i386 output
> collect2: ld returned 1 exit status
> make: *** [ecjx] Error 1
>
> Shouldn't it use "mingw32-c++" and "mingw32-gcj"? Why it uses "arm-eabi-c++"
> instead?
>
> BTW, when I crosscompiled the mingw32 toolchain, I got the same problem (it
> uses "native-g++" to compile ecjx.o and "mingw32-gcj" to compile ecjx). This
> I solved by not compiling java... :)
>
> An ugly workaround is compile it with:
>
> make CXX=mingw-c++ ecjx
>
> It generates a windows executable (without the .exe extension) - nasty, but
> works...
>
> Configured with:
>
> CFLAGS_FOR_TARGET="-O2" ../gcc-*/configure \
> --build=x86_64-redhat-linux --host=mingw32 --target=arm-eabi \
> --prefix=/home/ecosta/cross --disable-nls \
> --enable-languages=c,c++,objc,java \
> --with-cpu=arm7tdmi\
> --enable-interwork --disable-multilib \
> --with-gcc --with-gnu-ld --with-gnu-as \
> --disable-shared --disable-threads --disable-win32-registry --disable-nls
> --disable-debug \
> --disable-libmudflap --disable-libssp --disable-libgomp \
> --disable-libstdcxx-pch \
> --enable-libgcj
> --disable-getenv-properties --disable-hash-synchronization
> --disable-interpreter
> --disable-java-net --disable-jvmpi --enable-reduced-reflection
> --without-libffi --without-x \
> --with-ecj-jar=/home/ecosta/cross/libexec/ecj-4.3.jar \
> --with-newlib \
> --without-headers \
>
prev parent reply other threads:[~2009-06-10 18:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-10 17:39 Eduardo Costa
2009-06-10 18:06 ` David Daney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A2FF60E.2040504@caviumnetworks.com \
--to=ddaney@caviumnetworks.com \
--cc=eduardo.m.costa@gmail.com \
--cc=java@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).