Bug 5688 - cross compiler build fails in libjava
Summary: cross compiler build fails in libjava
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
: 11288 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-02-14 04:26 UTC by Philip Blundell
Modified: 2005-07-23 22:39 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-04-18 02:01:02


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Blundell 2002-02-14 04:26:03 UTC
Compilation stops with this error

/var/tmp/build/gcc/gcc/g++ -B/var/tmp/build/gcc/gcc/ -nostdinc++ -nostdinc++ -I/var/tmp/build/gcc/arm-linux/libstdc++-v3/include/arm-linux -I/var/tmp/build/gcc/arm-linux/libstdc++-v3/include -I/home/pb/gcc/libstdc++-v3/libsupc++ -I/home/pb/gcc/libstdc++-v3/libio -I/home/pb/gcc/libstdc++-v3/include/backward -I/home/pb/gcc/libstdc++-v3/testsuite -L/var/tmp/build/gcc/arm-linux/libstdc++-v3/src -L/var/tmp/build/gcc/arm-linux/libstdc++-v3/src/.libs -B/usr/local/arm-linux/bin/ -B/usr/local/arm-linux/lib/ -isystem /usr/local/arm-linux/include -DHAVE_CONFIG_H -I. -I/home/pb/gcc/libjava -I./include -I./gcj -I/home/pb/gcc/libjava -Iinclude -I/home/pb/gcc/libjava/include -I/home/pb/gcc/libjava/../boehm-gc/include -DGC_LINUX_THREADS=1 -D_REENTRANT=1 -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DALL_INTERIOR_POINTERS=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -DNO_SIGSET=1 -DNO_DEBUGGING=1 -I/home/pb/gcc/libjava/.././libjava/../gcc -I/home/pb/gcc/libjava/../zlib -I/home/pb/gcc/libjava/../libffi/include -I../libffi/include -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -I/usr/X11R6/include -W -Wall -D_GNU_SOURCE -DPREFIX=\"/usr/local\" -g -O2 -D_GNU_SOURCE -MD -MT java/net/natInetAddress.lo -MF java/net/natInetAddress.pp -c /home/pb/gcc/libjava/java/net/natInetAddress.cc  -fPIC -DPIC -o java/net/.libs/natInetAddress.o
/home/pb/gcc/libjava/java/net/natInetAddress.cc:58: declaration of C function `
   int gethostname(char*, int)' conflicts with
/usr/local/arm-linux/include/unistd.h:734: previous declaration `int 
   gethostname(char*, unsigned int)' here
make[2]: *** [java/net/natInetAddress.lo] Error 1

Release:
CVS HEAD, 14-02-2002

Environment:
/home/pb/gcc/configure --with-gcc-version-trigger=/home/pb/gcc/gcc/version.c --
ost=i686-pc-linux-gnu --target=arm-linux --norecursion
Comment 1 Tom Tromey 2002-02-14 11:02:30 UTC
From: Tom Tromey <tromey@redhat.com>
To: pb@nexus.co.uk
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: java/5688: cross compiler build fails in libjava
Date: 14 Feb 2002 11:02:30 -0700

 >>>>> ">" == pb  <pb@nexus.co.uk> writes:
 
 >> --target=arm-linux
 
 >> /home/pb/gcc/libjava/java/net/natInetAddress.cc:58: declaration of C function `
 >>    int gethostname(char*, int)' conflicts with
 >> /usr/local/arm-linux/include/unistd.h:734: previous declaration `int 
 >>    gethostname(char*, unsigned int)' here
 
 
 FYI: libgcj currently assumes that if you are cross-compiling then the
 target uses newlib.  This is a bogus assumption, of course, but nobody
 has yet done the work to eliminate it.  This particular error is just
 the first problem you will encounter...
 
 Tom

Comment 2 H.J. Lu 2002-06-02 12:18:11 UTC
From: "H.J. Lu" <hjl@lucon.org>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, pb@nexus.co.uk,
	gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
	java-prs@gcc.gnu.org?Subject=Re:, java/5688:@lucon.org,
	cross@lucon.org, co@lucon.org
Cc:  
Subject: Re: java/5688: cross compiler build fails in libjava
Date: Sun, 02 Jun 2002 12:18:11 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5688
 
 Is anyone working on this bug? I guess the first thing should be done is 
 to change
 
 if 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.
 
    # We assume newlib.  This lets us hard-code the functions we know
    # we'll have.
    AC_DEFINE(HAVE_MEMMOVE)
  .....
 
 to something similar in the toplevel configure.in which checks if newlib 
 is used
 before blindly assuming we are compiling for newlib.
 

Comment 3 Tom Tromey 2002-06-02 17:28:33 UTC
From: Tom Tromey <tromey@redhat.com>
To: "H.J. Lu" <hjl@lucon.org>
Cc: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, pb@nexus.co.uk,
        gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org,
        "java-prs@gcc.gnu.org?Subject=Re":, java/5688:@lucon.org,
        cross@lucon.org, co@lucon.org
Subject: Re: java/5688: cross compiler build fails in libjava
Date: 02 Jun 2002 17:28:33 -0600

 >>>>> "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
Comment 4 Nathanael C. Nerode 2003-06-10 14:04:53 UTC
Yes, this is a real bug.

It may get fixed as fallout from general configury cleanup (we can hope).
Comment 5 Andrew Pinski 2003-06-24 15:37:54 UTC
*** Bug 11288 has been marked as a duplicate of this bug. ***