This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Getting glibfortran to build on newlib targets aka. missing stdint.h (PR 14325)
"Joseph S. Myers" <joseph@codesourcery.com> writes:
> On Sun, 7 Nov 2004, Hans-Peter Nilsson wrote:
>
>> Ok, strike the asterisked part. Should I interpret your answer
>> as an approval of direction generally, for a GCC-provided
>> stdint.h along the directions in PR 448? Now in stage3
>> (provided it's ok with RM) or next stage1? (Not providing
>> stdint.h is arguably a bug.)
>
> GCC should provide <stdint.h>. I think any implementation taking account
> of the points discussed in that bug would be welcome in stage 1 or stage 2
> at least and you should be able to get help identifying what the types
> should be for any targets you don't have access to which already have
> their own <inttypes.h> or <stdint.h>.
Reasoning by analogy from the <limits.h> mess, I think it is important
that GCC not ever override the system <stdint.h> where it exists (if
it exists but is broken, that is a fixincludes problem).
It might be appropriate for GCC to distinguish between headers where
our own implementation *must* be used (stdarg.h most notably); headers
provided by the C library that we have to mangle in order to get them
to work with GCC; and headers where a hosted C library's
implementation is likely to be just fine, but we have to provide one
too in order to be a conforming freestanding implementation.
Currently all three are thrown into $(prefix)/lib/gcc/T/V/include, and
there are common use cases where we don't want one or more of those
sets.
One way to make the distinction more sensible is to have three
directories in libsubdir: call them include, include-fixed,
include-freestanding. The normal search order is include,
include-fixed, /usr/include, include-freestanding; thus, C library
versions of the headers in category 3 above automatically override the
versions we provide. Putting -ffreestanding on the command line
causes include-fixed and /usr/include to be dropped from the search
path, which is the Right Thing for kernels and suchlike.
zw