Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2811863rwb; Thu, 17 Nov 2022 16:52:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf6+bg3msDJucr0/WardpANDRkPBTAlNh1ZXzOnZ6LvPwHhwoTO55zIzeFYLNcGMKLDhFvA1 X-Received: by 2002:a17:906:4dc3:b0:79d:f5f2:621e with SMTP id f3-20020a1709064dc300b0079df5f2621emr3932782ejw.362.1668732729092; Thu, 17 Nov 2022 16:52:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668732729; cv=none; d=google.com; s=arc-20160816; b=u5+qtSGNKfPnA9KyPS2Gx+b49HtnvA9qquu3AL+1LidXi6oBqEPco/73VDRTFNFdTr EtjJPQkbIQdDFs6mslCAIGROESJ2z4m1rodXl0h2Du8f2hgg6N3PCRi+Jfy8zYpx+SZs Q+fvpFsfDG7Cfuws+jmLNTdn6vChpdCPsNkTYkpR/5f3krQa0iDnNhOjxIp/o7dYMVbr q6Os8eA1JnU8JX/pw3X1EsDxNpmDJX1YhWmtdvmNz+q60CWAgPH8Wmwt8fgoyC2FJEdq nK4Lri4W+rxRIveAOpAzYEzrzcEOWqquRL3VBIgxLtHz6Jn2+5mNs+uBV4GBgLzN8zfc fLzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+japyfJC3rHGHuOnWbaLc+kPqBa9vfEVl7V17NJthfg=; b=eBp7BrdyW0AMG4h6ciP6RJLKjdKGkbOdYsfgJXI+2yitg5pHfBOHPE9wNRlkcvZFhX /yrWDWgeZLH3yyfRoUEhbKrK8/WXJcnXapXRH/bwMCo77G8Dlul65kHiv+CH0SCv9tiV 2q7RJDCf6srqM4HNKNbl/TtHQZWxoxifa9Niv5Fke90OS1iqdHCCL7H2T0mBLs15HV0S Jz3i5YGB2J7DtVK30sYuEw4cc3gbwn/CX4//zJGCQpW0PoYMyIWk225JkeWpVYDm2ptr MkvKSRq3YCfP5O1djrLQAMaP1xZ06hWuRNxvNy1UazReNSLhr8a42Q4x8PN27+dm+X9j jffQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XOJgf8Ly; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u1-20020a1709064ac100b0078d62ae01c1si1550074ejt.536.2022.11.17.16.51.46; Thu, 17 Nov 2022 16:52:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XOJgf8Ly; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235197AbiKRAe5 (ORCPT + 91 others); Thu, 17 Nov 2022 19:34:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233266AbiKRAez (ORCPT ); Thu, 17 Nov 2022 19:34:55 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9399E79900 for ; Thu, 17 Nov 2022 16:34:54 -0800 (PST) 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 D6EDBCE1F6F for ; 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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(-) 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) base-commit: 0c52591d22e99759da3793f19249bbf45ad742bd -- 2.38.1