public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/28009]  New: libjava cannot be cross-built; X_CFLAGS includes /usr/include
@ 2006-06-13  7:12 tbm at cyrius dot com
  2006-06-13  7:13 ` [Bug libgcj/28009] " tbm at cyrius dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tbm at cyrius dot com @ 2006-06-13  7:12 UTC (permalink / raw)
  To: java-prs

libjava fails to cross-build because the Makefile includes an -I/usr/include. 
Removing that makes it work.  I've seen this a number of times now, i386 to
alpha-linux, i386 to m68-linux, etc.  The problem is this in the Makefile:
X_CFLAGS =  -I/usr/include
and X_CFLAGS is part of AM_CXXFLAGS which is where it causes the problem.

I configured gcc with:
/home/tbm/scratch/gcc/configure --disable-bootstrap \
  --enable-languages=c,c++,java --target=alpha-linux-gnu


-- 
           Summary: libjava cannot be cross-built; X_CFLAGS includes
                    /usr/include
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28009


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libgcj/28009] libjava cannot be cross-built; X_CFLAGS includes /usr/include
  2006-06-13  7:12 [Bug libgcj/28009] New: libjava cannot be cross-built; X_CFLAGS includes /usr/include tbm at cyrius dot com
@ 2006-06-13  7:13 ` tbm at cyrius dot com
  2006-06-13  7:17 ` tbm at cyrius dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tbm at cyrius dot com @ 2006-06-13  7:13 UTC (permalink / raw)
  To: java-prs



------- Comment #1 from tbm at cyrius dot com  2006-06-13 07:13 -------
Created an attachment (id=11658)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11658&action=view)
alpha-linux-gnu/libjava/config.log


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28009


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libgcj/28009] libjava cannot be cross-built; X_CFLAGS includes /usr/include
  2006-06-13  7:12 [Bug libgcj/28009] New: libjava cannot be cross-built; X_CFLAGS includes /usr/include tbm at cyrius dot com
  2006-06-13  7:13 ` [Bug libgcj/28009] " tbm at cyrius dot com
@ 2006-06-13  7:17 ` tbm at cyrius dot com
  2006-09-03  7:23 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tbm at cyrius dot com @ 2006-06-13  7:17 UTC (permalink / raw)
  To: java-prs



------- Comment #2 from tbm at cyrius dot com  2006-06-13 07:17 -------
Created an attachment (id=11659)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11659&action=view)
command line causing problem

Here's a sample command line showing the problem.  Removing the -I/usr/include
makes it work.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28009


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libgcj/28009] libjava cannot be cross-built; X_CFLAGS includes /usr/include
  2006-06-13  7:12 [Bug libgcj/28009] New: libjava cannot be cross-built; X_CFLAGS includes /usr/include tbm at cyrius dot com
  2006-06-13  7:13 ` [Bug libgcj/28009] " tbm at cyrius dot com
  2006-06-13  7:17 ` tbm at cyrius dot com
@ 2006-09-03  7:23 ` pinskia at gcc dot gnu dot org
  2006-09-04 10:10 ` tbm at cyrius dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-03  7:23 UTC (permalink / raw)
  To: java-prs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-09-03 07:23 -------
This worked for me with using --with-sysroot=MYSYSROOT with a cross from
i686-pc-linux-gnu to powerpc64-linux-gnu even with all the multilibs for ppc64
:).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28009


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libgcj/28009] libjava cannot be cross-built; X_CFLAGS includes /usr/include
  2006-06-13  7:12 [Bug libgcj/28009] New: libjava cannot be cross-built; X_CFLAGS includes /usr/include tbm at cyrius dot com
                   ` (2 preceding siblings ...)
  2006-09-03  7:23 ` pinskia at gcc dot gnu dot org
@ 2006-09-04 10:10 ` tbm at cyrius dot com
  2008-02-01 16:43 ` jwlemke at specifix dot com
  2008-02-01 23:39 ` wilson at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tbm at cyrius dot com @ 2006-09-04 10:10 UTC (permalink / raw)
  To: java-prs



------- Comment #4 from tbm at cyrius dot com  2006-09-04 10:10 -------
And what if you don't specify --with-sysroot?  Everything else compiles fines
without this option.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28009


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libgcj/28009] libjava cannot be cross-built; X_CFLAGS includes /usr/include
  2006-06-13  7:12 [Bug libgcj/28009] New: libjava cannot be cross-built; X_CFLAGS includes /usr/include tbm at cyrius dot com
                   ` (3 preceding siblings ...)
  2006-09-04 10:10 ` tbm at cyrius dot com
