Bug 6852 - gnatlib fails to build with newlib because it doesn't set up the include path
Summary: gnatlib fails to build with newlib because it doesn't set up the include path
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 3.1
: P2 normal
Target Milestone: 4.2.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build
: 21276 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-28 18:26 UTC by Geoff Keating
Modified: 2005-12-12 11:27 UTC (History)
4 users (show)

See Also:
Host:
Target: powerpc-eabisim
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-01-20 03:41:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff Keating 2002-05-28 18:26:01 UTC
The resulting error message is 'can't find unistd.h'.

Release:
3.1

How-To-Repeat:
Create a combined tree that includes GCC and newlib
<path>/configure --target=powerpc-eabisim
make
make -C gcc gnatlib
Comment 1 Geoff Keating 2002-05-28 18:26:01 UTC
Fix:
Move gnatlib out to a toplevel directory and use
CC_FOR_TARGET as passed down by the toplevel Makefile.
Comment 2 Dara Hazeghi 2003-05-27 05:50:26 UTC
Hello,

can you confirm whether this bug is still present? Thanks,

Dara
Comment 3 Andrew Pinski 2003-05-27 14:51:50 UTC
See Dara's comment.
Comment 4 Dara Hazeghi 2003-06-02 03:08:40 UTC
Geoff,

I'm resending this in case it wasn't forwarded. I was just wondering what the status of this bug 
was. Thanks,

Dara
Comment 5 Geoff Keating 2003-06-02 16:44:24 UTC
Subject: Re:  gnatlib fails to build with newlib because it doesn't set up the include path

> Date: 2 Jun 2003 03:08:41 -0000
> From: "dhazeghi@yahoo.com" <gcc-bugzilla@gcc.gnu.org>

> I'm resending this in case it wasn't forwarded. I was just wondering what the status of this bug 
> was. Thanks,

I don't know anything more than what's in the report.

Comment 6 Dara Hazeghi 2003-06-16 18:54:57 UTC
Confirmed with gcc 3.3 branch (20030615). Combined tree build fails with:
make -C gcc gnatlib_and_tools
...
make -C rts CC="../../xgcc -B../../" \
        INCLUDES="-I. -I.. -I../.. -I/home/dara/src/gcc/ada -I/home/dara/src/gcc/ada/.. -I/home/
dara/src/gcc/ada/../config -I/home/dara/src/gcc/ada/../../include -I./../.." \
                CFLAGS="-g -O2  -fexceptions -DIN_RTS" \
        srcdir=/home/dara/src/gcc/ada VPATH=/home/dara/src/gcc/ada \
        -f ../Makefile adaint.o argv.o cio.o cstreams.o errno.o exit.o raise.o sysdep.o aux-io.o init.o 
cal.o adafinal.o tracebak.o expect.o mkdir.o  prefix.o
make[2]: Entering directory `/home/dara/objdir/gcc/ada/rts'
../../xgcc -B../../ -c -DCROSS_COMPILE -DIN_GCC   `echo -g -O2  -fexceptions -DIN_RTS |sed -e 
's/-pedantic//g' -e 's/-Wtraditional//g'`        -I. -I.. -I../.. -I/home/dara/src/gcc/ada -I/home/
dara/src/gcc/ada/.. -I/home/dara/src/gcc/ada/../config -I/home/dara/src/gcc/ada/../../include 
-I./../.. adaint.c
In file included from adaint.c:56:
/home/dara/src/gcc/tsystem.h:75:19: stdio.h: No such file or directory
/home/dara/src/gcc/tsystem.h:78:23: sys/types.h: No such file or directory
/home/dara/src/gcc/tsystem.h:81:19: errno.h: No such file or directory
/home/dara/src/gcc/tsystem.h:88:20: string.h: No such file or directory
/home/dara/src/gcc/tsystem.h:89:20: stdlib.h: No such file or directory
/home/dara/src/gcc/tsystem.h:90:20: unistd.h: No such file or directory
/home/dara/src/gcc/tsystem.h:96:18: time.h: No such file or directory
Comment 7 Dara Hazeghi 2003-07-14 03:52:06 UTC
Confirmed with cross compiler to i386-pc-cygwin on mainline. Maybe these should 
all be merged into one report: gnatlib_and_tools makefile is broken, and should 
be rewritten.
Comment 8 Andrew Pinski 2003-07-19 17:43:46 UTC
Most likely will be fixed when PR 5911 is fixed.
Comment 9 Arnaud Charlet 2003-10-21 17:02:11 UTC
This issue can be fixed independently of PR 5911, and won't get fixed
automatically even if 5911 is addressed, so I am removing the
dependency to avoid confusion.

Arno
Comment 10 GCC Commits 2005-03-15 16:11:01 UTC
Subject: Bug 6852

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	charlet@gcc.gnu.org	2005-03-15 16:10:23

Modified files:
	gcc/ada        : Makefile.in 

Log message:
	2005-03-08  Doug Rupp  <rupp@adacore.com>
	Bernard Banner  <banner@adacore.com>
	Vincent Celier  <celier@adacore.com>
	Arnaud Charlet  <charlet@adacore.com>
	
	PR ada/6852
	This change works fine when gnatlib is built from the gcc directory,
	but does not work when using the libada Makefile, since GCC_FOR_TARGET
	is not passed to ada/Makefile.in, so more work is needed by a
	Makefile/configure expert.
	
	* Makefile.in(gnatlib): Use $(GCC_FOR_TARGET) for compiling library.
	set GMEM_LIB on ia64 linux to add optional support for gnatmem.
	Setup gnatlink switch -M for x86_64 linux, as it is already setup
	for Linux x86.
	(gnatlib-shared-default): Use GNATLIBCFLAGS as well.
	Run ranlib on libgccprefix.a
	Define PREFIX_OBJS for Darwin, to build libgccprefix.
	(ADA_INCLUDE_SRCS): Split Ada packages.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/Makefile.in.diff?cvsroot=gcc&r1=1.112&r2=1.113

Comment 11 Arnaud Charlet 2005-03-15 16:32:14 UTC
Adding nathanael in cc:

Nathanel, could you have a look at the comment #10 about passing
GCC_FOR_TARGET down to libada/Makefile ?

Arno
Comment 12 Arnaud Charlet 2005-04-29 07:33:32 UTC
*** Bug 21276 has been marked as a duplicate of this bug. ***
Comment 13 Arnaud Charlet 2005-12-12 11:27:41 UTC
This PR should now be fixed, AFAIK.

Fixed by:

<<
libada:
2005-12-05  Paolo Bonzini  <bonzini@gnu.org>

        * Makefile.in (FLAGS_TO_PASS): Add GCC_FOR_TARGET.

gcc/ada:
2005-12-05  Paolo Bonzini  <bonzini@gnu.org>

        * Makefile.in (gnatlib): Fix regex, using \. instead of . when
        a period is meant.
>>