From nobody Sun Feb 8 17:37:22 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C5B71E9B24 for ; Wed, 18 Dec 2024 14:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734533945; cv=none; b=fCV654twL42Kgs4OgBX4inyPJdA/IxZvkMf6JjwkTJHRbinKS7yrQPKM95xWVeGvmWZgRjJNNRDCguPls7DIS7+9lDWxgLgZxGdFlbGdrNhn+yM/oSvr/0fldm3Vhu59TwFjBYuU0eloEjtzChJflIQAetLHdNciw7XMSkvIPdc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734533945; c=relaxed/simple; bh=vafDbXBf+QfMxG6+rjWXgv88J6vjtPaiFaHXbRrgmRo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WKH5sd+N9AzF1qc18R506XEKPxEOHynW0dFhJXmFOBULTPs7P6kk+dRLNEfZG+RLW07FIWTv/Zquayu5E7IXjx3chZMOlojTc0/edDTycPu9MPTxNbJgo29P9tZ7ojmXDEiApJ/8KalqG5e2+fzASezkc6a5L3WFKuyo1UW1pTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=uLKz8fHM; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uLKz8fHM" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-4361ac607b6so54818815e9.0 for ; Wed, 18 Dec 2024 06:59:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1734533942; x=1735138742; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=+fxq85lD6PQT2A+RCvBP9upNyfET7edCFQdJ5Qc6idU=; b=uLKz8fHMvJYDm5qi3QlRmw8prr87P6YS67XLrVdLOirHX6tUYAhlXV3Yd0eD3yy5RX H9JMvvTpU1YStfWTFXl0zrfauWyllSmLaS/ucNiZySUJfeLc/3sSMXh8yf9YhpI70gsa Mf6ORdjKLqb1Ci/qKkdKmsEoYqJTArPamYnP+5I/RPxvDrMRZF2H4Bo8PlR1nzaNkkiF 5aJ4Zw+nrnKQHJvMBlrUtftAG4f5ZU4AEBRolfxmLHXV/45GogNIxVZUz99FIclbZNlc gkMMeiPNebLRHMNcTiZ8XqZR56MM23pEws3fLjWEcSPVRYTFWAjHbrHBNqaTFek9GisV yYDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734533942; x=1735138742; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+fxq85lD6PQT2A+RCvBP9upNyfET7edCFQdJ5Qc6idU=; b=OGM3DQ2rOX+9nsPPvyTBecPIy4seRStHs3Q1iOAmA+TyFIrPClF13mDOcjZtasRxhE ABt7DbwxtG/N0B/8rTTtB5wfJo2tWf59oODpW7qXqrrlV+HFozW5EwqBBB1ypyQhJ1jj QUtU5k5t/U8MHA5wcSYVk/vDpLGn/I4jLbK5LNKQbMoRkPbDdyN2OY7FLEQEYah6xAss CUDh/OB6Ok1TR+gPYg25t4VFs96CNFKt00Z3Hj1FMDx70L6QYr18mcVDVo88vkedQZyh TkrWxQ2UcBgXWBj0kE24sSr3wJCCn2yJeqNWKGXnSsxLZ9je7MQexNimKpk1eldCG693 Hp5g== X-Gm-Message-State: AOJu0Yz5Zn26f5tMGsNCHwbDHpeYqnFzSi+zttSMk8zQpAVEQrhjomxj PZb4wibpSRy/zGFaXbn2KyB3yJuYmu3XtfDzOORuUh0tKeOW98Umnx0cBrpUW/6ILqgvlRO7NmU ygkO8t1xTXw== X-Google-Smtp-Source: AGHT+IH6nFaGWCuLmtEVK7MkT2qc20xbncxkKqUUs/d5E7z2van0Z9iQNOqaZ3mX/Vt8cvgsSyrqh3ATVeu6rw== X-Received: from wmbhn6.prod.google.com ([2002:a05:600c:a386:b0:434:9eee:e503]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:5248:b0:435:14d:f61a with SMTP id 5b1f17b1804b1-436553eb4a4mr23858575e9.25.1734533942686; Wed, 18 Dec 2024 06:59:02 -0800 (PST) Date: Wed, 18 Dec 2024 14:58:56 +0000 In-Reply-To: <20241218-objtool-strict-v2-0-a5297c961434@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241218-objtool-strict-v2-0-a5297c961434@google.com> X-Mailer: b4 0.15-dev Message-ID: <20241218-objtool-strict-v2-2-a5297c961434@google.com> Subject: [PATCH v2 2/2] kbuild: Add option to fail build on vmlinux objtool issues From: Brendan Jackman To: Josh Poimboeuf , Peter Zijlstra , Andrew Morton , Masahiro Yamada , Nathan Chancellor , Nicolas Schier Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Brendan Jackman Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable NOINSTR_VALIDATION is pretty helpful for detecting bugs, it would be helpful for the build to fail when those bugs arise. If necessary it would be possible to enable this for individual warnings, it seems unlikely there's a use-case for that though. So for now just add a global setting. Signed-off-by: Brendan Jackman --- lib/Kconfig.debug | 10 ++++++++++ scripts/Makefile.lib | 1 + 2 files changed, 11 insertions(+) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index f3d72370587936fa373129cc9b246f15dac907be..3ee92da4733a3a504991d5dbb4d= 0cee84f519d64 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -545,6 +545,16 @@ config FRAME_POINTER config OBJTOOL bool =20 +config OBJTOOL_WERROR + bool "Run objtool with warnings as errors" + default n + depends on OBJTOOL + help + Fail the build when objtool produces warnings. + + By default, objtool just prints warnings to the terminal without + causing a build failure. This config changes that. + config STACK_VALIDATION bool "Compile-time stack metadata validation" depends on HAVE_STACK_VALIDATION && UNWINDER_FRAME_POINTER diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 7395200538da89a2f6e6d21f8959f3f60d291d79..a53e052ae0532e886fcb2019025= cf7216e484bd2 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -277,6 +277,7 @@ objtool-args-$(CONFIG_HAVE_STATIC_CALL_INLINE) +=3D --= static-call objtool-args-$(CONFIG_HAVE_UACCESS_VALIDATION) +=3D --uaccess objtool-args-$(CONFIG_GCOV_KERNEL) +=3D --no-unreachable objtool-args-$(CONFIG_PREFIX_SYMBOLS) +=3D --prefix=3D$(CONFIG_FUNCTION_= PADDING_BYTES) +objtool-args-$(CONFIG_OBJTOOL_WERROR) +=3D --Werror =20 objtool-args =3D $(objtool-args-y) \ $(if $(delay-objtool), --link) \ --=20 2.47.1.613.gc27f4b7a9f-goog