From patchwork Tue Jul 11 13:11:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 72490 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 1B55B3856DD5 for ; Tue, 11 Jul 2023 13:12:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B55B3856DD5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689081135; bh=jS4i9tNOPniP5LWk1xcqhXGEnm5JjhoHhQJDcgtjAcQ=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Ic9cLUsS6sAvvkzgPHvhhj1Z6eIMqX91I4H7I41idr65W7hf4up/qgHylc77xDrNZ MZ0/LgcRZQDCSjkRIt4+TavzE27I8TnMXK6fln7eLE00F2lcVcfh7h0pK+XgYH2ES4 gdqmp4jy/Fv65Ztn14xuiUVHZChK5y5j3tHd78Nk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by sourceware.org (Postfix) with ESMTPS id 6AAAA3857014 for ; Tue, 11 Jul 2023 13:11:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AAAA3857014 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D95C0614DD; Tue, 11 Jul 2023 13:11:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DFC0C433C8; Tue, 11 Jul 2023 13:11:42 +0000 (UTC) To: libc-alpha@sourceware.org Cc: Alejandro Colomar , Florian Weimer , Xi Ruoyao , Sam James , Richard Biener , Andrew Pinski Subject: [RFC v1 2/2] Makeconfig: Compile glibc with -fno-delete-null-pointer-checks Date: Tue, 11 Jul 2023 15:11:06 +0200 Message-Id: <20230711131105.19203-3-alx@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230711131105.19203-1-alx@kernel.org> References: <20230711131105.19203-1-alx@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1613; i=alx@kernel.org; h=from:subject; bh=USaZD+J5Kh+UENbk+Glhn0oZG7kt7lbRpFq211k8UeU=; b=owEBbQKS/ZANAwAKAZ6MGvu+/9syAcsmYgBkrVThIm3vHCqoWpQqejDlHk90QDLOhk65Rf+t1 fzMyfiBUhOJAjMEAAEKAB0WIQTqOofwpOugMORd8kCejBr7vv/bMgUCZK1U4QAKCRCejBr7vv/b MrlAD/wJr6vugqzlGsFenoPiZCuwv44JXpl8DY/MuQCXtny0hnaGB1HlbBnfI6WZUnO7o4u6b7S 5ymAyM3uLJ/OpXn+o5cqTI3LRJtqYVev8oJCsLvCsNBl7oWr8vjrMrNfe0/+72CB9IGcjpUM4FL nnXuswzFr2ruGj0lMfP5uCDvnAYFPS8r546Fx+qpQLK7aIGRvWVFu4uHhT22fb3AMWIK1HeLSmh Qsc+3OPsMo4qpMvxvZLMNUIn/Ie9IZCcH5UwefGqfAqTU3i9YSRBnxC0HdgKlBCH9qNLLDgAwV1 NJQVojs2mwET9q1hpu9WC7LO9eedd3nP//Poi/ZxUDMu/Thig66ZUlgNpl1U9h+eutDL3gMNrX0 yic6DYX67indXNh/Gzt1t7AN7A8ygtpmlkx56WcNFGi+JDTwYid/lCgM6jzbpjCoxzWs/K2Amaz UFpgfxcTLZgZVfrX43WkCil06BakyFOv/Gx1NsUJsTWtKnlMKqs04v15XuQtMt2qVgO8FsJeqYc HIoMTLXCRf7Fx+xLZ4QptzeM24hy++dzwUVVJ5nLMqqpgBcTqwGXYQ+vMaiEqJ6ZYPweoWFwgyE k0/AhwCo6uDK3Lbrxw4gs/kS1oTYX6SsA/7ltHfoFSRlKJgG55i5XBV0jnc+KZBdiQ1cguXd/Xe D214kYsnJpf02Yw== X-Developer-Key: i=alx@kernel.org; a=openpgp; fpr=A9348594CE31283A826FBDD8D57633D441E25BB5 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Alejandro Colomar via Libc-alpha From: Alejandro Colomar Reply-To: Alejandro Colomar Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Don't undefine __nonnull to prevent compiler optimizations. Instead, tell the compiler to not optimize based on the attribute, via the appropriate flag. Link: Reported-by: Florian Weimer Cc: Xi Ruoyao Cc: Sam James Cc: Richard Biener Cc: Andrew Pinski Signed-off-by: Alejandro Colomar --- Makeconfig | 1 + include/sys/cdefs.h | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Makeconfig b/Makeconfig index 369a596e79..ecbe30e53f 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1045,6 +1045,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPFLAGS-config) \ override CFLAGS = -std=gnu11 \ -fgnu89-inline \ + -fno-delete-null-pointer-checks \ $(config-extra-cflags) \ $(filter-out %frame-pointer,$(+cflags)) \ $(+gccwarn-c) \ diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index b84ad34a70..e4a8dd7844 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -10,12 +10,6 @@ #include #ifndef _ISOMAC -/* The compiler will optimize based on the knowledge the parameter is - not NULL. This will omit tests. A robust implementation cannot allow - this so when compiling glibc itself we ignore this attribute. */ -# undef __nonnull -# define __nonnull(params) - extern void __chk_fail (void) __attribute__ ((__noreturn__)); libc_hidden_proto (__chk_fail) rtld_hidden_proto (__chk_fail)