From nobody Thu Apr 9 15:03:41 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E3BA344029; Sun, 8 Mar 2026 16:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772988419; cv=none; b=IUlPp0DoncUqjc1gmQQsrQ732TP9ZMowAceXIDSb+vEnO6/l3k9v1HlxQc+B3pG4CAK/+aoy1bnYtMl2aeFQVjDW+k++Qy1XHHZsgSec0WL0dkbO/adXFYWVX9i6H/GAimCnpg71O/wLpAudxEA1WFIaVLcy7qYYWhHc92x8zfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772988419; c=relaxed/simple; bh=ywVnBzn6WHB3T3G0T1ohQS9k98+GxSpF7WQOHmbiUGg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mtpq+E789ZSQm336PGeEOCcB3FEZ1CaWZFyNLRgTfFttQko6pHQM06XP7wov8otv3qjLhHxVmiyoKijUaCASR/Z+PyMisHtjc9BGAIRHo5NFYWRUsxtndt2n/vOdnJMQlMVtDopxeaiOxuO6TkfynYw9/IuuoiN2Y9unXnanIFk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7E23D1D13; Sun, 8 Mar 2026 09:46:51 -0700 (PDT) Received: from e132581.arm.com (e132581.arm.com [10.1.196.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AF7373F694; Sun, 8 Mar 2026 09:46:49 -0700 (PDT) From: Leo Yan Date: Sun, 08 Mar 2026 16:46:08 +0000 Subject: [PATCH v3 03/30] tools: lib: thermal: Initialize CFLAGS before including Makefile.include 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: <20260308-tools_build_fix_zero_init-v3-3-6477808123b7@arm.com> References: <20260308-tools_build_fix_zero_init-v3-0-6477808123b7@arm.com> In-Reply-To: <20260308-tools_build_fix_zero_init-v3-0-6477808123b7@arm.com> To: Arnaldo Carvalho de Melo , Ian Rogers , Namhyung Kim , James Clark , Kees Cook , Quentin Monnet , Nathan Chancellor , Nicolas Schier , Nick Desaulniers , Bill Wendling , Justin Stitt , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Adrian Hunter , Masami Hiramatsu , William Breathitt Gray , Barry Song , Qinxin Xia , Bartosz Golaszewski , Kent Gibson , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Jonathan Cameron , David Lechner , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko , Andrew Morton , Willy Tarreau , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Josh Poimboeuf , Robert Moore , Len Brown , Srinivas Pandruvada , Tejun Heo , David Vernet , Andrea Righi , Changwoo Min , Mark Brown , Steven Rostedt , Gabriele Monaco , Shuah Khan , Jiri Kosina , Benjamin Tissoires Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, Leo Yan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772988384; l=1678; i=leo.yan@arm.com; s=20250604; h=from:subject:message-id; bh=ywVnBzn6WHB3T3G0T1ohQS9k98+GxSpF7WQOHmbiUGg=; b=KYteRcPL4z+A9CIKXnphWMNiTfQ7er/Vz6CXNlckJJCrry7WnnCWeMrHLbmcN72foPTxXhBZ0 yu1LTfjKPuTCnWwmQJS4BBSF/xT0TCuXt9hR6j6o0HgGwHueqjVamR4 X-Developer-Key: i=leo.yan@arm.com; a=ed25519; pk=k4BaDbvkCXzBFA7Nw184KHGP5thju8lKqJYIrOWxDhI= Initialize CFLAGS to the default value before including tools/scripts/Makefile.include. Defer appending EXTRA_CFLAGS to CFLAGS until after including Makefile.include, as it may extend EXTRA_CFLAGS in the future. Signed-off-by: Leo Yan --- tools/lib/thermal/Makefile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/lib/thermal/Makefile b/tools/lib/thermal/Makefile index 41aa7a324ff4d76351b89d7d7cf382df3fc14052..50efa97163fc089455161d6b81d= b13aa0ae41af6 100644 --- a/tools/lib/thermal/Makefile +++ b/tools/lib/thermal/Makefile @@ -23,6 +23,14 @@ INSTALL =3D install DESTDIR ?=3D DESTDIR_SQ =3D '$(subst ','\'',$(DESTDIR))' =20 +# Defer assigning EXTRA_CFLAGS to CFLAGS until after including +# tools/scripts/Makefile.include, as it may add flags to EXTRA_CFLAGS. +ifdef EXTRA_CFLAGS + CFLAGS :=3D +else + CFLAGS :=3D -g -Wall +endif + include $(srctree)/tools/scripts/Makefile.include include $(srctree)/tools/scripts/Makefile.arch =20 @@ -39,13 +47,6 @@ libdir =3D $(prefix)/$(libdir_relative) libdir_SQ =3D $(subst ','\'',$(libdir)) libdir_relative_SQ =3D $(subst ','\'',$(libdir_relative)) =20 -# Set compile option CFLAGS -ifdef EXTRA_CFLAGS - CFLAGS :=3D $(EXTRA_CFLAGS) -else - CFLAGS :=3D -g -Wall -endif - NL3_CFLAGS =3D $(shell pkg-config --cflags libnl-3.0 2>/dev/null) ifeq ($(NL3_CFLAGS),) NL3_CFLAGS =3D -I/usr/include/libnl3 @@ -60,6 +61,7 @@ INCLUDES =3D \ -I$(srctree)/tools/include/uapi =20 # Append required CFLAGS +override CFLAGS +=3D $(EXTRA_CFLAGS) override CFLAGS +=3D $(EXTRA_WARNINGS) override CFLAGS +=3D -Werror -Wall override CFLAGS +=3D -fPIC --=20 2.34.1