From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 06D693858C2C for ; Sat, 29 Oct 2022 04:23:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 06D693858C2C Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-x62e.google.com with SMTP id g24so6483567plq.3 for ; Fri, 28 Oct 2022 21:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=NMqMQYN3GBL2DjtJSpriQTFLHofHHGpkCJWmFVQb+Qg=; b=QbTriKMTp0kVJ4X4H+nkV+q0hqKq4RiXczkKrrHkRCzEg1UZcSI4kkpj0BI5P6Z9wH 8+gKUOPXnvv/ER0U/CXicBAK3diWryy8O2QxmlAQ6NmnbqpaMTrMz86L8j25A/RuPmlc AHzgFiKfZmjJmnWe/a6AQeiISzVp2TpWksfKq763DityxZj5/J5Ej0EfnOIK6Yt8KDYo Qh+qNNkfzkkGX7Xu/+qUT6u54AQCCousxxFQaBYs/NjygzBzDXHk1GhvZB9v81a2sC8c ZSzkXTwHfzI/UGj8StTRLUrYgQOK1PgNhBXngYwY4vWYSu35+oroujvSnTM7x2UOR+RS bNGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NMqMQYN3GBL2DjtJSpriQTFLHofHHGpkCJWmFVQb+Qg=; b=mAzLkD+Y9R9DFiQL/Yhhj5GdijW+8tBuLKe9P1sudRnHcACwyt4vqAxlOXx+gY11Rr fXhkPNjhb2y/TlrbjltMvYL7z5qy76hpl4cgMvmScmFoRwCoFi+02nb+MpmIRZeJV2Gj Dl5MB7pGJElSe9MC6jU3++ylOCxJi/aF44ZuUbmzZtAfjoK9ZKRKNVn2imVripv25+wm YhoVtoR+EGlXm2vkBSxcCTeWM+lyDomuk5d9UuMMJ6gyR718o4Otil5xRWA4T95kQe79 4nKX7C9hlQYf5ud8POdXhQpp33edU7VGQn4DpbmTzf8CPYG6NV6Tc/7Ww9nCbG9J2XPs kKWw== X-Gm-Message-State: ACrzQf1s6YUXS+cgi/0mFlgS0OqLv8sIXAYD3HOg0gtOsLCVqwEnMc/a OPdN/oSOwjvRAlNDDY33MGkvRw== X-Google-Smtp-Source: AMsMyM7LfPMjwluzDpySGc2PfMklDEZUwCU3idZ+GQ2nI3C6Q6vwDirPxpqM2X7hxM6WQ58ygrR1aA== X-Received: by 2002:a17:903:2308:b0:186:f608:c509 with SMTP id d8-20020a170903230800b00186f608c509mr2599576plh.154.1667017399915; Fri, 28 Oct 2022 21:23:19 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:8981:f21e:b257:256]) by smtp.gmail.com with ESMTPSA id c5-20020a170903234500b0017808db132bsm268757plh.137.2022.10.28.21.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 21:23:19 -0700 (PDT) Date: Fri, 28 Oct 2022 21:23:15 -0700 From: Fangrui Song To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 04/11] linux: Move hidden_proto before static inline usage on not-cancel.h Message-ID: <20221029042315.tpohhuktfyt5yctz@google.com> References: <20221028173532.876027-1-adhemerval.zanella@linaro.org> <20221028173532.876027-5-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20221028173532.876027-5-adhemerval.zanella@linaro.org> X-Spam-Status: No, score=-26.8 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2022-10-28, Adhemerval Zanella via Libc-alpha wrote: >It is avoid a build failure on clang where it can redeclare function >attribute after its first use. can => can't But, consider using a subject line similar to other "Apply asm redirection before first use" patches? >--- > sysdeps/unix/sysv/linux/not-cancel.h | 30 ++++++++++++++-------------- > 1 file changed, 15 insertions(+), 15 deletions(-) > >diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h >index 93615de681..d4f1e0fbde 100644 >--- a/sysdeps/unix/sysv/linux/not-cancel.h >+++ b/sysdeps/unix/sysv/linux/not-cancel.h >@@ -52,6 +52,21 @@ __typeof (__write) __write_nocancel; > /* Uncancelable close. */ > __typeof (__close) __close_nocancel; > >+/* Uncancelable fcntl. */ >+__typeof (__fcntl) __fcntl64_nocancel; >+ >+#if IS_IN (libc) || IS_IN (rtld) >+hidden_proto (__open_nocancel) >+hidden_proto (__open64_nocancel) >+hidden_proto (__openat_nocancel) >+hidden_proto (__openat64_nocancel) >+hidden_proto (__read_nocancel) >+hidden_proto (__pread64_nocancel) >+hidden_proto (__write_nocancel) >+hidden_proto (__close_nocancel) >+hidden_proto (__fcntl64_nocancel) >+#endif >+ > /* Non cancellable close syscall that does not also set errno in case of > failure. */ > static inline void >@@ -80,19 +95,4 @@ __poll_infinity_nocancel (struct pollfd *fds, nfds_t nfds) > return INLINE_SYSCALL_CALL (ppoll, fds, nfds, NULL, NULL, 0); > } > >-/* Uncancelable fcntl. */ >-__typeof (__fcntl) __fcntl64_nocancel; >- >-#if IS_IN (libc) || IS_IN (rtld) >-hidden_proto (__open_nocancel) >-hidden_proto (__open64_nocancel) >-hidden_proto (__openat_nocancel) >-hidden_proto (__openat64_nocancel) >-hidden_proto (__read_nocancel) >-hidden_proto (__pread64_nocancel) >-hidden_proto (__write_nocancel) >-hidden_proto (__close_nocancel) >-hidden_proto (__fcntl64_nocancel) >-#endif >- > #endif /* NOT_CANCEL_H */ >-- >2.34.1 > This fixed In file included from check_fds.c:34: ../sysdeps/unix/sysv/linux/not-cancel.h:94:15: error: cannot apply asm label to function after its first use hidden_proto (__close_nocancel) ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ ./../include/libc-symbols.h:513:19: note: expanded from macro 'hidden_proto' __hidden_proto (name, , __GI_##name, ##attrs) ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./../include/libc-symbols.h:519:33: note: expanded from macro '__hidden_proto' extern thread __typeof (name) name __asm__ (__hidden_asmname (#internal)) \ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Reviewed-by: Fangrui Song