From patchwork Tue Sep 4 20:45:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 145962 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4124806ljw; Tue, 4 Sep 2018 13:46:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaUNv7cZFXETKsbngS52lmRqQw3DLPet1O6IxIX2maj7wXW0H4w2z4ra+j4RHaQlXxvCBMT X-Received: by 2002:a63:4204:: with SMTP id p4-v6mr7319948pga.200.1536093992439; Tue, 04 Sep 2018 13:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536093992; cv=none; d=google.com; s=arc-20160816; b=1B82iPLqL7iKCXg+7CUeYdxKCaz6fVfXfJ1mEMaZ7bLxh9dnyr3WIt3UMBrTjY1KpE sE808ifFaPtfyIfBrmQSEEsXAeghGVmwPaQidWwRTXyxVbywSTvzQgn69uytV0Aqt0wE QLPWQWzKg6ZE2Jpu4zSr8IFgXUtZUS47Ur6Xzm817csmPLmWlH9opyEPFxSyTjfDNLoD nlaN2m2BdSwbecGyKgaNtEPmUkDhrJ9iKGunaQsbqt/+E5tmbKmCPWq1wb/18PemUuAQ RhRBcZ/4WsrrnaUpa5gkbidKxJbIoTRBTkyah8uySszmtGkmFFTe+3DkPb4Tdn+v/S/O xsOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature:arc-authentication-results; bh=3WO08ksBBBLrI3JUtlQXlzoEhmvKHd5ulElkGo0j8H0=; b=zDZkApW0qOTK36jPf7AXoL4qrrRwzyV8S9oqDHI7Lqv1wQKmhaG2VDgj7dDCHCG9sI jO9UvJVLblWcX+DY1uYgybeEZrARV09D9bWRGIETMl0kDMmNNwKAIQuhzq+QNSGxC+2Y 19rup4i0w6FqeEf+mKBF4x5mh9erVDD40qwfESxt4JNBCWPGvwdX1iuxOMpbTe8+0+dM +NzzFZ9aAS8uhYrxEllGJ+0S1DwR7la0juVwdDC2uL6PhyoWfW0Io1e/SB4Ey0VWDgpZ OTN7zqkx6GHKyH2TE3psAuQoA03Qe/bQo/NR6RvoC4lWqqOZrCYgFnHWMB/LZ72aqs5W NGdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ccsK0l8v; dkim=pass header.i=@linaro.org header.s=google header.b="iDIK5Oi/"; spf=pass (google.com: domain of libc-alpha-return-95669-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-95669-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u70-v6si21162820pgd.296.2018.09.04.13.46.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 13:46:32 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-95669-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ccsK0l8v; dkim=pass header.i=@linaro.org header.s=google header.b="iDIK5Oi/"; spf=pass (google.com: domain of libc-alpha-return-95669-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-95669-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=KtS+yIWC6gyqovWJk3CRgmpOMcJWG5m ATbrnjpg6uDmH72qfY+hmdTX8AAvB7cH9k9E3yp6tOHhduMfQOVu1oUaz6nkLD8v lyNNk+bEHJPOTRxCwyiWuc1fm1FEHZ/bQg/eogRYHeNr7K1SbKe7pkfM/iZ2FBqS qC7Vr5NbX2co= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=AuxFUO/98leykS9upv+EEP3j4n0=; b=ccsK0 l8vomczrLw2YyHDS9z2kOlEHoYC8fgaXawzd7BhfeJ2fF3948/ypybUD3HQ96PB9 auE6XxfQQHQQJQD6q2jeZxN6Z8TZV7wo3fAev7InoHyXoDcpwpTqRe+liIjI+fhl AAWIMPydZmdB2cY4e8aRXWVEIDUE2pZFZorcPk= Received: (qmail 34107 invoked by alias); 4 Sep 2018 20:46:09 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 33991 invoked by uid 89); 4 Sep 2018 20:46:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SEM_URI, SEM_URIRED, SPF_PASS autolearn=ham version=3.3.2 spammy=53, so, H*r:sk:d4-v6so X-HELO: mail-qt0-f177.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=3WO08ksBBBLrI3JUtlQXlzoEhmvKHd5ulElkGo0j8H0=; b=iDIK5Oi/Q4da6rXIMpufy7T7eGysabnLp8+f0XUXvMx4FvJD3RF6VBDhONTqj659l0 9/NqPW08bbtMqsgf1XBv92evIe29IpehhXNYI7LLBzHRZw9bMmx8uJ6482D7Ze+Yb2Ry XH0ZKoKeDLTGpCG5QdfhhX9zCX1WshdC4qDZs= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/7] nptl: Remove tst-cancel-wrappers test and related macros Date: Tue, 4 Sep 2018 17:45:48 -0300 Message-Id: <20180904204553.6971-3-adhemerval.zanella@linaro.org> In-Reply-To: <20180904204553.6971-1-adhemerval.zanella@linaro.org> References: <20180904204553.6971-1-adhemerval.zanella@linaro.org> With upcoming BZ#12683 fix, syscall cancellation is not more handled by {libc,pthread,librt}_{enable,disable}_asynccancel symbols. This renders both LIBC_CANCEL_HANDLED and empty declaration and tst-cancel-wrappers.sh unrequired. This patch removes both the macro and the nptl test. Checked on x86_64-linux-gnu. * io/creat.c (LIBC_CANCEL_HANDLED): Remove macro. * io/ppoll.c (LIBC_CANCEL_HANDLED): Likewise. * misc/pselect.c (LIBC_CANCEL_HANDLED): Likewise. * nptl/pthreadP.h (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/generic/sysdep-cancel.h (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/mach/hurd/sysdep-cancel.h (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/posix/pause.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/posix/sigpause.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/creat.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/creat64.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/sigwait.c (LIBC_CANCEL_HANDLED): Likewise. * sysdeps/unix/sysv/linux/sigwaitinfo.c (LIBC_CANCEL_HANDLED): Likewise. * nptl/Makefile [$(run-built-tests) = yes] (tests-special): Remove tst-cancel-wrappers.sh. (generated): Remove tst-cancel-wrappers.out. (tst-cancel-wrappers.out): Remove rule. * nptl/tst-cancel-wrappers.sh: Remove file. --- ChangeLog | 19 ++++++ io/creat.c | 3 - io/ppoll.c | 2 - misc/pselect.c | 2 - nptl/Makefile | 18 +----- nptl/pthreadP.h | 10 --- nptl/tst-cancel-wrappers.sh | 92 --------------------------- sysdeps/generic/sysdep-cancel.h | 1 - sysdeps/mach/hurd/sysdep-cancel.h | 1 - sysdeps/posix/pause.c | 2 - sysdeps/posix/sigpause.c | 3 - sysdeps/unix/sysv/linux/creat.c | 2 - sysdeps/unix/sysv/linux/creat64.c | 2 - sysdeps/unix/sysv/linux/sigwait.c | 3 - sysdeps/unix/sysv/linux/sigwaitinfo.c | 3 - 15 files changed, 21 insertions(+), 142 deletions(-) delete mode 100644 nptl/tst-cancel-wrappers.sh -- 2.17.1 diff --git a/io/creat.c b/io/creat.c index 21ee56ebc9..3d0afcab54 100644 --- a/io/creat.c +++ b/io/creat.c @@ -27,6 +27,3 @@ creat (const char *file, mode_t mode) { return __open (file, O_WRONLY|O_CREAT|O_TRUNC, mode); } - -/* __open handles cancellation. */ -LIBC_CANCEL_HANDLED (); diff --git a/io/ppoll.c b/io/ppoll.c index ec26b99fee..5ccfdb9fda 100644 --- a/io/ppoll.c +++ b/io/ppoll.c @@ -70,7 +70,5 @@ ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, } #ifndef ppoll -/* __poll handles cancellation. */ -LIBC_CANCEL_HANDLED (); libc_hidden_def (ppoll); #endif diff --git a/misc/pselect.c b/misc/pselect.c index 2c29230596..07d5ffcef0 100644 --- a/misc/pselect.c +++ b/misc/pselect.c @@ -73,6 +73,4 @@ __pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, } #ifndef __pselect weak_alias (__pselect, pselect) -/* __select handles cancellation. */ -LIBC_CANCEL_HANDLED (); #endif diff --git a/nptl/Makefile b/nptl/Makefile index be8066524c..27f28d4295 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -461,8 +461,7 @@ tests-reverse += tst-cancel5 tst-cancel23 tst-vfork1x tst-vfork2x ifeq ($(run-built-tests),yes) tests-special += $(objpfx)tst-stack3-mem.out $(objpfx)tst-oddstacklimit.out ifeq ($(build-shared),yes) -tests-special += $(objpfx)tst-tls6.out $(objpfx)tst-cleanup0-cmp.out \ - $(objpfx)tst-cancel-wrappers.out +tests-special += $(objpfx)tst-tls6.out $(objpfx)tst-cleanup0-cmp.out endif endif @@ -665,8 +664,7 @@ $(objpfx)$(multidir)/crtn.o: $(objpfx)crtn.o $(objpfx)$(multidir)/ ln -f $< $@ endif -generated += multidir.mk tst-atfork2.mtrace tst-cancel-wrappers.out \ - tst-tls6.out +generated += multidir.mk tst-atfork2.mtrace tst-tls6.out generated += $(objpfx)tst-atfork2.mtrace \ $(addsuffix .so,$(strip $(modules-names))) @@ -677,18 +675,6 @@ LDFLAGS-pthread.so += -e __nptl_main $(objpfx)pt-interp.os: $(common-objpfx)runtime-linker.h endif -ifeq ($(run-built-tests),yes) -ifeq (yes,$(build-shared)) -$(objpfx)tst-cancel-wrappers.out: tst-cancel-wrappers.sh - $(SHELL) $< '$(NM)' \ - $(common-objpfx)libc_pic.a \ - $(common-objpfx)libc.a \ - $(objpfx)libpthread_pic.a \ - $(objpfx)libpthread.a > $@; \ - $(evaluate-test) -endif -endif - tst-exec4-ARGS = $(host-test-program-cmd) $(objpfx)tst-execstack: $(libdl) diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 13bdb11133..2d30555941 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -316,27 +316,17 @@ __do_cancel (void) /* Same as CANCEL_RESET, but for use in libc.so. */ # define LIBC_CANCEL_RESET(oldtype) \ __libc_disable_asynccancel (oldtype) -# define LIBC_CANCEL_HANDLED() \ - __asm (".globl " __SYMBOL_PREFIX "__libc_enable_asynccancel"); \ - __asm (".globl " __SYMBOL_PREFIX "__libc_disable_asynccancel") #elif IS_IN (libpthread) # define LIBC_CANCEL_ASYNC() CANCEL_ASYNC () # define LIBC_CANCEL_RESET(val) CANCEL_RESET (val) -# define LIBC_CANCEL_HANDLED() \ - __asm (".globl " __SYMBOL_PREFIX "__pthread_enable_asynccancel"); \ - __asm (".globl " __SYMBOL_PREFIX "__pthread_disable_asynccancel") #elif IS_IN (librt) # define LIBC_CANCEL_ASYNC() \ __librt_enable_asynccancel () # define LIBC_CANCEL_RESET(val) \ __librt_disable_asynccancel (val) -# define LIBC_CANCEL_HANDLED() \ - __asm (".globl " __SYMBOL_PREFIX "__librt_enable_asynccancel"); \ - __asm (".globl " __SYMBOL_PREFIX "__librt_disable_asynccancel") #else # define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */ # define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */ -# define LIBC_CANCEL_HANDLED() /* Nothing. */ #endif diff --git a/nptl/tst-cancel-wrappers.sh b/nptl/tst-cancel-wrappers.sh deleted file mode 100644 index 0c5b614287..0000000000 --- a/nptl/tst-cancel-wrappers.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh -# Test whether all cancelable functions are cancelable. -# Copyright (C) 2002-2018 Free Software Foundation, Inc. -# This file is part of the GNU C Library. -# Contributed by Jakub Jelinek , 2002. - -# The GNU C Library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. - -# The GNU C Library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. - -# You should have received a copy of the GNU Lesser General Public -# License along with the GNU C Library; if not, see -# . - -NM="$1"; shift -while [ $# -gt 0 ]; do - ( $NM -P $1; echo 'end[end]:' ) | gawk ' BEGIN { -C["accept"]=1 -C["close"]=1 -C["connect"]=1 -C["creat"]=1 -C["fcntl"]=1 -C["fdatasync"]=1 -C["fsync"]=1 -C["msgrcv"]=1 -C["msgsnd"]=1 -C["msync"]=1 -C["nanosleep"]=1 -C["open"]=1 -C["open64"]=1 -C["pause"]=1 -C["poll"]=1 -C["pread"]=1 -C["pread64"]=1 -C["pselect"]=1 -C["pwrite"]=1 -C["pwrite64"]=1 -C["read"]=1 -C["readv"]=1 -C["recv"]=1 -C["recvfrom"]=1 -C["recvmsg"]=1 -C["select"]=1 -C["send"]=1 -C["sendmsg"]=1 -C["sendto"]=1 -C["sigpause"]=1 -C["sigsuspend"]=1 -C["sigwait"]=1 -C["sigwaitinfo"]=1 -C["tcdrain"]=1 -C["wait"]=1 -C["waitid"]=1 -C["waitpid"]=1 -C["write"]=1 -C["writev"]=1 -C["__xpg_sigpause"]=1 -} -/:$/ { - if (seen) - { - if (!seen_enable || !seen_disable) - { - printf "in '$1'(%s) %s'\''s cancellation missing\n", object, seen - ret = 1 - } - } - seen="" - seen_enable="" - seen_disable="" - object=gensub(/^.*\[(.*)\]:$/, "\\1", 1, $0) - next -} -{ - if (C[$1] && $2 ~ /^[TW]$/) - seen=$1 - else if ($1 ~ /^([.]|)__(libc|pthread)_enable_asynccancel$/ && $2 == "U") - seen_enable=1 - else if ($1 ~ /^([.]|)__(libc|pthread)_disable_asynccancel$/ && $2 == "U") - seen_disable=1 -} -END { - exit ret -}' || exit - shift -done diff --git a/sysdeps/generic/sysdep-cancel.h b/sysdeps/generic/sysdep-cancel.h index ba6a1e04ba..d22a786536 100644 --- a/sysdeps/generic/sysdep-cancel.h +++ b/sysdeps/generic/sysdep-cancel.h @@ -5,4 +5,3 @@ #define RTLD_SINGLE_THREAD_P (1) #define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */ #define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */ -#define LIBC_CANCEL_HANDLED() /* Nothing. */ diff --git a/sysdeps/mach/hurd/sysdep-cancel.h b/sysdeps/mach/hurd/sysdep-cancel.h index ec55c7330f..f686a39024 100644 --- a/sysdeps/mach/hurd/sysdep-cancel.h +++ b/sysdeps/mach/hurd/sysdep-cancel.h @@ -6,4 +6,3 @@ #define RTLD_SINGLE_THREAD_P (0) #define LIBC_CANCEL_ASYNC() 0 /* Just a dummy value. */ #define LIBC_CANCEL_RESET(val) ((void)(val)) /* Nothing, but evaluate it. */ -#define LIBC_CANCEL_HANDLED() /* Nothing. */ diff --git a/sysdeps/posix/pause.c b/sysdeps/posix/pause.c index 2b9eca2192..879a8abd89 100644 --- a/sysdeps/posix/pause.c +++ b/sysdeps/posix/pause.c @@ -38,5 +38,3 @@ __libc_pause (void) return __sigsuspend (&set); } weak_alias (__libc_pause, pause) - -LIBC_CANCEL_HANDLED (); /* sigsuspend handles our cancellation. */ diff --git a/sysdeps/posix/sigpause.c b/sysdeps/posix/sigpause.c index db9df8eb6e..9a17d1b5d6 100644 --- a/sysdeps/posix/sigpause.c +++ b/sysdeps/posix/sigpause.c @@ -70,6 +70,3 @@ __xpg_sigpause (int sig) return __sigpause (sig, 1); } strong_alias (__xpg_sigpause, __libc___xpg_sigpause) - -/* __sigsuspend handles cancellation. */ -LIBC_CANCEL_HANDLED (); diff --git a/sysdeps/unix/sysv/linux/creat.c b/sysdeps/unix/sysv/linux/creat.c index c996cbd3cc..089a8692f2 100644 --- a/sysdeps/unix/sysv/linux/creat.c +++ b/sysdeps/unix/sysv/linux/creat.c @@ -35,6 +35,4 @@ __creat (const char *file, mode_t mode) } weak_alias (__creat, creat) -LIBC_CANCEL_HANDLED (); - #endif diff --git a/sysdeps/unix/sysv/linux/creat64.c b/sysdeps/unix/sysv/linux/creat64.c index d3ada38c9c..c9eba2ec5e 100644 --- a/sysdeps/unix/sysv/linux/creat64.c +++ b/sysdeps/unix/sysv/linux/creat64.c @@ -37,5 +37,3 @@ weak_alias (__creat64, creat64) strong_alias (__creat64, __creat) weak_alias (__creat64, creat) #endif - -LIBC_CANCEL_HANDLED (); diff --git a/sysdeps/unix/sysv/linux/sigwait.c b/sysdeps/unix/sysv/linux/sigwait.c index 920c924c9c..18ef2cf574 100644 --- a/sysdeps/unix/sysv/linux/sigwait.c +++ b/sysdeps/unix/sysv/linux/sigwait.c @@ -37,6 +37,3 @@ __sigwait (const sigset_t *set, int *sig) libc_hidden_def (__sigwait) weak_alias (__sigwait, sigwait) strong_alias (__sigwait, __libc_sigwait) - -/* __sigtimedwait handles cancellation. */ -LIBC_CANCEL_HANDLED (); diff --git a/sysdeps/unix/sysv/linux/sigwaitinfo.c b/sysdeps/unix/sysv/linux/sigwaitinfo.c index 55003fc516..71bdc943a0 100644 --- a/sysdeps/unix/sysv/linux/sigwaitinfo.c +++ b/sysdeps/unix/sysv/linux/sigwaitinfo.c @@ -28,6 +28,3 @@ __sigwaitinfo (const sigset_t *set, siginfo_t *info) libc_hidden_def (__sigwaitinfo) weak_alias (__sigwaitinfo, sigwaitinfo) strong_alias (__sigwaitinfo, __libc_sigwaitinfo) - -/* __sigtimedwait handles cancellation. */ -LIBC_CANCEL_HANDLED ();