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 5535C1382BD for ; Fri, 17 Jun 2016 11:13:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CEAA5E09A6; Fri, 17 Jun 2016 11:13:53 +0000 (UTC) Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) (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 6972BE09A6 for ; Fri, 17 Jun 2016 11:13:53 +0000 (UTC) Received: by mail-oi0-f66.google.com with SMTP id a64so13113008oii.1 for ; Fri, 17 Jun 2016 04:13:53 -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=tBKg2zHidgxIJGI4DuRn6rzRX9CaEKrjfo9ESNOpvM4=; b=nVvZ74T+JNna8Jb2xfJMPTCDH/q0UQvdjCfh0H3v8b5tY8vhBR8ZuNNcyZWfHwujuO rvh9HE7bLBOAw1CDRgaEaJiKLaz8PnbkpgfXTYVr93vR8erSl6EM6YnGE5R+bwBzEHPG jTPksga57QTAk92SgGmb73FxtbbHS5FHYB2Oxsx/O5zg1fxthpA/GqruVpnjXBEllHvi WVwes4oGCAc6of/JToD1QhFs6sxjbTx2T9kzFzhXCny8UpY8BQAEeNqeZFUqrhQvnVXC Vq0eP/2B8rb94L11LXapuuD9Rq8ASCguT1vkyoh3sKzMKiVzjPxvxV1yzpExrlG+d6MB AJ3Q== 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=tBKg2zHidgxIJGI4DuRn6rzRX9CaEKrjfo9ESNOpvM4=; b=lmhfNlGHVJDmPBPDIxQ/nh8nnyuFKD3uuh6S/yfXQvh5iAbJsMwWT+GCa68VLS7qGy DUnKpD/+OhPc+/2roePeLq3q8Y+64V5vXvkeHZas0kGktr0V8GZYZpOLIB97iL+r9Yx+ nhPBIQO8NxFMvcfc2bGyX//IVei0HE6vTgXjoTQfTdNZ9D/Hku5d/NutkY0+ms+aIs8/ SkYbfbFBZwzd8ZoQNFU46A9+xKVTetbs/dSNUlre4Il5+PO+ekfemsQQEepCRKu8gNHd 0vrDCWbc2qy7gKyxfmo4dpZ9uTZixHpCD97V3TXlGFsyXJtuO6sv1nwb9AK41v7VCW/i eBcg== X-Gm-Message-State: ALyK8tLJ86NOpJMltk/HMxAKfPs9o2oa9y8B6xstaw44pObraJrYNusvJWPfPIeJZXvbdK5sGnyWYFh1iXerFA== X-Received: by 10.157.12.246 with SMTP id o51mr1142346otd.72.1466162032697; Fri, 17 Jun 2016 04:13:52 -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:13:52 -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:13:52 +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: cbcd402d-c4a1-4690-9759-9bca0fd29e2c X-Archives-Hash: c187ea59374552a00ffad607f988b2dd 2016-06-17 19:12 GMT+08:00 Lei Zhang : > 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. Sorry, it should be "-U_GNU_SOURCE -D_XOPEN_SOURCE=700 -D_BSD_SOURCE" Lei