@ 2008-02-01 16:43 ` jwlemke at specifix dot com
  2008-02-01 23:39 ` wilson at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jwlemke at specifix dot com @ 2008-02-01 16:43 UTC (permalink / raw)
  To: java-prs



------- Comment #5 from jwlemke at specifix dot com  2008-02-01 16:43 -------
I ran into this problem as well.  I was building x86 x mips64.
FWIW, my solution was this:

2008-01-31  James Lemke  <jwlemke@specifix.com>

       * configure.ac: For a cross, if --with-x was not specified supress it.
       * configure: Regenerate.

Index: gcc/libjava/configure.ac
===================================================================
RCS file: /services/cvs/cvsroot/latest/gcc/libjava/configure.ac,v
retrieving revision 1.1.1.9.2.6
diff -u -p -r1.1.1.9.2.6 configure.ac
--- gcc/libjava/configure.ac    25 Sep 2006 02:03:13 -0000      1.1.1.9.2.6
+++ gcc/libjava/configure.ac    1 Feb 2008 16:25:52 -0000
@@ -705,6 +705,10 @@ AC_SUBST(ZLIBSPEC)
 ZLIBTESTSPEC=
 AC_SUBST(ZLIBTESTSPEC)

+if test "x${with_x-unset}" = xunset -a "x$cross_compiling" = xyes; then
+    with_x=no
+fi
+
 AC_PATH_XTRA

 # FIXME: this should be _libs on some hosts.


-- 

jwlemke at specifix dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jwlemke at specifix dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28009


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libgcj/28009] libjava cannot be cross-built; X_CFLAGS includes /usr/include
  2006-06-13  7:12 [Bug libgcj/28009] New: libjava cannot be cross-built; X_CFLAGS includes /usr/include tbm at cyrius dot com
                   ` (4 preceding siblings ...)
  2008-02-01 16:43 ` jwlemke at specifix dot com
@ 2008-02-01 23:39 ` wilson at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: wilson at gcc dot gnu dot org @ 2008-02-01 23:39 UTC (permalink / raw)
  To: java-prs



------- Comment #6 from wilson at gcc dot gnu dot org  2008-02-01 23:39 -------
Configuring --without-x is a possible workaround.  I haven't tried it.  I also
haven't tried to reproduce the problem.

The problem comes from the AC_PATH_XTRA call in libjava/configure.ac.  This is
a documented autoconf feature to get info about X header files and libraries. 
So now we have to look in the autoconf sources.  AC_PATH_XTRA calls AC_PATH_X. 
If X is enabled, and x_includes/x_libraries have not already been specified,
then _AC_PATH_X is called.  _AC_PATH_X then calls _AC_PATH_X_XMKMF. 
_AC_PATH_X_XMKMF then does something clever.  It creates an Imakefile that just
echos the value of some Imakefile variables, it runs xmkmf to convert the
Imakefile into an X makefile, then it runs make to echo out the expanded values
of the X Imakefile variable values, and uses them to set x_includes and
x_libraries.

The problem here of course is that xmkmf is a host tool, which is being run
directly (i.e. no macro to override), and will always return paths valid on the
host.  Which is wrong for a cross compiler.  Though I suppose we could try
overriding the _AC_PATH_X_XMKMF function itself.

I only took a quick look at this, so I don't know why this is breaking for some
and working for others.  Perhaps it matters whether you have X headers and
libraries in your sysroot.  Perhaps it matters whether you use a sysroot.  It
clearly does matter whether you have xmkmf installed on your host machine.  If
you don't have xmkmf installed (which is part of the imake package), then you
presumably won't have this problem.


-- 

wilson at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wilson at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28009


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-02-01 23:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-13  7:12 [Bug libgcj/28009] New: libjava cannot be cross-built; X_CFLAGS includes /usr/include tbm at cyrius dot com
2006-06-13  7:13 ` [Bug libgcj/28009] " tbm at cyrius dot com
2006-06-13  7:17 ` tbm at cyrius dot com
2006-09-03  7:23 ` pinskia at gcc dot gnu dot org
2006-09-04 10:10 ` tbm at cyrius dot com
2008-02-01 16:43 ` jwlemke at specifix dot com
2008-02-01 23:39 ` wilson at gcc dot gnu dot org

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).