cross-builds failing
Richard Earnshaw
rearnsha@arm.com
Tue Oct 13 20:57:00 GMT 1998
>
> In message < 199810080903.KAA17244@sun52.NIS.cambridge >you write:
> > Nope, at least, not as of 6pm BST yesterday. I think it is the change to
> > the build rule for cccp.o (which puts libunsubdir in for all the include
> > search paths). Here is the results of running the command with -v
> Ah. Dumb me.
>
This has been fixed now. I guess thanks need to go to Alexandre.
> > Actually, I think this is all somewhat irrelevant, since the compiler
> > shouldn't be looking in the install area when newlib is in the source
> > tree. It should really be getting the headers from
> > ${srcdir}/...../newlib/....
> No, it shouldn't be looking in the newlib sources (or more correctly, it
> does not look there and never has looked there). Sorry, I should have caught
> this earlier.
>
> libgcc2.c instead is supposed to avoid including stdio.h and friends when
> building with newlib.
Any particular reason? (Other than finding the correct include files is
problematical).
>
> Either something is including stdio and unistd unconditionally, or inhibit_libc
> is not being defined.
It isn't defined until about 10 lines later in the file.
/* ??? This is not a good solution, since prototypes may be required in
some cases for correct code. See also frame.c. */
#ifndef inhibit_libc
/* fixproto guarantees these system headers exist. */
#include <stdlib.h>
#include <unistd.h>
#endif
[...]
/* In a cross-compilation situation, default to inhibiting compilation
of routines that use libc. */
#if defined(CROSS_COMPILE) && !defined(inhibit_libc)
#define inhibit_libc
#endif
!!!
>
> The toplevel configure.in should be finding your newlib source directory and
> turning on --with-newlib by default. That in turn causes gcc/Makefile to
> define inhibit_libc which is supposed to prevent the problem include files
> from being included.
>
Ah! The arm ports are overriding LIBGCC2_CFLAGS. I guess this was
probably done before TARGET_LIBGCC2_CFLAGS was added and never fixed up.
Richard.
PS. It has always struck me as somewhat odd that gcc, which is supposedly
an ANSI/ISO C compiler needs a Posix header file (unistd.h) and associated
functions in order to compile its support library.
More information about the Gcc
mailing list