java/5688: cross compiler build fails in libjava

H . J . Lu hjl@lucon.org
Sun Jun 2 20:09:00 GMT 2002


On Sun, Jun 02, 2002 at 05:28:33PM -0600, Tom Tromey wrote:
> >>>>> "H.J." == H J Lu <hjl@lucon.org> writes:
> 
> H.J.> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5688
> H.J.> Is anyone working on this bug?
> 
> As far as I know, nobody is working on it.
> 
> Tom

Here is a patch. It seems to work for me to cross compiling to
Linux/x86. No idea how it works for newlib.


H.J.
-------------- next part --------------
2002-06-02  H.J. Lu  (hjl@gnu.org)

	* configure.in: Never assume newlib for cross compile.
	(HAVE_PROC_SELF_EXE): Defined to 1 only for cross compiling to
	Linux.
	* configure: Regenerated.

--- libjava/configure.in.cross	Sun May 19 21:49:56 2002
+++ libjava/configure.in	Sun Jun  2 14:16:22 2002
@@ -465,7 +465,7 @@ changequote([,])dnl
 AC_SUBST(tool_include_dir)
 AC_SUBST(gcc_version)
 
-if test -n "${with_cross_host}"; then
+if test "0" = "1" && test -n "${with_cross_host}"; then
    # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
    # may not work correctly, because the compiler may not be able to
    # link executables.
@@ -516,8 +516,16 @@ else
 
    AC_CHECK_LIB(dl, dladdr, [
      AC_DEFINE(HAVE_DLADDR)])
-   AC_CHECK_FILES(/proc/self/exe, [
-     AC_DEFINE(HAVE_PROC_SELF_EXE)])
+   if test x$build = x$host && test x$host = x$target; then
+     AC_CHECK_FILES(/proc/self/exe, [
+       AC_DEFINE(HAVE_PROC_SELF_EXE)])
+   else
+     case $target in
+     *-linux*)
+       AC_DEFINE(HAVE_PROC_SELF_EXE)
+       ;;
+     esac
+   fi
 
    AM_ICONV
    AM_LC_MESSAGES


More information about the Gcc-bugs mailing list