This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: java/5688: cross compiler build fails in libjava
- From: "H . J . Lu" <hjl at lucon dot org>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: tromey at redhat dot com, pb at nexus dot co dot uk, gcc-bugs at gcc dot gnu dot org,gcc-patches at gcc dot gnu dot org
- Date: Mon, 3 Jun 2002 13:32:18 -0700
- Subject: Re: java/5688: cross compiler build fails in libjava
- References: <3CFA6F73.8070107@lucon.org> <878z5xclb2.fsf@creche.redhat.com> <20020602200900.A15323@lucon.org> <87y9dwbdb5.fsf@creche.redhat.com> <jmwutguz2m.fsf@desire.geoffk.org>
On Mon, Jun 03, 2002 at 09:06:09AM -0700, Geoff Keating wrote:
> Tom Tromey <tromey@redhat.com> writes:
>
> > >>>>> "H.J." == H J Lu <hjl@lucon.org> writes:
> >
> > H.J.> Here is a patch. It seems to work for me to cross compiling to
> > H.J.> Linux/x86. No idea how it works for newlib.
> >
> > I'm not going to check this in.
> >
> > H.J.> * configure.in: Never assume newlib for cross compile.
> >
> > This breaks newlib crosses. I know Anthony Green at least tests
> > these.
> >
> > If link tests always work properly for linux-x-linux crosses, then
> > something similar to your patch would be acceptable. It would have to
> > preserve newlib crosses, though. One approximation to this would be
> > to use the "native" checking code if the target matches *-linux*.
> > Perhaps the best approach would be to add a new variable to
> > configure.host.
>
> There's also a --with-newlib flag that could be tested.
>
How about this patch?
H.J.
---
2002-06-03 H.J. Lu (hjl@gnu.org)
* configure.in (--with-newlib): New option:
Check ${with_newlib} instead of ${with_cross_host} for newlib.
(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 Mon Jun 3 13:29:32 2002
@@ -16,6 +16,9 @@ AC_ARG_WITH(target-subdir,
AC_ARG_WITH(cross-host,
[ --with-cross-host=HOST configuring with a cross compiler])
+AC_ARG_WITH(newlib,
+[ --with-newlib Configuring with newlib])
+
LIBGCJ_CONFIGURE(.)
AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h)
@@ -465,7 +468,7 @@ changequote([,])dnl
AC_SUBST(tool_include_dir)
AC_SUBST(gcc_version)
-if test -n "${with_cross_host}"; then
+if test "x${with_newlib}" = "xyes"; 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 +519,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