From patchwork Mon Feb 24 14:12:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13988253 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3A08078F2D; Mon, 24 Feb 2025 14:12:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740406374; cv=none; b=KQ6nmbO27Ju9f7VABKHz5IiGAU174LVqJfqIDE89nILx8drxns7ZMBoVlvph/sfXZ4q4q2azr9/VtRciLUIji7Q7V8zBTJADOiQGOzfIHRiIM7WJyXl08axZD2Gtfg8L+0/H5+IOOCa7juA1VBlpoVvIY2VJbGv7ztKrixCYJeo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740406374; c=relaxed/simple; bh=DQI0FPqEAzs0OmtX8J0j8F1iGrNSEj1m4zXL+t3oxBU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=NKOczRE0tviN7MOscQ2ttkDdSUZ4fichHUfhyHD2r30fC5s4bb/lH95ZVG+bIXTsXKUr01WsiOFvEsxE/vBT8MF3SaUR3DcJVmI4PAi+u6CIuB9/TSoJbKwTyn3ayKaEd01u3szLyQTzfC2P1+cygoVEdmcWpLFzwZiZeRBLhWA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qLUpXRo+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qLUpXRo+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADE72C4CEE6; Mon, 24 Feb 2025 14:12:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740406373; bh=DQI0FPqEAzs0OmtX8J0j8F1iGrNSEj1m4zXL+t3oxBU=; h=From:To:Cc:Subject:Date:From; b=qLUpXRo+0ZxxvTKMDbTKLX7BkhXPpICzdUEq0/R6JeI8U5sYyt47gJrzoVmsnZrAo hfngLiiP+OZXmyAzaeK2TJGm1O3aSgycO7V/Gjk5zbwhWY3j41s4+zNK8ms65ytGn+ xfrcOYoPOV7byUDR05I7odk1zjnk+7Wh2WE0/PTZUJh5w+N0EX4Rwi9dtIh5SFr428 OfPKDIyCpXhZHFyq4LoHlyHIt79t7olLirnr6gRDulWCFdUN5LB2cFppvBED4ZetLU TxywINsT2QaLWoGAsULwhZe7XGAnqRYWaO8ZlLt2TaiYFYXCANbVSVSzdrUQzo7BI8 B1eWmGvQfcjqQ== From: Arnd Bergmann To: Masahiro Yamada , Nathan Chancellor Cc: Arnd Bergmann , Nicolas Schier , Nick Desaulniers , Bill Wendling , Justin Stitt , Geert Uytterhoeven , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] [v2] kbuild: hdrcheck: fix cross build with clang Date: Mon, 24 Feb 2025 15:12:36 +0100 Message-Id: <20250224141242.1370280-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Arnd Bergmann The headercheck tries to call clang with a mix of compiler arguments that don't include the target architecture. When building e.g. x86 headers on arm64, this produces a warning like clang: warning: unknown platform, assuming -mfloat-abi=soft Add in the CLANG_FLAGS, which contain the target, in order to make it build properly. See also 1b71c2fb04e7 ("kbuild: userprogs: fix bitsize and target > detection on clang"). Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor --- v2: use same approach as the other patch. --- usr/include/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/include/Makefile b/usr/include/Makefile index 58a9cbe4eba4..b9a2640b4bb7 100644 --- a/usr/include/Makefile +++ b/usr/include/Makefile @@ -10,7 +10,7 @@ UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration # In theory, we do not care -m32 or -m64 for header compile tests. # It is here just because CONFIG_CC_CAN_LINK is tested with -m32 or -m64. -UAPI_CFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CFLAGS)) +UAPI_CFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) # USERCFLAGS might contain sysroot location for CC. UAPI_CFLAGS += $(USERCFLAGS)