From nobody Sat Oct 4 22:34:50 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD96E18FC91; Tue, 12 Aug 2025 05:31:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754976715; cv=none; b=orrJ3WKGreVh0n+RcfHNHFz4OykHZxd0dKZ6rRl3i+6eomJbl4x2A3/j7sbVb8Velrm8vzQxSAZ+VFMWVH9G93i3FXFcvKWJzPBhxTDE20HlU9lRK8Kr4k10URgIMXK/EjnTasuoa48lpCnLXiAxYcNxglt/ZxSgcssjFkNMx/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754976715; c=relaxed/simple; bh=+pKek1uPajXdjvkKkRPqpP96Ei8Q3LMoOwHeMHpLB4g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XPsFsyzInoDiMnWcBIPs+yz6Fd1Ic83ne8CJFyvO76UmSELH3QyiC5Q5WxLd4M6QMG5KrJ47wsUetyUdwCkoJDdWHFlZ5X1lasnWhTjoTEUIDoFaDh8zFwXi3SeiJ9ikijyJnYotzmRU8pHWtPpT9HhqLeXPx/kIi+FhADZtxUU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1M35vqZN; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=whXEW0nK; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1M35vqZN"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="whXEW0nK" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754976712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KMXUeqLVprRM83sPpoFBOYX8oSP1XBvAZsT4HmA8uJU=; b=1M35vqZNJ4dU71xhNc8RuydoIBxCBcT1CORAdWaorLsUaOnxpw+2N7GEMvKlincIs62loy T74zlTblfMUJb17Wd+NJ+RF1LKgZFFbuVZjfc0qyBzIDQ8mk8LoIIX6uq5yws/CiVfDBZU fvlyXvn7CxRFtxI6HWuqYJq0A6aFN6PSzQeAMefS+yCewn/no5fSjYsX9+n9sQbs1GjQZT 5zZq5z2ZnRGBe6YivYOz+LPV3wNn2hIWS+cG4ZL94Gy28R3btOWLr6XMKSxgt81bL3Xejt Ja2CMVV2VaAhqJ8wYWFBo9bcXh/ChPbbVUrj6tVYN1FzqKdnYxUQq934i6SgCw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754976712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KMXUeqLVprRM83sPpoFBOYX8oSP1XBvAZsT4HmA8uJU=; b=whXEW0nKe2faCcoKL5alTItWuG8euaqSpS3PvsIwFTS8IdKST+PnkPwTAoky1Qo0m6gzgW 3ju/jAmgu9oVILDA== Date: Tue, 12 Aug 2025 07:31:39 +0200 Subject: [PATCH 1/2] kbuild: move existing CONFIG_WERROR flags into dedicated Makefile Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250812-kbuild-werror-v1-1-36c9ff653700@linutronix.de> References: <20250812-kbuild-werror-v1-0-36c9ff653700@linutronix.de> In-Reply-To: <20250812-kbuild-werror-v1-0-36c9ff653700@linutronix.de> To: Nathan Chancellor , Nicolas Schier , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754976708; l=2547; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=+pKek1uPajXdjvkKkRPqpP96Ei8Q3LMoOwHeMHpLB4g=; b=nX9JWW4lGC9XaPA7cdKp7851DDASxuzGyvsz0YDZLG7i0Sgz+TL/tIIqgpH/os0l73ct5uDg4 sk6ZMlp50tvDRoMsiFTS4dtd4PS9u0iVQB9yLCeOxvyQLpC5XAyBHmp X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= CONFIG_WERROR is about to be enabled for more build steps. To avoid spreading similar flags into multiple locations, create a dedicated, shared file for them. Signed-off-by: Thomas Wei=C3=9Fschuh --- Makefile | 4 +--- scripts/Makefile.extrawarn | 2 -- scripts/Makefile.werror | 11 +++++++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6bfe776bf3c5ff0cf187dc6719dd5817cd4af2ca..4ffa40e98b1517e1f2a7a155641= fa9a3c784f625 100644 --- a/Makefile +++ b/Makefile @@ -901,9 +901,6 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) :=3D = -fstack-protector-strong =20 KBUILD_CFLAGS +=3D $(stackp-flags-y) =20 -KBUILD_RUSTFLAGS-$(CONFIG_WERROR) +=3D -Dwarnings -KBUILD_RUSTFLAGS +=3D $(KBUILD_RUSTFLAGS-y) - ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS +=3D -fno-omit-frame-pointer -fno-optimize-sibling-calls KBUILD_RUSTFLAGS +=3D -Cforce-frame-pointers=3Dy @@ -1085,6 +1082,7 @@ endif =20 # include additional Makefiles when needed include-y :=3D scripts/Makefile.extrawarn +include-$(CONFIG_WERROR) +=3D scripts/Makefile.werror include-$(CONFIG_DEBUG_INFO) +=3D scripts/Makefile.debug include-$(CONFIG_DEBUG_INFO_BTF)+=3D scripts/Makefile.btf include-$(CONFIG_KASAN) +=3D scripts/Makefile.kasan diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index dca175fffcabeb2d942814f0a096a7efbf8bc819..2d8201395002dace78b875a6d25= d1fd33b1691fd 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -25,8 +25,6 @@ ifneq ($(CONFIG_FRAME_WARN),0) KBUILD_CFLAGS +=3D -Wframe-larger-than=3D$(CONFIG_FRAME_WARN) endif =20 -KBUILD_CPPFLAGS-$(CONFIG_WERROR) +=3D -Werror -KBUILD_CPPFLAGS +=3D $(KBUILD_CPPFLAGS-y) KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) +=3D -Wno-array-bounds =20 ifdef CONFIG_CC_IS_CLANG diff --git a/scripts/Makefile.werror b/scripts/Makefile.werror new file mode 100644 index 0000000000000000000000000000000000000000..db14b5490ba83444be39a18109f= 103cabc5b95e9 --- /dev/null +++ b/scripts/Makefile.werror @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: GPL-2.0 +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +# Warning flags enabled by CONFIG_WERROR +# +# Different parts of the build require different flags to transform warnin= gs +# into errors. These are handled by the entries below. +# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +KBUILD_CPPFLAGS +=3D -Werror + +KBUILD_RUSTFLAGS +=3D -Dwarnings --=20 2.50.1 From nobody Sat Oct 4 22:34:50 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A749A1B87F2; Tue, 12 Aug 2025 05:31:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754976716; cv=none; b=CV7SdgGDdrQEQ/5nbMD83T5jgHhwv4UEc0iYlO5UgnJTPtYNKg+8eHFpjRmPgAtszxMQ4qnsFvlJeEVqTwFx2TLNkX4/34K3SjCdCPBDt538LvYBDqEI9cE5CGo+xhLifFjaFGKyJmWBwyZnwnGyZ5oXQMKruL9h3qL4nmE4Lbw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754976716; c=relaxed/simple; bh=199jqnuENzWnrpGEyS7K8NCNISB0w+htLgooBWZBoSw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WtlHdepzfIwDlSuBfB7FmMo+pA3ZVYsdNWa9nPUz6C+OxvpX2BlNi2YBGt71G5Nc6LuCVKLzmRYRKgr9j0adzzDAF205x26a+9fGSf34IZlz2Y06gP+UuWebA11VLipElRlZJi5UOHWuxx+SbE37/HLejwcea8Ndxj6M+1Zx1nw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1RTwGAlR; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=0xCyD6x9; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1RTwGAlR"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0xCyD6x9" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754976712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1Fgbf4fMGL3aMEojbqf8eZ7kbt8x9M3xaRMZUgtDiLc=; b=1RTwGAlRr1vHERRQUZ8KQxyUMmRm5PjxMpIuCAy8UsNZ25QbqKIxJE7lbvXRMWQA1VmYbE iqrJUhVtyfeYNLd2sPI4WuuNJCaZvyM8C1QbuLyU6Wk7/TRBdMFvZI/GPIP2FFRVFkWB+6 R2BIv6lZBZhobAn+gxADTwO78LFNGfnJJtGmqoz8AwqY2/Pidg3iY/UoOrbZpsKV4su09S 6beRcEktEC9IrKO1xENFX+UgVypVzZjCYngaAoA9ogbK2f4jqX2LFpeZs63iQcOp3R+76V WHjujG8mWdwBKRxOZrIcE5fqkH6Bj6gHBXRNK81JLH0ALqe4MEL+MME91rEFPw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754976712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1Fgbf4fMGL3aMEojbqf8eZ7kbt8x9M3xaRMZUgtDiLc=; b=0xCyD6x96MDmqfYg1piwzeem07nzrPLJOuPV+gKmct/QDwO7lXGac4fQZckvah77qYe0d/ ohc7FXto9d8DTjBg== Date: Tue, 12 Aug 2025 07:31:40 +0200 Subject: [PATCH 2/2] kbuild: enable CONFIG_WERROR for more build steps Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250812-kbuild-werror-v1-2-36c9ff653700@linutronix.de> References: <20250812-kbuild-werror-v1-0-36c9ff653700@linutronix.de> In-Reply-To: <20250812-kbuild-werror-v1-0-36c9ff653700@linutronix.de> To: Nathan Chancellor , Nicolas Schier , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754976708; l=1036; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=199jqnuENzWnrpGEyS7K8NCNISB0w+htLgooBWZBoSw=; b=TcbxOA384FmqtpyGxKlcvKrdS4SuCHHs1cH17xG/17i/zl7tzl7UCvrmUlJvax0dg5TOFKfId u6Vwnu840SIBb8VfKRDipCT/iBOGVWaE+p21oNX4t7YF0d79hsj/rbJ X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= CONFIG_WERROR is useful for all build steps, not only compilation of C and Rust sources linked into the kernel. Also enable it for assembler and linker invocations, userprogs, as well as C and Rust hostprogs. Signed-off-by: Thomas Wei=C3=9Fschuh --- scripts/Makefile.werror | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/Makefile.werror b/scripts/Makefile.werror index db14b5490ba83444be39a18109f103cabc5b95e9..e741ae45757c7864f5132d37f39= fa3fea5b9d247 100644 --- a/scripts/Makefile.werror +++ b/scripts/Makefile.werror @@ -7,5 +7,12 @@ # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 KBUILD_CPPFLAGS +=3D -Werror +KBUILD_AFLAGS +=3D -Wa,--fatal-warnings +KBUILD_LDFLAGS +=3D --fatal-warnings +KBUILD_USERCFLAGS +=3D -Werror +KBUILD_USERLDFLAGS +=3D -Wl,--fatal-warnings +KBUILD_HOSTCFLAGS +=3D -Werror +KBUILD_HOSTLDFLAGS +=3D -Wl,--fatal-warnings =20 KBUILD_RUSTFLAGS +=3D -Dwarnings +KBUILD_HOSTRUSTFLAGS +=3D -Dwarnings --=20 2.50.1