public inbox for gentoo-musl@lists.gentoo.org
 help / color / mirror / Atom feed
From: Lei Zhang <zhanglei.april@gmail.com>
To: Luca Barbato <lu_zero@gentoo.org>
Cc: gentoo-musl@lists.gentoo.org
Subject: Re: [gentoo-musl] [GSoC] _GNU_SOURCE in C++
Date: Fri, 17 Jun 2016 19:13:52 +0800	[thread overview]
Message-ID: <CAOYuCc2wNubtTN7Va_RD+GXhMuRvRa=Ujf2tUObdLztZik8Vqg@mail.gmail.com> (raw)
In-Reply-To: <CAOYuCc0RfPW1Zpvm+datU5oU9KYLcZhW2vovcMRA1570F2ea1g@mail.gmail.com>

2016-06-17 19:12 GMT+08:00 Lei Zhang <zhanglei.april@gmail.com>:
> 2016-06-16 21:42 GMT+08:00 Lei Zhang <zhanglei.april@gmail.com>:
>> 2016-06-16 21:13 GMT+08:00 Luca Barbato <lu_zero@gentoo.org>:
>>> On 16/06/16 14:47, Lei Zhang wrote:
>>>> 2016-06-16 17:43 GMT+08:00 Luca Barbato <lu_zero@gentoo.org>:
>>>>> On 16/06/16 05:36, Lei Zhang wrote:
>>>>>> Attached is what I've got so far.
>>>>>>
>>>>>> Some of them are not documented in man pages, so I checked their
>>>>>> declarations in musl's headers. Functions strtold_l, strtoll_l and
>>>>>> strtoull_l are not available in musl, but libc++ is smart enough to
>>>>>> not use them when linked against musl.
>>>>
>>>> I made a mistake. Actually strtold_l *is* available in musl, but
>>>> hidden by _GNU_SOURCE.
>>>
>>> Not hidden by _BSD_SOURCE as well?
>>
>> No, only by _GNU_SOURCE.
>>
>>>>> beside vasprintf, the rest is covered by _XOPEN_SOURCE 700
>>>>>
>>>>> Might be worth trying to do -U_GNU_SOURCES -D_XOPEN_SOURCE=700 and see
>>>>> how it goes.
>>>>
>>>> So far vasprintf and strtold_l are not covered. vasprintf can be
>>>> covered with -D_BSD_SOURCE. But _BSD_SOURCE is deprecated since glibc
>>>> 2.20; I don't know if this has any impact on musl.
>>>
>>> It should not and -D_BSD_SOURCE should be fine for musl.
>>
>> I just found that vasprintf is only protected by _GNU_SOURCE in glibc,
>> which means in this case _BSD_SOURCE only works for musl.
>>
>>>>> How vasprintf is used?
>>>>
>>>> It's used by <locale>. The code is kinda hard to read; I can't tell
>>>> exactly what it's doing...
>>>
>>> same for the _l variants I guess.
>>
>> So what now? So far strtold_l still needs _GNU_SOURCE in musl;
>> strtold_l, strtoll_l, strtoull_l and vasprintf all need _GNU_SOURCE in
>> glibc.
>
> To sum it up:
>
> * As for musl, "-U_GNU_SOURCES -U_GNU_SOURCES=700 -D_BSD_SOURCE"
> covers every symbol needed by libc++ except for strtold_l.

Sorry, it should be "-U_GNU_SOURCE -D_XOPEN_SOURCE=700 -D_BSD_SOURCE"

Lei


  reply	other threads:[~2016-06-17 11:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14  7:44 [gentoo-musl] [GSoC] _GNU_SOURCE in C++ Lei Zhang
2016-06-14  8:10 ` Felix Janda
2016-06-14  8:28   ` Lei Zhang
     [not found]     ` <4228046b-02f1-1b65-f56d-6e79347e4390@gentoo.org>
2016-06-14  9:17       ` Lei Zhang
     [not found]         ` <20302d1d-92ff-1c4b-8939-08894c3589ca@gentoo.org>
2016-06-14  9:35           ` Lei Zhang
     [not found]             ` <8e7cafd9-97c7-6ca1-ad3f-95bdb0060ce0@gentoo.org>
2016-06-14 11:48               ` Lei Zhang
     [not found]                 ` <e1f362ee-7755-9a54-78e3-19e0733ebd3b@gentoo.org>
2016-06-15  1:45                   ` Lei Zhang
     [not found]                     ` <19f9f66f-5dd4-786a-3b29-0a57c407548e@gentoo.org>
2016-06-16  3:36                       ` Lei Zhang
     [not found]                         ` <1c93fa87-e2c3-2737-1222-ae93003e21ad@gentoo.org>
2016-06-16 12:47                           ` Lei Zhang
     [not found]                             ` <7d6fa9d6-1134-1d2a-1d06-33029b82429d@gentoo.org>
2016-06-16 13:42                               ` Lei Zhang
2016-06-17 11:12                                 ` Lei Zhang
2016-06-17 11:13                                   ` Lei Zhang [this message]
     [not found]                                   ` <37117cc0-2af1-306d-6ec5-d8d37d8c588c@gentoo.org>
2016-06-17 12:44                                     ` Lei Zhang
2016-06-21  4:54                                       ` Lei Zhang
2016-06-22 13:21                                         ` Lei Zhang
2016-06-22 13:54                                         ` Lei Zhang
2016-06-22 14:02                                           ` Lei Zhang
2016-06-14  9:55     ` Felix Janda
     [not found] ` <20160615033804.GA2473@gmail.com>
2016-06-15  3:55   ` Lei Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOYuCc2wNubtTN7Va_RD+GXhMuRvRa=Ujf2tUObdLztZik8Vqg@mail.gmail.com' \
    --to=zhanglei.april@gmail.com \
    --cc=gentoo-musl@lists.gentoo.org \
    --cc=lu_zero@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox