This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Patch for building Java compiler for version 4.3.0+


The Java compiler for GCC versions 4.3.0 and up requires the
Eclipse compiler "ecj1" to be built as well.  I added "gcj" to
the list of utilities to make the initial link:

--- /home/andy/cross-tool/crosstool-ng-1.3.1/scripts/crosstool.sh
2008-12-03 16:39:01.000000000 -0600
+++ /usr/local/lib/ct-ng-1.3.1/scripts/crosstool.sh	2008-12-29
07:18:21.000000000 -0600
@@ -329,7 +329,7 @@
             t="${!r}-"
         fi
 
-        for tool in ar as dlltool gcc g++ gnatbind gnatmake ld nm
objcopy objdump ranlib strip windres; do
+        for tool in ar as dlltool gcc g++ gcj gnatbind gnatmake ld nm
objcopy objdump ranlib strip windres; do
             # First try with prefix + suffix
             # Then try with prefix only
             # Then try with suffix only, but only for BUILD, and HOST
iff REAL_BUILD == REAL_HOST

I also added some code to download ecj.jar if Java is selected:

--- /home/andy/cross-tool/crosstool-ng-1.3.1/scripts/build/cc/gcc.sh
2008-11-13 12:22:23.000000000 -0600
+++ /usr/local/lib/ct-ng-1.3.1/scripts/build/cc/gcc.sh	2008-12-30
07:29:19.000000000 -0600
@@ -18,11 +18,20 @@
     # subdirectory! You bastard!
     CT_GetFile "${CT_CC_FILE}"  \
 
{ftp,http}://ftp.gnu.org/gnu/gcc{,{,/releases}/${CT_CC_FILE}}
+    # Starting with GCC 4.3, ecj is used for Java, and will only be
+    # built if the configure script finds ecj.jar at the top of the
+    # GCC source tree, which will not be there unless we get it and
+    # put it there ourselves
+    [ "${CT_CC_LANG_JAVA}" = "y" -a "${CT_CC_GCC_4_3_or_later}" = "y" ]
&& \
+        CT_GetFile "ecj-latest.jar" ftp://gcc.gnu.org/pub/java
 }
 
 # Extract gcc
 do_cc_extract() {
     CT_ExtractAndPatch "${CT_CC_FILE}"
+    # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree
+    [ "${CT_CC_LANG_JAVA}" = "y" -a "${CT_CC_GCC_4_3_or_later}" = "y" ]
&& \
+        CT_DoExecLog ALL cp ${CT_LOCAL_TARBALLS_DIR}/ecj-latest.jar
${CT_SRC_DIR}/${CT_CC_FILE}/ecj.jar
 }
 
 
#-----------------------------------------------------------------------
-------

I have only tested this with ARM so far, both glibc and uClibc.
At least I am now able to build ARM binaries from Java sources.

Unfortunately, I have now reached a new problem:  My tool-chain
is much newer than my embedded device (by four years).  I get
errors such as the following:

./Reverse: /lib/ld-linux.so.2: version `GLIBC_2.3' not found (required
by ./libgcj.so.9)
./Reverse: /lib/libpthread.so.0: version `GLIBC_2.3.2' not found
(required by ./libgcj.so.9)
./Reverse: /lib/libc.so.6: version `GLIBC_2.3' not found (required by
./libgcj.so.9)

If I copy these files into a directory and set LD_LIBRARY_PATH, then I
get this error:

Inconsistency detected by ld.so: dynamic-link.h: 62:
elf_get_dynamic_info: Assertion `! "bad dynamic tag"' failed!

How can I fix this?

Thanks,

Andy Johnson


--
For unsubscribe information see http://sourceware.org/lists.html#faq


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