From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id C51BB3857C79 for ; Tue, 8 Mar 2022 16:29:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C51BB3857C79 Received: by mail-oi1-x232.google.com with SMTP id b188so1148570oia.13 for ; Tue, 08 Mar 2022 08:29:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=ghcb88EMKw2ap/32AO/VQAOXWGWjMB2m/fCB+Lg5Kbw=; b=6QrTphRhyPVawuDmMBQ3HyxRR+vByU98blaWMgj9teccg1jaGC3i15qEd2ABqAN1Yo 0cFJJlSQzlJ8wWXYKZJoz7/BfbHDbHInh31TLLzvONJstc1RMI+bl5+9uuBdhZdluikx iUUUP7f7weJm9e4wmL6UwIp6xmyt75PV/m+CSrgLNvoD9IXCDm7IPjbf47VKAL87/AsV C0DxcFBCSKlELUs33T1F/wZDwwHy1ahmAtHGtm3CzMfZRqyC7vMGFUQmhSsZ0VlaUplB 4vHvKgI6ezuEEfoLG1ETxOTvcJ87u6aYGvhHYdaM5ouR42mYdAA2ekQdpjZRb2yxe3vr 1odA== X-Gm-Message-State: AOAM5323JIzgEOHROhSBNtdUw4iHSXayn+KncT4Cd6WpHEwWBw8qbkoV VAk+1JfZebtPUHtw02bHUL2J2w== X-Google-Smtp-Source: ABdhPJy5JT2WkXLM35nJOPnVv/eNKjptvQIiX9HK3+4guHdXyXUqqv0AyMiCmeTiH+BK0jB5qAtIVA== X-Received: by 2002:a05:6808:208c:b0:2da:10e3:c70 with SMTP id s12-20020a056808208c00b002da10e30c70mr1866839oiw.42.1646756991073; Tue, 08 Mar 2022 08:29:51 -0800 (PST) Received: from ?IPV6:2804:431:c7ca:2dcb:7122:6b3a:c840:afc7? ([2804:431:c7ca:2dcb:7122:6b3a:c840:afc7]) by smtp.gmail.com with ESMTPSA id y2-20020a056808130200b002d542a72882sm8422952oiv.3.2022.03.08.08.29.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Mar 2022 08:29:50 -0800 (PST) Message-ID: Date: Tue, 8 Mar 2022 13:29:48 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC][PATCH] * bits/confname.h: Define _CS_POSIX_V7_THREADS_CFLAGS, _CS_POSIX_V7_THREADS_LDFLAGS Content-Language: en-US To: =?UTF-8?Q?=c3=89rico_Nogueira?= , libc-alpha@sourceware.org Cc: elfutils-devel@sourceware.org, Rich Felker References: <20201026233303.16034-1-ericonr@disroot.org> From: Adhemerval Zanella In-Reply-To: <20201026233303.16034-1-ericonr@disroot.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2022 16:29:53 -0000 On 26/10/2020 20:33, Érico Nogueira via Libc-alpha wrote: > From: Érico Rolim > > 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