This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Autoconf stanza to test for Newlib?


Am 13.11.2017 um 21:02 schrieb Jeffrey Walton:

I wanted to give this some more thought before replying, so sorry
about the late reply. I know the issue you are referring to -
libstdc++ running fast and loose, and making too many symbols
available in C++ by default.

No, that's not the issue I was pointing at. libstdc++ has nothing to do with it.

The feature test macros, including _XOPEN_SOURCE, exist to turn on/off various extensions of the bare ISO Standard C runtime library. C++ only gets those same extensions by references. The question whether code needs those macros set to work is determined by that source code itself, not by which libc is in use.

That means the question whether to set that macro has no relation at all to whether the libc is newlib or not. You just don't need to know one to decide about the other.

At this point I think I would like to solve the concrete problem that
exists rather than problems that don't exist.

And I remain unconvinced that the problem you claim exists, actually does.

I'm currently using:

   AC_MSG_CHECKING([if runtime library is Newlib])
   AC_PREPROC_IFELSE([AC_LANG_PROGRAM([#include <_newlib_version.h>])],
     [AC_MSG_RESULT([yes]); AC_SUBST([tr_RESULT], [1])],
     [AC_MSG_RESULT([no]); AC_SUBST([tr_RESULT], [0])]
   )

That check is flawed because it doesn't test what it says it does. It detects whether the compiler can _find_ (some part of) newlib, not whether the active libc is newlib.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]