[cfe-dev] [gentoo-musl] Re: Clang++ always defines _GNU_SOURCE

Anthony G. Basile via cfe-dev cfe-dev at lists.llvm.org
Tue Jun 14 04:42:41 PDT 2016


On 6/14/16 5:54 AM, Lei Zhang wrote:
> 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
> 

That is the better approach.  The problem is that we tend to lump groups
of functions under macros like _GNU_SOURCE or __UCLIBC__ only to run
into problems later.

-- 
Anthony G. Basile, Ph.D.
Gentoo Linux Developer [Hardened]
E-Mail    : blueness at gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA



More information about the cfe-dev mailing list