Corinna Vinschen vinschen@redhat.com
Wed Nov 17 21:34:00 GMT 2010

On Nov 17 04:28, Ralf Corsepius wrote:
> On 11/16/2010 06:20 PM, Corinna Vinschen wrote:
> >On Oct  8 17:24, Ralf Corsepius wrote:
> >>Hi,
> >>
> >>similar to Cygwin, compiling newlib for RTEMS needs -D_COMPILING_NEWLIB.
> >>
> >>BTW: I am wondering if -D_COMPILING_NEWLIB shouldn't be supplied
> >>globally for all targets and not only for RTEMS and Cygwin.
> >>
> >>Ralf
> >
> >>2010-10-08	Ralf Cors??pius<ralf.corsepius@rtems.org>
> >>
> >>	* configure.host: Add -D_COMPILING_NEWLIB to newlib_cflags.
> >
> >Patch applied.  I'm not sure it's a good idea to add -D_COMPILING_NEWLIB
> >to all targets.
> Depends on _COMPILING_NEWLIB's semantics.
> >I don't know how RTEMS handles it,
> We are treating it as a newlib-private/internal define which is not
> supposed to be used outside of newlib to denote the fact "we're
> inside of newlib" to expose newlib internal parts.

Actually it's mostly used to make sure that definitions in header files
match what's needed when building newlib, in contrast to what's needed
when building, say, Cygwin or Cygwin applications.  Using _off_t vs.
off_t is an example.  _off_t is 32 bit, off_t on Cygwin is 64 bit.
That's also the reason why the 64 bit stdio functions (fopen64, etc) are
not exposed in stdio.h when built for Cygwin, except when building

The bottom line is, _COMPILING_NEWLIB has been introduced for Cygwin
and it's used *in* Cygwin in certain cases to control header file usage.
So it's not clear if all occurences of _COMPILING_NEWLIB in newlib are
really feasible for other targets, so ...

> >Are you sure that all cases in which `#ifdef _COMPILING_NEWLIB' is used
> >in newlib are also feasible for RTEMS?
> So yes, in my understanding #ifdef _COMPILING_NEWLIB should be
> generally valid.

Well, what I was trying to ask is, did you *check* all usages of
_COMPILING_NEWLIB in newlib if they are feasible for RTEMS?
Fortunately it's not used very often.


Corinna Vinschen
Cygwin Project Co-Leader
Red Hat

More information about the Newlib mailing list