From nobody Thu Oct 9 10:49:43 2025 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 D71902E3AF8; Tue, 17 Jun 2025 20:04:10 +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=1750190650; cv=none; b=eQHc91cK+QIrkcqHWGoAa4wPL3BcaYq0wxXUaAw/KzA9PcLSOOyETS7FfOBFCUa2EfUXNlSu4dEMz7L1TiIwMLLC9DmUjqaSOM0d9zf7Nw0MzHqHJpYtbBZ81uDBr/uftBF+fVUvQNwBRO9o5agRLikiG4kWwiuI3/Hn2b4fcxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750190650; c=relaxed/simple; bh=pGjplF3VV7f7WBNYLa3u+BbCGJciyZq1HNlyXp3mq4g=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=GpWxELCzVA1x2BeUeH1QqvbJPBcHzgjSaC1c52/m8DNPKgWlhyujpGehOBrQ64JQRp4Qibg1/WfbfNIiIarFKeoBGQbjZYUuIMf/iVEMq73LdhjFnN58Jo5BqLBf9yLUO6YuoYa8a2aQVbCqR3ZYdIonajIRI7vGpm5ZbrK9W5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nFoLuLhi; 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="nFoLuLhi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42536C4CEE3; Tue, 17 Jun 2025 20:04:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750190650; bh=pGjplF3VV7f7WBNYLa3u+BbCGJciyZq1HNlyXp3mq4g=; h=Date:From:To:Cc:Subject:From; b=nFoLuLhi7ViutAtgg+glKMXV6bKjaxoHVsC3uK+dwzUebTq8BI19iUouQlQY2tj+c e+6Bmf1fK0m4x6NegQ1y8ZQ5SBqGbszHJLxjhdPGYIj4y10XCJQDhmgX8t7sjHI/1y p+5vVxigSyKwvPFICIEteKCoOq8X9w7sTdEQtyS0qNwWeB8JJwcmvtre5/eRXMqcFJ xde65K5abt5viLM9vvf1YRCVx1/QMojLkHI7y9WKqCTZeprLqOEZiDzFLTHPzgeTo/ U/BbEEb49YphiO+3xiGa+hp0SNmi1/6Ebg8lVXMcmLbcPij78qQNntmOH20KhIF/DK 0hHX/yP5agzpg== Date: Tue, 17 Jun 2025 13:04:06 -0700 From: Nathan Chancellor To: Masahiro Yamada Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Nicolas Schier Subject: as-instr in Kbuild broken for arch/arm Message-ID: <20250617200406.GA3636948@ax162> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi Masahiro, I backported commit d5c8d6e0fa61 ("kbuild: Update assembler calls to use proper flags and language target") to 5.4 due to an upstream clang change that necessitates this [1] but it causes a failure for as-instr with arm [2] because arch/arm/Makefile uses '-include asm/unified.h' for KBUILD_AFLAGS but LINUXINCLUDE is not present in the as-instr command, resulting in :1:10: fatal error: 'asm/unified.h' file not found 1 | #include "asm/unified.h" | ^~~~~~~~~~~~~~~ 1 error generated. There does not appear to be any uses of as-instr within Kbuild (as opposed to Kconfig) for arch/arm after commit 541ad0150ca4 ("arm: Remove 32bit KVM host support") in 5.7 but as far as I can tell, it is still possible to hit this issue in upstream if one were to be added. I see two obvious solutions but I am not sure what you would prefer. 1. Add LINUXINCLUDE to the as-instr invocation, which would ensure relative '-include' flags can always be interpreted correctly, but I am unsure if this has other implications. diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler index ef91910de265..3dc814f0cae8 100644 --- a/scripts/Makefile.compiler +++ b/scripts/Makefile.compiler @@ -38,7 +38,7 @@ as-option =3D $(call try-run,\ # Usage: aflags-y +=3D $(call as-instr,instr,option1,option2) =20 as-instr =3D $(call try-run,\ - printf "%b\n" "$(1)" | $(CC) -Werror $(CLANG_FLAGS) $(KBUILD_AFLAGS) -Wa$= (comma)--fatal-warnings -c -x assembler-with-cpp -o "$$TMP" -,$(2),$(3)) + printf "%b\n" "$(1)" | $(CC) -Werror $(CLANG_FLAGS) $(LINUXINCLUDE) $(KBU= ILD_AFLAGS) -Wa$(comma)--fatal-warnings -c -x assembler-with-cpp -o "$$TMP"= -,$(2),$(3)) =20 # __cc-option # Usage: MY_CFLAGS +=3D $(call __cc-option,$(CC),$(MY_CFLAGS),-march=3Dwin= chip-c6,-march=3Di586) 2. Turn 'asm/unified.h' into an absolute path, which easily fixes this particular instance but does not prevent it from occurring again. It seems unlikely that it would because '-include' does not appear to be too common across the tree but I am always leery of silent failures like this. diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 4808d3ed98e4..e31e95ffd33f 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -149,7 +149,7 @@ endif # Need -Uarm for gcc < 3.x KBUILD_CPPFLAGS +=3D$(cpp-y) KBUILD_CFLAGS +=3D$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call c= c-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-fl= oat -Uarm -KBUILD_AFLAGS +=3D$(CFLAGS_ABI) $(AFLAGS_ISA) -Wa,$(arch-y) $(tune-y) -inc= lude asm/unified.h -msoft-float +KBUILD_AFLAGS +=3D$(CFLAGS_ABI) $(AFLAGS_ISA) -Wa,$(arch-y) $(tune-y) -inc= lude $(srctree)/arch/arm/include/asm/unified.h -msoft-float KBUILD_RUSTFLAGS +=3D --target=3Darm-unknown-linux-gnueabi =20 CHECKFLAGS +=3D -D__arm__ [1]: https://lore.kernel.org/20250604233141.GA2374479@ax162/ [2]: https://lore.kernel.org/CACo-S-1qbCX4WAVFA63dWfHtrRHZBTyyr2js8Lx=3DAz0= 3XHTTHg@mail.gmail.com/ Cheers, Nathan