[RFC] * bits/confname.h: Define _CS_POSIX_V7_THREADS_CFLAGS, _CS_POSIX_V7_THREADS_LDFLAGS
Message ID | 20201026233303.16034-1-ericonr@disroot.org |
---|---|
State | Changes Requested, archived |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 11C003948804; Mon, 26 Oct 2020 23:33:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11C003948804 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1603755212; bh=5cxIwFJEqLGuKMiGkp88pgIozJiayHJKEHtUMczMjCo=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=oe8y4ktRitoDnATaEc912HGiPPIBDAR4XvznaJsciXe/e3UHVNPmUFodAY1FnGoPA Xth0X9Hzog8V+yf90ey+XMZOn3h6dCyzuSyYkpapvQFdoiEi8BzihJ1/tYOBdq3HUp NytI5iCCSapcRLuFYA42V/XBTT6rsUKILZasZ7KI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from knopi.disroot.org (knopi.disroot.org [178.21.23.139]) by sourceware.org (Postfix) with ESMTPS id 193CB386182E; Mon, 26 Oct 2020 23:33:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 193CB386182E Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id AB31F535A3; Tue, 27 Oct 2020 00:33:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AOQEVybyB2o0; Tue, 27 Oct 2020 00:33:25 +0100 (CET) To: libc-alpha@sourceware.org Subject: [RFC][PATCH] * bits/confname.h: Define _CS_POSIX_V7_THREADS_CFLAGS, _CS_POSIX_V7_THREADS_LDFLAGS Date: Mon, 26 Oct 2020 20:33:03 -0300 Message-Id: <20201026233303.16034-1-ericonr@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: =?utf-8?q?=C3=89rico_Nogueira_via_Libc-alpha?= <libc-alpha@sourceware.org> Reply-To: =?utf-8?q?=C3=89rico_Nogueira?= <ericonr@disroot.org> Cc: =?utf-8?q?=C3=89rico_Rolim?= <ericonr@disroot.org>, elfutils-devel@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
[RFC] * bits/confname.h: Define _CS_POSIX_V7_THREADS_CFLAGS, _CS_POSIX_V7_THREADS_LDFLAGS
|
|
Commit Message
Érico Nogueira
Oct. 26, 2020, 11:33 p.m. UTC
From: Érico Rolim <ericonr@disroot.org>
I would like to add these enums in order to conform to the POSIX
specification: https://www.man7.org/linux/man-pages/man0/unistd.h.0p.html
This change also helps musl-libc, since they want to have these defines
with the same values as glibc.
I tried to add them for the bits/confname.h and
conform/data/unistd.h-data files following the example of the other
values, but didn't know how to plug them into the confstr / __sysconf
implementations.
bits/confname.h | 7 ++++++-
conform/data/unistd.h-data | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
Comments
On 10/27/20 5:03 AM, Érico Nogueira via Libc-alpha wrote: > From: Érico Rolim <ericonr@disroot.org> > > I would like to add these enums in order to conform to the POSIX > specification: https://www.man7.org/linux/man-pages/man0/unistd.h.0p.html > > This change also helps musl-libc, since they want to have these defines > with the same values as glibc. > > I tried to add them for the bits/confname.h and > conform/data/unistd.h-data files following the example of the other > values, but didn't know how to plug them into the confstr / __sysconf > implementations. It's been a while since I touched this code, but IIRC you need to add your new variables to posix/posix-conf-vars.list. That said, could you please let me know if you have a copyright assignment agreement with the FSF? I suppose this change may be OK given that it is under 20 lines but one of the stewards could confirm for sure. Thanks, Siddhesh > > bits/confname.h | 7 ++++++- > conform/data/unistd.h-data | 2 ++ > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/bits/confname.h b/bits/confname.h > index 5dc8215093..fdc5403697 100644 > --- a/bits/confname.h > +++ b/bits/confname.h > @@ -670,6 +670,11 @@ enum > > _CS_V6_ENV, > #define _CS_V6_ENV _CS_V6_ENV > - _CS_V7_ENV > + _CS_V7_ENV, > #define _CS_V7_ENV _CS_V7_ENV > + > + _CS_POSIX_V7_THREADS_CFLAGS, > +#define _CS_POSIX_V7_THREADS_CFLAGS _CS_POSIX_V7_THREADS_CFLAGS > + _CS_POSIX_V7_THREADS_LDFLAGS > +#define _CS_POSIX_V7_THREADS_LDFLAGS _CS_POSIX_V7_THREADS_LDFLAGS > }; > diff --git a/conform/data/unistd.h-data b/conform/data/unistd.h-data > index aa070528e8..6c4b52a733 100644 > --- a/conform/data/unistd.h-data > +++ b/conform/data/unistd.h-data > @@ -367,6 +367,8 @@ constant _CS_POSIX_V7_LP64_OFF64_LIBS > constant _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS > constant _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS > constant _CS_POSIX_V7_LPBIG_OFFBIG_LIBS > +constant _CS_POSIX_V7_THREADS_CFLAGS > +constant _CS_POSIX_V7_THREADS_LDFLAGS > constant _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS > constant _CS_V7_ENV > # endif >
On 26/10/2020 20:33, Érico Nogueira via Libc-alpha wrote: > From: Érico Rolim <ericonr@disroot.org> > > I would like to add these enums in order to conform to the POSIX > specification: https://www.man7.org/linux/man-pages/man0/unistd.h.0p.html > > This change also helps musl-libc, since they want to have these defines > with the same values as glibc. > > I tried to add them for the bits/confname.h and > conform/data/unistd.h-data files following the example of the other > values, but didn't know how to plug them into the confstr / __sysconf > implementations. I think since we do not export _SC_POSIX_THREADS and now that libpthread symbols were all moved to libc, there is no need return the libpthread for LDFLAGS. However it requires to be handled on confstr and getconf: diff --git a/posix/confstr.c b/posix/confstr.c index 6e3c264462..95fb0f6abc 100644 --- a/posix/confstr.c +++ b/posix/confstr.c @@ -249,6 +249,11 @@ __confstr (int name, char *buf, size_t len) /* GNU libc does not require special actions to use LFS functions. */ break; + case _CS_POSIX_V7_THREADS_CFLAGS: + case _CS_POSIX_V7_THREADS_LDFLAGS: + /* GNU libc does not require special actions to use thread functions. */ + break; + case _CS_GNU_LIBC_VERSION: string = "glibc " VERSION; string_len = sizeof ("glibc " VERSION); diff --git a/posix/getconf.c b/posix/getconf.c index a1adbc4b50..6a5363ad49 100644 --- a/posix/getconf.c +++ b/posix/getconf.c @@ -310,6 +310,8 @@ static const struct conf vars[] = { "POSIX_V7_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, CONFSTR }, { "POSIX_V7_LPBIG_OFFBIG_LIBS", _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, CONFSTR }, { "POSIX_V7_LPBIG_OFFBIG_LINTFLAGS", _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, CONFSTR }, + { "POSIX_V7_THREADS_CFLAGS", _CS_POSIX_V7_THREADS_CFLAGS, CONFSTR }, + { "POSIX_V7_THREADS_LDFLAGS", _CS_POSIX_V7_THREADS_LDFLAGS, CONFSTR }, { "_POSIX_ADVISORY_INFO", _SC_ADVISORY_INFO, SYSCONF }, { "_POSIX_BARRIERS", _SC_BARRIERS, SYSCONF }, Also now that we do not require a copyright assignment, you just need to add a sign-off on the email submission. > > bits/confname.h | 7 ++++++- > conform/data/unistd.h-data | 2 ++ > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/bits/confname.h b/bits/confname.h > index 5dc8215093..fdc5403697 100644 > --- a/bits/confname.h > +++ b/bits/confname.h > @@ -670,6 +670,11 @@ enum > > _CS_V6_ENV, > #define _CS_V6_ENV _CS_V6_ENV > - _CS_V7_ENV > + _CS_V7_ENV, > #define _CS_V7_ENV _CS_V7_ENV > + > + _CS_POSIX_V7_THREADS_CFLAGS, > +#define _CS_POSIX_V7_THREADS_CFLAGS _CS_POSIX_V7_THREADS_CFLAGS > + _CS_POSIX_V7_THREADS_LDFLAGS > +#define _CS_POSIX_V7_THREADS_LDFLAGS _CS_POSIX_V7_THREADS_LDFLAGS > }; > diff --git a/conform/data/unistd.h-data b/conform/data/unistd.h-data > index aa070528e8..6c4b52a733 100644 > --- a/conform/data/unistd.h-data > +++ b/conform/data/unistd.h-data > @@ -367,6 +367,8 @@ constant _CS_POSIX_V7_LP64_OFF64_LIBS > constant _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS > constant _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS > constant _CS_POSIX_V7_LPBIG_OFFBIG_LIBS > +constant _CS_POSIX_V7_THREADS_CFLAGS > +constant _CS_POSIX_V7_THREADS_LDFLAGS > constant _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS > constant _CS_V7_ENV > # endif
On 08/03/2022 13:29, Adhemerval Zanella wrote: > > > On 26/10/2020 20:33, Érico Nogueira via Libc-alpha wrote: >> From: Érico Rolim <ericonr@disroot.org> >> >> I would like to add these enums in order to conform to the POSIX >> specification: https://www.man7.org/linux/man-pages/man0/unistd.h.0p.html >> >> This change also helps musl-libc, since they want to have these defines >> with the same values as glibc. >> >> I tried to add them for the bits/confname.h and >> conform/data/unistd.h-data files following the example of the other >> values, but didn't know how to plug them into the confstr / __sysconf >> implementations. > > I think since we do not export _SC_POSIX_THREADS and now that libpthread > symbols were all moved to libc, there is no need return the libpthread > for LDFLAGS. However it requires to be handled on confstr and getconf: > > diff --git a/posix/confstr.c b/posix/confstr.c > index 6e3c264462..95fb0f6abc 100644 > --- a/posix/confstr.c > +++ b/posix/confstr.c > @@ -249,6 +249,11 @@ __confstr (int name, char *buf, size_t len) > /* GNU libc does not require special actions to use LFS functions. */ > break; > > + case _CS_POSIX_V7_THREADS_CFLAGS: > + case _CS_POSIX_V7_THREADS_LDFLAGS: > + /* GNU libc does not require special actions to use thread functions. */ > + break; > + > case _CS_GNU_LIBC_VERSION: > string = "glibc " VERSION; > string_len = sizeof ("glibc " VERSION); > diff --git a/posix/getconf.c b/posix/getconf.c > index a1adbc4b50..6a5363ad49 100644 > --- a/posix/getconf.c > +++ b/posix/getconf.c > @@ -310,6 +310,8 @@ static const struct conf vars[] = > { "POSIX_V7_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, CONFSTR }, > { "POSIX_V7_LPBIG_OFFBIG_LIBS", _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, CONFSTR }, > { "POSIX_V7_LPBIG_OFFBIG_LINTFLAGS", _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, CONFSTR }, > + { "POSIX_V7_THREADS_CFLAGS", _CS_POSIX_V7_THREADS_CFLAGS, CONFSTR }, > + { "POSIX_V7_THREADS_LDFLAGS", _CS_POSIX_V7_THREADS_LDFLAGS, CONFSTR }, > > { "_POSIX_ADVISORY_INFO", _SC_ADVISORY_INFO, SYSCONF }, > { "_POSIX_BARRIERS", _SC_BARRIERS, SYSCONF }, > > Also now that we do not require a copyright assignment, you just need to add > a sign-off on the email submission. > Also, reference the BZ#25003 [1] on title. https://sourceware.org/bugzilla/show_bug.cgi?id=25003
diff --git a/bits/confname.h b/bits/confname.h index 5dc8215093..fdc5403697 100644 --- a/bits/confname.h +++ b/bits/confname.h @@ -670,6 +670,11 @@ enum _CS_V6_ENV, #define _CS_V6_ENV _CS_V6_ENV - _CS_V7_ENV + _CS_V7_ENV, #define _CS_V7_ENV _CS_V7_ENV + + _CS_POSIX_V7_THREADS_CFLAGS, +#define _CS_POSIX_V7_THREADS_CFLAGS _CS_POSIX_V7_THREADS_CFLAGS + _CS_POSIX_V7_THREADS_LDFLAGS +#define _CS_POSIX_V7_THREADS_LDFLAGS _CS_POSIX_V7_THREADS_LDFLAGS }; diff --git a/conform/data/unistd.h-data b/conform/data/unistd.h-data index aa070528e8..6c4b52a733 100644 --- a/conform/data/unistd.h-data +++ b/conform/data/unistd.h-data @@ -367,6 +367,8 @@ constant _CS_POSIX_V7_LP64_OFF64_LIBS constant _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS constant _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS constant _CS_POSIX_V7_LPBIG_OFFBIG_LIBS +constant _CS_POSIX_V7_THREADS_CFLAGS +constant _CS_POSIX_V7_THREADS_LDFLAGS constant _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS constant _CS_V7_ENV # endif