[cfe-dev] Clang++ always defines _GNU_SOURCE

Lei Zhang via cfe-dev cfe-dev at lists.llvm.org
Tue Jun 14 02:54:58 PDT 2016


2016-06-14 16:54 GMT+08:00 Eric Fiselier <eric at efcs.ca>:
>>  Does libc++ also rely on this macro to work on Linux?
>
> Yes. Adding -U_GNU_SOURCE during the libc++ build results in a litany of
> errors.
> The libc++ headers depend on a number of C library symbols that only get
> defined when -D_GNU_SOURCE=1 is present.

Is it feasible to use some finer-grain control like _ISOC99_SOURCE,
instead of resorting to the too versatile _GNU_SOURCE?

I'd be willing to work out such a patch to libc++, if it makes sense.


Lei



More information about the cfe-dev mailing list