From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 35ED11382BD for ; Fri, 17 Jun 2016 11:12:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 57955E08AE; Fri, 17 Jun 2016 11:12:10 +0000 (UTC) Received: from mail-oi0-f68.google.com (mail-oi0-f68.google.com [209.85.218.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CB138E08AE for ; Fri, 17 Jun 2016 11:12:09 +0000 (UTC) Received: by mail-oi0-f68.google.com with SMTP id a64so13106208oii.1 for ; Fri, 17 Jun 2016 04:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CKxy3TiJ4eBnWZUjCszu0YnfyLK+TZ0p5vwbO9wG5UA=; b=dX3I+HfhbqzSxJKUpvu445vlwDcTHyQJtUEjJbhTO9t8eei2TLiK2bMbTd95lTX23d 1mrBns1RoPA+FHw8xsk5hauR0GdZ+KThSg4k6gwnsjSWG8NgEj6gC4vqc8L7dzZRi6J/ 4/9vhglf3i8JwWuAOEiVB2f2wUgYOKtBoq+jc4REQvr8sC7j7+wSynPKD5EZOPF84f7g gVQWthrBFsM0uTLc+K3WK1O92GWXpHitoajB0QOev/sLMAWdbe+2xmoafHbj7t5eOuLN 0pahhtplzly0mtwtZOW+7OpP5LoUDxb939csudh0EN7B7lGzqma3Vw2qaWOEiks6S38x 7Bwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CKxy3TiJ4eBnWZUjCszu0YnfyLK+TZ0p5vwbO9wG5UA=; b=grSMkMfVEp8tPZj4vUAgXpUxwf2WjOu3YGuQd0sZ5lDnh18kwfMMhleLN23UN08WEX zvu1/l8KgxM6oSJiYQUIsHWqeSh6gtQeZCobc9Xv/4l5/oeQ5LAbSbA0lpA0oRk01NeC idp/EWYI351XlSvL2XYID2fDb4gPO1WBFNohLWBpkoQaP73RQvUd2KsU0Nc49Uy1IcBP a/PGGzb6x60b2zbe4FP1m4X+WMV/03mpeIUUIRmUffz7fpIYu4CoTyawo86Y52UU9T3C KmGP0NgI4tOsniYiChgqPERre2437Ymmo0R5x6BpUnLuDoV35G/16v8jVWS7xVjwWKjp 4ooQ== X-Gm-Message-State: ALyK8tJt67nHavTGIAfGpBqAs/EC+8tbw/OkzDvNaWUxXXhVjc8Bn/x/2mRgLlBM5OmNjUtQOpZYakDz0rY6TQ== X-Received: by 10.157.12.72 with SMTP id 66mr1112817otr.192.1466161928950; Fri, 17 Jun 2016 04:12:08 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo musl list X-BeenThere: gentoo-musl@gentoo.org X-BeenThere: gentoo-musl@lists.gentoo.org MIME-Version: 1.0 Received: by 10.202.63.212 with HTTP; Fri, 17 Jun 2016 04:12:08 -0700 (PDT) In-Reply-To: References: <20160614081043.GA364@nyan> <4228046b-02f1-1b65-f56d-6e79347e4390@gentoo.org> <20302d1d-92ff-1c4b-8939-08894c3589ca@gentoo.org> <8e7cafd9-97c7-6ca1-ad3f-95bdb0060ce0@gentoo.org> <19f9f66f-5dd4-786a-3b29-0a57c407548e@gentoo.org> <1c93fa87-e2c3-2737-1222-ae93003e21ad@gentoo.org> <7d6fa9d6-1134-1d2a-1d06-33029b82429d@gentoo.org> From: Lei Zhang Date: Fri, 17 Jun 2016 19:12:08 +0800 Message-ID: Subject: Re: [gentoo-musl] [GSoC] _GNU_SOURCE in C++ To: Luca Barbato Cc: gentoo-musl@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 54ab6cad-ac82-4dff-ad8a-300891b14900 X-Archives-Hash: a12c96ca05113d204eb6f22b97b6a4c7 2016-06-16 21:42 GMT+08:00 Lei Zhang : > 2016-06-16 21:13 GMT+08:00 Luca Barbato : >> On 16/06/16 14:47, Lei Zhang wrote: >>> 2016-06-16 17:43 GMT+08:00 Luca Barbato : >>>> 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 . 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. * As for glibc, "-U_GNU_SOURCE -D_ISOC11_SOURCE -D_DEFAULT_SOURCE" covers everything except for strtold_l, strtoll_l, strtoull_l and vasprintf. Lei