From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 7AA861F5AE for ; Sun, 2 May 2021 20:46:21 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 94E1B383303A; Sun, 2 May 2021 20:46:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94E1B383303A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619988380; bh=UnS/s0l+Jlgit13wUFuKGQbaNs/2MaSzQ3vlASOZt8k=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=vNtBiYGm2HvFqo8QDFNYtqQl+igmvbwmYf7DzW6GYbV39kWOlgKsLxnpT2BHIun00 6lF4Fg3n0l5b8mvyyR8N2PVg3vug+zMeh/JBded/2Lr5XiE6RxNnBnByl7UOSChw4L XRJeeTGWSRkpvpxwcw6WXJsRhgsP+6Af4Wz5EOHU= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id F08F73844013 for ; Sun, 2 May 2021 20:46:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F08F73844013 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-576-eJOh7cO4NWWyk2vvSIr5nw-1; Sun, 02 May 2021 16:46:07 -0400 X-MC-Unique: eJOh7cO4NWWyk2vvSIr5nw-1 Received: by mail-qv1-f70.google.com with SMTP id d11-20020a0cdb0b0000b02901c0da4391d5so3579688qvk.12 for ; Sun, 02 May 2021 13:46:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=UnS/s0l+Jlgit13wUFuKGQbaNs/2MaSzQ3vlASOZt8k=; b=DXOMG8RSjnwjhxe5famtvl6aLTVV+HOBoTHA3qdtwWc4H8a2NIzaBsZ2X2jzziHajP 68Lgcfr+gY74Pi7Yb0GHce2XKkJYHH+EXfs98C/PjKqyNZni2UShq/CPJe+yLTHxlG+p 1uTfGWqKTB/J7QBwaw8nX8kNi2PVE38juTi3H5ONlwDEsskBRkbcmT/A2eCL8+j88wl4 6c8QTUmBSfWRN45/zQnaLhiXcnx1Up11Bhbm9zhIUOPive5dr0HzNeKT6RvKJJwb3glO 7Qh8llRRoLVCzCKaX6xgn/CapI2Kw32G+mScKXaHj7wdE6PwZjr8CW4wnOp7kMsI2LW7 0VGQ== X-Gm-Message-State: AOAM530vfqgXXFU2cncQzF4gXOmfYa9sd3anRUQuh/DC8f7IYhutB1Hv Xy9FQMnzFA4iANFA/1LgFY9Z/83JjYMMwJtGTYnFzAQQAOiJgzvGWukhCU2ikYZS94KJL2oDB3c T3WjNNZGYu5eFqTIaFv6KgUOySCSbrDpSU7A/cvSHZswk5TP88N6BudSAQCY58fvgBsqj9A== X-Received: by 2002:a05:622a:15d6:: with SMTP id d22mr2933265qty.209.1619988367014; Sun, 02 May 2021 13:46:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbB8Iswu4MAIK9tow/HxMH5W4/QaC3p7sFDK8iC7QqUhbLP3I5AhzscQo/iXEmyt7BdG3Afw== X-Received: by 2002:a05:622a:15d6:: with SMTP id d22mr2933252qty.209.1619988366698; Sun, 02 May 2021 13:46:06 -0700 (PDT) Received: from [192.168.1.16] (198-84-214-74.cpe.teksavvy.com. [198.84.214.74]) by smtp.gmail.com with ESMTPSA id f7sm6998506qtv.53.2021.05.02.13.46.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 May 2021 13:46:06 -0700 (PDT) Subject: Re: [PATCH 01/19] Add pthread-in-libc, libpthread-routines-var, librt-routines-var To: Florian Weimer , libc-alpha@sourceware.org References: <62101950200ba00285cf57a6e83aa4ef03816160.1619456219.git.fweimer@redhat.com> Organization: Red Hat Message-ID: <8572b7a0-b993-7d18-518b-2ee3074d30a8@redhat.com> Date: Sun, 2 May 2021 16:46:05 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <62101950200ba00285cf57a6e83aa4ef03816160.1619456219.git.fweimer@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Carlos O'Donell via Libc-alpha Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On 4/26/21 1:00 PM, Florian Weimer via Libc-alpha wrote: > These make variables can be used to add routines to different > libraries for the Hurd and Linux builds. Tested and reviewed on x86_64 and i686. LGTM. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell > --- > Makeconfig | 11 +++++++++++ > config.h.in | 3 +++ > config.make.in | 1 + > configure | 8 ++++++++ > configure.ac | 6 ++++++ > rt/Makefile | 2 ++ > sysdeps/mach/hurd/configure | 3 +++ > sysdeps/mach/hurd/configure.ac | 3 +++ > sysdeps/pthread/Makefile | 3 +++ > 9 files changed, 40 insertions(+) > > diff --git a/Makeconfig b/Makeconfig > index 01f8638c2e..1d5e45926c 100644 > --- a/Makeconfig > +++ b/Makeconfig > @@ -1328,6 +1328,17 @@ endif > sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\ > $(firstword $(subst :, ,$p)))) > > +# $(libpthread-routines-var) and $(librt-routines-var) are the make > +# variable to which pthread routines need to be added to land in the > +# right library. > +ifeq ($(pthread-in-libc),yes) > +libpthread-routines-var = routines > +librt-routines-var = routines > +else > +libpthread-routines-var = libpthread-routines > +librt-routines-var = libpthread-routines > +endif OK. Makes sense and refactors this with a level of indirection that avoids needing to duplicate any more files. > + > # A sysdeps Makeconfig fragment may set libc-reentrant to yes. > ifeq (yes,$(libc-reentrant)) > defines += -D_LIBC_REENTRANT > diff --git a/config.h.in b/config.h.in > index ea56e5b4a4..99036b887f 100644 > --- a/config.h.in > +++ b/config.h.in > @@ -200,6 +200,9 @@ > multiple symbol versions for one symbol. */ > #define SYMVER_NEEDS_ALIAS 0 > > +/* Define to 1 if libpthread actually resides in libc. */ > +#define PTHREAD_IN_LIBC 0 > + > /* > */ > > diff --git a/config.make.in b/config.make.in > index 7f47f0caa4..cbf59114b0 100644 > --- a/config.make.in > +++ b/config.make.in > @@ -103,6 +103,7 @@ use-nscd = @use_nscd@ > build-hardcoded-path-in-tests= @hardcoded_path_in_tests@ > build-pt-chown = @build_pt_chown@ > have-tunables = @have_tunables@ > +pthread-in-libc = @pthread_in_libc@ > > # Build tools. > CC = @CC@ > diff --git a/configure b/configure > index e64b7f8efe..4cc462613c 100755 > --- a/configure > +++ b/configure > @@ -588,6 +588,7 @@ ac_unique_file="include/features.h" > enable_option_checking=no > ac_subst_vars='LTLIBOBJS > LIBOBJS > +pthread_in_libc > RELEASE > VERSION > mach_interface_list > @@ -6780,6 +6781,7 @@ libc_cv_sysconfdir=$sysconfdir > libc_cv_localstatedir=$localstatedir > libc_cv_gcc_unwind_find_fde=no > libc_cv_idn=no > +pthread_in_libc=yes > > # Iterate over all the sysdep directories we will use, running their > # configure fragments. > @@ -6939,6 +6941,12 @@ RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h` > > > > +if test "$pthread_in_libc" = yes; then > + $as_echo "#define PTHREAD_IN_LIBC 1" >>confdefs.h > + > +fi > + > + > ac_config_files="$ac_config_files config.make Makefile" > > ac_config_commands="$ac_config_commands default" > diff --git a/configure.ac b/configure.ac > index cc47e56e82..64be29d877 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -1777,6 +1777,7 @@ libc_cv_sysconfdir=$sysconfdir > libc_cv_localstatedir=$localstatedir > libc_cv_gcc_unwind_find_fde=no > libc_cv_idn=no > +pthread_in_libc=yes > > # Iterate over all the sysdep directories we will use, running their > # configure fragments. > @@ -1903,6 +1904,11 @@ RELEASE=`sed -n -e 's/^#define RELEASE "\([^"]*\)"/\1/p' < $srcdir/version.h` > AC_SUBST(VERSION) > AC_SUBST(RELEASE) > > +if test "$pthread_in_libc" = yes; then > + AC_DEFINE(PTHREAD_IN_LIBC) > +fi > +AC_SUBST(pthread_in_libc) > + > AC_CONFIG_FILES([config.make Makefile]) > AC_CONFIG_COMMANDS([default],[[ > case $CONFIG_FILES in *config.make*) > diff --git a/rt/Makefile b/rt/Makefile > index 7b374f2073..c1a0fdeb46 100644 > --- a/rt/Makefile > +++ b/rt/Makefile > @@ -39,6 +39,8 @@ librt-routines = $(aio-routines) \ > $(timer-routines) \ > $(shm-routines) $(mq-routines) > > +$(librt-routines-var) = \ > + > tests := tst-shm tst-timer tst-timer2 \ > tst-aio tst-aio64 tst-aio2 tst-aio3 tst-aio4 tst-aio5 tst-aio6 \ > tst-aio7 tst-aio8 tst-aio9 tst-aio10 \ > diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure > index 537f235077..4876e1f176 100644 > --- a/sysdeps/mach/hurd/configure > +++ b/sysdeps/mach/hurd/configure > @@ -45,3 +45,6 @@ fi > if test -n "$sysheaders"; then > CPPFLAGS=$OLD_CPPFLAGS > fi > + > +# Hurd has libpthread as a separate library. > +pthread_in_libc=no > diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac > index eab0e5b6c1..9a049b1d86 100644 > --- a/sysdeps/mach/hurd/configure.ac > +++ b/sysdeps/mach/hurd/configure.ac > @@ -26,3 +26,6 @@ fi > if test -n "$sysheaders"; then > CPPFLAGS=$OLD_CPPFLAGS > fi > + > +# Hurd has libpthread as a separate library. > +pthread_in_libc=no > diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile > index ed15c1e433..8133bcda8f 100644 > --- a/sysdeps/pthread/Makefile > +++ b/sysdeps/pthread/Makefile > @@ -39,6 +39,9 @@ libpthread-routines += thrd_create thrd_detach thrd_exit thrd_join \ > cnd_destroy cnd_init cnd_signal cnd_timedwait cnd_wait \ > tss_create tss_delete tss_get tss_set > > +$(libpthread-routines-var) += \ > + > + > tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \ > tst-cnd-timedwait tst-thrd-detach tst-mtx-basic tst-thrd-sleep \ > tst-mtx-recursive tst-tss-basic tst-call-once tst-mtx-timedlock \ > -- Cheers, Carlos.