From patchwork Mon Jan 25 13:56:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 41815 Return-Path: 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 70B6D39C074B; Mon, 25 Jan 2021 13:56:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70B6D39C074B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611582987; bh=LdAmBeeI2MD09SkYIg58NJTbcGpN1zUod4i/K6jv/K8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=sc/1Jhc5DMPqIsuiObAHyWi65Ncq7I7EDVaenBSV3DYjkdkcxut8r9TgpgnBOkjOf QUOk5Hndo17GGR9UuVgjVj36jxdwhCQ9j+xTvbd1QiMYHViGypN701UNzZ2vO1nTXd P+NDTbDY2AnfkG7md+8vcVtMab5V8iSlGDVdsYmc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by sourceware.org (Postfix) with ESMTPS id 35BCC395B057 for ; Mon, 25 Jan 2021 13:56:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 35BCC395B057 Received: by mail-pj1-x102c.google.com with SMTP id lw17so9145910pjb.0 for ; Mon, 25 Jan 2021 05:56:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LdAmBeeI2MD09SkYIg58NJTbcGpN1zUod4i/K6jv/K8=; b=FfCtgAGcwFnDhwscIBMoTHpQm4vR6stMuG7759RZCmatjjElzmfMh8WhLHLos4kOCl so7iSMSp/2IKjvdAeLG7lUDNwM+Y3DamVaSofZJ2fuXfZQFeRK91IWGHK6QXH6f5y6Y/ Ts0mEovx6Q52/eNX2p1KynVWEJcz2Y50V1RGS77a9+QdiBrChuaL+mRNwmHz6CjRBQsm wJ1dN4WnOutvwwLPRJdVaw657GoV2oSRN3bJ6HlEQI5gw6jjive13Egf4rbHMDd2mOcJ PWIfO4T8F4VlJYGXFwUygK9ACPpyGdOkoEslki3HuYHuZ/MWyHTzNo1yckXtwYzQWwaz oNQA== X-Gm-Message-State: AOAM532GR1EA1/+LUrGXKVfRWAYe1bSFFmm80S6Gt9EkvxFyx7OYw8ko IYGZs7paak36EwbXgmWP8zI= X-Google-Smtp-Source: ABdhPJyOtnxEKhzVNL/x6DPnl7UumIK6t8TzJfCeM00Vx516G9VPZsSZc4WelrwpABVaZRGtiYx7Fg== X-Received: by 2002:a17:902:834a:b029:de:343e:adb0 with SMTP id z10-20020a170902834ab02900de343eadb0mr552957pln.28.1611582983389; Mon, 25 Jan 2021 05:56:23 -0800 (PST) Received: from gnu-cfl-2.localdomain (c-69-181-90-243.hsd1.ca.comcast.net. [69.181.90.243]) by smtp.gmail.com with ESMTPSA id 123sm16875750pfd.91.2021.01.25.05.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 05:56:22 -0800 (PST) Received: from gnu-cfl-2.localdomain (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id A8BA61A03E6; Mon, 25 Jan 2021 05:56:21 -0800 (PST) To: libc-alpha@sourceware.org Subject: V3 [PATCH] Deprecate SIGSTKSZ/MINSIGSTKSZ with _SC_SIGSTKSZ_SOURCE Date: Mon, 25 Jan 2021 05:56:19 -0800 Message-Id: <20210125135619.9695-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Spam-Status: No, score=-3039.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" When _SC_SIGSTKSZ_SOURCE is defined, deprecate SIGSTKSZ and MINSIGSTKSZ: tst-minsigstksz-5.c: In function ‘do_test’: tst-minsigstksz-5.c:46:3: warning: ‘__MINSIGSTKSZ’ is deprecated: Use sysconf (_SC_MINSIGSTKSZ) instead of MINSIGSTKSZ [-Wdeprecated-declarations] 46 | void *stack_bottom = stack_buffer + (stack_buffer_size + MINSIGSTKSZ) / 2; | ^~~~ In file included from ../signal/signal.h:315, from ../include/signal.h:2, from tst-minsigstksz-5.c:19: ../sysdeps/unix/sysv/linux/bits/sigstksz.h:35:1: note: declared here 35 | __MINSIGSTKSZ (void) | ^~~~~~~~~~~~~ --- sysdeps/unix/sysv/linux/Makefile | 22 ++++++++++++++++++++++ sysdeps/unix/sysv/linux/bits/sigstksz.h | 18 ++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 472eab700d..2df265fb03 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -49,6 +49,10 @@ CFLAGS-assert.c += -DFATAL_PREPARE_INCLUDE='' CFLAGS-assert-perr.c += -DFATAL_PREPARE_INCLUDE='' endif +ifeq ($(subdir),debug) +CFLAGS-tst-longjmp_chk2.c += -Wno-deprecated-declarations +endif + ifeq ($(subdir),malloc) CFLAGS-malloc.c += -DMORECORE_CLEARS=2 endif @@ -193,6 +197,8 @@ sysdep_routines += ntp_gettime ntp_gettimex endif ifeq ($(subdir),signal) +CFLAGS-tst-minsigstksz-5.c += -Wno-deprecated-declarations + tests-special += $(objpfx)tst-signal-numbers.out # Depending on signal.o* is a hack. What we actually want is a dependency # on signal.h and everything it includes. That's impractical to write @@ -227,10 +233,18 @@ $(objpfx)tst-socket-consts.out: ../sysdeps/unix/sysv/linux/tst-socket-consts.py < /dev/null > $@ 2>&1; $(evaluate-test) endif # $(subdir) == socket +ifeq ($(subdir),string) +CFLAGS-tst-xbzero-opt.c += -Wno-deprecated-declarations +endif + ifeq ($(subdir),sunrpc) sysdep_headers += nfs/nfs.h endif +ifeq ($(subdir),support) +CFLAGS-xsigstack.c += -Wno-deprecated-declarations +endif + ifeq ($(subdir),termios) sysdep_headers += termio.h endif @@ -306,5 +320,13 @@ CFLAGS-gai.c += -DNEED_NETLINK endif ifeq ($(subdir),nptl) +CFLAGS-tst-cancel20.c += -Wno-deprecated-declarations +CFLAGS-tst-cancel21.c += -Wno-deprecated-declarations +CFLAGS-tst-cancel20-static.c += -Wno-deprecated-declarations +CFLAGS-tst-cancel21-static.c += -Wno-deprecated-declarations +CFLAGS-tst-cancelx20.c += -Wno-deprecated-declarations +CFLAGS-tst-cancelx21.c += -Wno-deprecated-declarations +CFLAGS-tst-signal6.c += -Wno-deprecated-declarations + tests += tst-align-clone tst-getpid1 endif diff --git a/sysdeps/unix/sysv/linux/bits/sigstksz.h b/sysdeps/unix/sysv/linux/bits/sigstksz.h index 926508f2b4..a1a3849094 100644 --- a/sysdeps/unix/sysv/linux/bits/sigstksz.h +++ b/sysdeps/unix/sysv/linux/bits/sigstksz.h @@ -23,11 +23,25 @@ #if defined __USE_SC_SIGSTKSZ && __USE_SC_SIGSTKSZ # include +__attribute_deprecated_msg__ ("Use sysconf (_SC_SIGSTKSZ) instead of SIGSTKSZ") +__extern_always_inline long +__SIGSTKSZ (void) +{ + return sysconf (_SC_SIGSTKSZ); +} + +__attribute_deprecated_msg__ ("Use sysconf (_SC_MINSIGSTKSZ) instead of MINSIGSTKSZ") +__extern_always_inline long +__MINSIGSTKSZ (void) +{ + return sysconf (_SC_SIGSTKSZ); +} + /* Default stack size for a signal handler: sysconf (SC_SIGSTKSZ). */ # undef SIGSTKSZ -# define SIGSTKSZ sysconf (_SC_SIGSTKSZ) +# define SIGSTKSZ __SIGSTKSZ () /* Minimum stack size for a signal handler: SIGSTKSZ. */ # undef MINSIGSTKSZ -# define MINSIGSTKSZ SIGSTKSZ +# define MINSIGSTKSZ __MINSIGSTKSZ () #endif