From patchwork Fri Nov 18 00:30:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 13047516 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BEA6AC433FE for ; Fri, 18 Nov 2022 00:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=tYTH3UnG2/cG3CWZV9PPa/FZiJIvakrDiQzjGT6zDZM=; b=y1T5CpvrNow4gE UX64eas18OCSlr6hVV3WdZyAUU9SR4p0Ackt+Fj14SjAbw7JQz5Twc/HupzJyRHHNa4GmC5jemRHp MycLd10iy28qf0xol77O10azZZrGYl+/KLxkg4OlnBQ67InwWM9kNGBe4vHM4u6oJCjAOFWLHYSzl ujmymsFrpDRAdchCxQJR5hmSXhXhPp6Dd0cNvvlZP8v1N1LCte+DYhTGF15ynRFV7lF3WgatZMHAF GTmbQaZICYFeVOh5SfVki/FLoMb7bITOxgu6PbW+jIRg+Qb894aCG2Vhjtuz0DdJONjtsspjnEgOJ ldV5IwFu7DihmC6Oh8Rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovpLR-000uwE-9N; Fri, 18 Nov 2022 00:35:01 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovpLN-000uuy-Nm for linux-arm-kernel@lists.infradead.org; Fri, 18 Nov 2022 00:34:59 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id ED50BCE1F9E; Fri, 18 Nov 2022 00:34:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 862D4C433D6; Fri, 18 Nov 2022 00:34:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668731691; bh=a0oKk28hds48kvk6Cz1Ecd3DjivBxBqAMGmz4lfIwe4=; h=From:To:Cc:Subject:Date:From; b=XOJgf8LyVo1gwHHADtM1ZldXG1S4EAISytDHFJcoF77pKw2K0aBcVPC5GpdlRZ/B4 RuPR9xMKrMuekXmx88N+xR5iYOt6bH4ryXUVRVtlXs+IDXzdZH5+ZFGBzzfZalpygX UqDWt4l9ZmQDX06U/BkG70QDjXa0SnCC65Cy7kqluRJj4iI5FBQ4peNtD2ll6KBixB RSlaj6HdB1/5nLIyQ7H6k0LURYn+RMFE0Py4IyrpchjCJDVlL/U+rMcjnqP7yjLdar rlj4hSAOtm5G44eWrMINBWgejuoE7MqdAJ3nv5pG+zi+3jDRvetvUIS8Gx8MF3CZR7 WfWX1dzSVbTIA== From: Nathan Chancellor To: Russell King Cc: Arnd Bergmann , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor , "kernelci.org bot" , Nick Desaulniers Subject: [PATCH v2] ARM: Drop '-mthumb' from AFLAGS_ISA Date: Thu, 17 Nov 2022 17:30:58 -0700 Message-Id: <20221118003057.3223394-1-nathan@kernel.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221117_163458_172559_6E39412D X-CRM114-Status: GOOD ( 14.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When building with CONFIG_THUMB2_KERNEL=y + a version of clang from Debian using CROSS_COMPILE=arm-linux-gnueabihf-, the following warning occurs frequently: :383:9: warning: '__thumb2__' macro redefined [-Wmacro-redefined] #define __thumb2__ 2 ^ :353:9: note: previous definition is here #define __thumb2__ 1 ^ 1 warning generated. Debian carries a downstream patch that changes the default CPU of the arm-linux-gnueabihf target from 'arm1176jzf-s' (v6) to 'cortex-a7' (v7). As a result, '-mthumb' defines both '__thumb__' and '__thumb2__'. The define of '__thumb2__' via the command line was purposefully added to catch a situation like this. In a similar vein as commit 26b12e084bce ("ARM: 9264/1: only use -mtp=cp15 for the compiler"), do not add '-mthumb' to AFLAGS_ISA, as it is already passed to the assembler via '-Wa,-mthumb' and '__thumb2__' is already defined for preprocessing. Fixes: 1d2e9b67b001 ("ARM: 9265/1: pass -march= only to compiler") Link: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/raw/622dbcbd40b316ed3905a2d25d9623544a06e6b1/debian/patches/930008-arm.diff Reported-by: "kernelci.org bot" Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Reviewed-by: Ard Biesheuvel --- v2: * Add Nick's review and test tags. * Call out explicitly that CROSS_COMPILE=arm-linux-gnueabihf- is needed to reproduce this issue in commit message (Nick). * Fix dead link in commit message (Nick). * Use the snapshot branch for the patch link, as the diff is more up to date against upstream LLVM (Nick). v1: https://lore.kernel.org/20221114225719.1657174-1-nathan@kernel.org/ arch/arm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) base-commit: 0c52591d22e99759da3793f19249bbf45ad742bd diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 357f0d9b8607..d1ebb746ff40 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -131,8 +131,9 @@ endif AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W) ifeq ($(CONFIG_THUMB2_KERNEL),y) -CFLAGS_ISA :=-mthumb -Wa,-mimplicit-it=always $(AFLAGS_NOWARN) +CFLAGS_ISA :=-Wa,-mimplicit-it=always $(AFLAGS_NOWARN) AFLAGS_ISA :=$(CFLAGS_ISA) -Wa$(comma)-mthumb -D__thumb2__=2 +CFLAGS_ISA +=-mthumb else CFLAGS_ISA :=$(call cc-option,-marm,) $(AFLAGS_NOWARN) AFLAGS_ISA :=$(CFLAGS_ISA)