This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: PATCH: PR libjava/32098: New libtool doesn't support libjava


On Mon, May 28, 2007 at 07:46:16PM -0700, H. J. Lu wrote:
> On Mon, May 28, 2007 at 03:58:29PM +0200, Andreas Schwab wrote:
> > "H. J. Lu" <hjl@lucon.org> writes:
> > 
> > > bash-3.1$ cd libjava
> > > bash-3.1$ autoconf
> > > /usr/bin/m4:configure.ac:450: ERROR: recursion limit of 1024 exceeded, use -L<N> to change it
> > > autom4te: /usr/bin/m4 failed with exit status: 1
> > 
> > Make sure that aclocal.m4 is correctly regenerated, using the right
> > version of ltdl.m4 (which is missing from toplevel).
> 
> I don't think it is the problem. If I delete
> 
> printf "%c", 16*index(h, substr($0, i, 1))+index(h, substr($0, i+1, 1))-17 
> 
> I have no problem. The following patch generates:
> 
> printf "%c", 16*index(h, substr($0, i, 1))+index(h, substr($0, i+1, 1))-17
> 
> in configrue. It looks like index and $0 are used by m4.
> 
> 

This patch allows me to run aclocal and autoconf. However, it still
doesn't work. But we can't use conftest* as Java class file name since
it will be removed after a test is done.  That means the second gcj
test will fail since those class files have been removed.  If we
rename them to something else, we should remove them after all gcj
tests are done.



H.J.
----
--- libtool.m4.gcj	2007-05-26 11:42:16.000000000 -0700
+++ libtool.m4	2007-05-28 20:34:17.000000000 -0700
@@ -6737,18 +6737,55 @@ m4_defun([_LT_LANG_GCJ_CONFIG],
 [AC_REQUIRE([LT_PROG_GCJ])dnl
 AC_LANG_SAVE
 
-# Source file extension for Java test sources.
-ac_ext=java
+# Source file extension for Java test sources.  Actually, we use a list
+# of input files so that we can prepare binary .class files and keep
+# lt_simple_compile_test_code/lt_simple_link_test_code in ASCII.
+ac_ext=list
 
 # Object file extension for compiled Java test sources.
 objext=o
 _LT_TAGVAR(objext, $1)=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
+# "class conftest_compile {}"
+# Eliminate NULs (for portability), and turn it into hex using
+#       tr \\000 \\377 < foo.class | od -x | sed s/^.......// | tr -d ' '
+lt_simple_compile_test_code='conftest_compile.class'
+awk 'BEGIN { h = "0123456789abcdef" }
+  {
+    for (i = 1; i <= length; i+=2)
+      printf "%c", 16*[index](h, substr([$]0, i, 1))+[index](h, substr([$]0, i+1, 1))-17
+  }' << EOF | tr \\377 \\000 > conftest_compile.class
+cafebabeffffff31ff0d0aff03ff0a07ff0b07ff0c01ff063c696e69743e01ff
+0328295601ff04436f646501ff0f4c696e654e756d6265725461626c6501ff0a
+536f7572636546696c6501ff15636f6e66746573745f636f6d70696c652e6a61
+76610cff04ff0501ff10636f6e66746573745f636f6d70696c6501ff106a6176
+612f6c616e672f4f626a656374ff20ff02ff03ffffffffff01ffffff04ff05ff
+01ff06ffffff1dff01ff01ffffff052ab7ff01b1ffffff01ff07ffffff06ff01
+ffffff01ff01ff08ffffff02ff09
+EOF
 
 # Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+# "public class conftest_link { public static void main(String[[]] argv) {}; }"
+lt_simple_link_test_code='conftest_link.class'
+awk 'BEGIN { h = "0123456789abcdef" }
+  {
+    for (i = 1; i <= length; i+=2)
+      printf "%c", 16*[index](h, substr([$]0, i, 1))+[index](h, substr([$]0, i+1, 1))-17
+  }' << EOF | tr \\377 \\000 > conftest_link.class
+cafebabeffffff31ff0f0aff03ff0c07ff0d07ff0e01ff063c696e69743e01ff
+0328295601ff04436f646501ff0f4c696e654e756d6265725461626c6501ff04
+6d61696e01ff16285b4c6a6176612f6c616e672f537472696e673b295601ff0a
+536f7572636546696c6501ff12636f6e66746573745f6c696e6b2e6a6176610c
+ff04ff0501ff0d636f6e66746573745f6c696e6b01ff106a6176612f6c616e67
+2f4f626a656374ff21ff02ff03ffffffffff02ff01ff04ff05ff01ff06ffffff
+1dff01ff01ffffff052ab7ff01b1ffffff01ff07ffffff06ff01ffffff01ff09
+ff08ff09ff01ff06ffffff19ffffff01ffffff01b1ffffff01ff07ffffff06ff
+01ffffff01ff01ff0affffff02ff0bff
+EOF
+
+lt_save_ac_compile="$ac_compile"
+ac_compile='$CC -c $CFLAGS $CPPFLAGS @conftest.$ac_ext >&5'
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_TAG_COMPILER
@@ -6786,6 +6823,7 @@ if test -n "$compiler"; then
 fi
 
 AC_LANG_RESTORE
+ac_compile="$lt_save_ac_compile"
 CC="$lt_save_CC"
 ])# _LT_LANG_GCJ_CONFIG
 


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