[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in
From: |
Sam James |
Subject: |
Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment? |
Date: |
Sat, 10 Sep 2022 16:55:57 +0100 |
> On 10 Sep 2022, at 16:48, Thomas Dickey <dickey@his.com> wrote:
>
> On Sat, Sep 10, 2022 at 02:47:50PM +0100, Sam James wrote:
>>
>>
>>> On 10 Sep 2022, at 14:11, Thomas Dickey <dickey@his.com> wrote:
>>>
>>> On Fri, Sep 09, 2022 at 01:49:05AM +0100, Sam James wrote:
>>>>
>>>>
>>>>> On 9 Sep 2022, at 01:02, Sam James <sam@gentoo.org> wrote:
>>>>> [snip]
>>>>>
>>>>>>> This is on a musl + Clang system (details below for how
>>>>>>> to reproduce).
>>>>>>
>>>>>> none of the systems that I develop on have musl.
>>>>>> (you're free to submit a patch, if you use musl).
>>>>>>
>>>>>
>>>>> Thanks, I'll take a look.
>>>>
>>>> So, if I just do e.g.
>>>> ```
>>>> --- a/Ada95/aclocal.m4
>>>> +++ b/Ada95/aclocal.m4
>>>
>>> actually that would be the top-level aclocal.m4 (this particular file
>>> is used for building AdaCurses separately from the main sources).
>>
>> Right, I just patched all the files identically but changed
>> some so copied that part to illustrate an example change.
>>
>>>
>>>> @@ -5056,6 +5056,9 @@ case "$host_os" in
>>>> cf_xopen_source="-D_SGI_SOURCE"
>>>> cf_XOPEN_SOURCE=
>>>> ;;
>>>> +(linux*musl*)
>>>> + CF_TRY_XOPEN_SOURCE
>>>> + ;;
>>>
>>> that part looks right
>>>
>>>> (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
>>>> CF_GNU_SOURCE($cf_XOPEN_SOURCE)
>>>> ;;
>>>> ```
>>>>
>>>> It's insufficient because it thinks we don't need to set it.
>>>>
>>>> Apparently this is because when building a test program
>>>> with
>>>> #include <stdlib.h>
>>>> #include <string.h>
>>>> #include <sys/types.h>
>>>> This ends up enabling XOPEN_SOURCE (some header
>>>> is defining it, I guess).
>
> one or more of these should be defining _XOPEN_SOURCE
> (I'd expect the first, of course).
>
It looks like /usr/include/features.h is the only libc header defining it
on this system, with a hacky grep:
```
# grep -rsin "#define.*_XOPEN_SOURCE" /usr/include
/usr/include/features.h:16:#define _XOPEN_SOURCE 700
/usr/include/awk/awk.h:47:#define _XOPEN_SOURCE_EXTENDED 1
/usr/include/awk/custom.h:92:#define _XOPEN_SOURCE_EXTENDED 1
/usr/include/python3.10/pyconfig.h:1720:#define _XOPEN_SOURCE 700
/usr/include/python3.10/pyconfig.h:1723:#define _XOPEN_SOURCE_EXTENDED 1
/usr/include/python3.11/pyconfig.h:1867:#define _XOPEN_SOURCE 700
/usr/include/python3.11/pyconfig.h:1870:#define _XOPEN_SOURCE_EXTENDED 1
```
features.h: http://sprunge.us/cNkSTH.
Best,
sam
signature.asc
Description: Message signed with OpenPGP
- Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment?, Sam James, 2022/09/08
- Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment?, Thomas Dickey, 2022/09/08
- Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment?, Sam James, 2022/09/08
- Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment?, Sam James, 2022/09/09
- Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment?, Thomas Dickey, 2022/09/10
- Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment?, Sam James, 2022/09/10
- Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment?, Thomas Dickey, 2022/09/10
- Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment?,
Sam James <=
- Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment?, Thomas Dickey, 2022/09/10
- Re: Missing -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 in pkg-config files in Clang + LLVM environment?, Sam James, 2022/09/10