Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp251218rwb; Fri, 18 Nov 2022 00:32:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf4LRDagnoXbFXzS2ulFJ67RXEN2Ddyq52fXveQQcKE0tF3ApInm8CA7DNFk7+mUlun8CkW0 X-Received: by 2002:a17:906:cb90:b0:772:e95f:cdce with SMTP id mf16-20020a170906cb9000b00772e95fcdcemr5176080ejb.78.1668760320799; Fri, 18 Nov 2022 00:32:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668760320; cv=none; d=google.com; s=arc-20160816; b=BlfYJ8Ogm1HE6/SOXk7JAlG/Nwh9F8IpPcSrnxE/Glas2xbuVabhGgNgHoIu+YSqLw PiFuGdNW7m+sgcmYoWOvqvobdL4L+6TQpKvQoOGYkb3ebzE3jkxQZe3Udj6B1KlzGJwO pX665mtKJ4jajcAXmXvpFVhcYRsyVuJ8T+ZTcmiAbsSwKKTKK9q/FOJ1sGRACr3G6k/W 7y+9tIi1maYe49q2S/S5SQA6curpwjq0c2pOneYsmugSbccMYST8WAv0IgDYJoJl+mO5 PtlugMjodsRwxLJgSzp4VOCii3mrfXEtWdzzaFskgAx8bGVPJiYq5k+IkONjwQSzBY+P viIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xGsY7qgqRndhhCUJGi7N4V+I03ekQZ9L+K2xTKQUf+A=; b=NfPAWCPs5Dur9NMb5gMoWOBPo0JWrZ4P1oM+DvUr5YTgouaRAX04bWXYSIaItshFWj 5VZn7Gim+gcGnFmQx9RV79rH/r4iIMAwEGsFD13VtWKbZFGSGW26fAJeEUK70E7sUwnD 9T4ZTpr4ZwC3xjMw/0QwCo2zSFKSWS3aEbEUhDa2r06ywx/D+lwQIg0AJNZ355s+WWzo 4az3UG47xSPTdjTEdHSZfZtyQEi3EKzItX6PySIfxz4+b46Z+yRro2gy83tP/anCkGmB eRU55NUltWYDxTDvx/mcsHGi3H7KlcK+UlSM3kzlKyNFiTWn1/yJ6930cMUX/hzcyn+G XDPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EnX4MQzp; 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 kb3-20020a1709070f8300b0076f16ec62d6si33155ejc.959.2022.11.18.00.31.36; Fri, 18 Nov 2022 00:32:00 -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=EnX4MQzp; 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 S241353AbiKRIXw (ORCPT + 90 others); Fri, 18 Nov 2022 03:23:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235221AbiKRIXu (ORCPT ); Fri, 18 Nov 2022 03:23:50 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 051E3391CF for ; Fri, 18 Nov 2022 00:23:49 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 6A5946229F for ; Fri, 18 Nov 2022 08:23:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6949C43146 for ; Fri, 18 Nov 2022 08:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668759828; bh=RbDbFSd/O/kkuqAwCEYXS++FCu2lD+vL0uZz/en/z8A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=EnX4MQzpFvSowZDbAhP6YdzD0ibzg1FApy3ULvM6l66peZGFdNYNKywPlHv0ddmi5 mbg8MJM06F7X6Zac3ojju6iaNVw7Lzc8q9gpG4p3vLKMHzTIpQuNJHGQPly+HLyMrl PBYDjHMyl04yRNwxhujP325+7pI0JzCU6CGXw8ZPPFhUEf0/T1snMZH2EB0h/gYGgj aHpfmyWYh23Isr1bnZFDWDERAEULddEoaueEeRQQ6oGfzjdpRLiaMgRW4C3pVcMDPZ H03Qgm2r/icLf0CERvh+Y/Y0qotS2p37toRuB91ERqi85MSVaReKO/4QEirDnscS8c E65QwfWiZvOiA== Received: by mail-ed1-f53.google.com with SMTP id x102so6184796ede.0 for ; Fri, 18 Nov 2022 00:23:48 -0800 (PST) X-Gm-Message-State: ANoB5pm2XsFt/1BhTqwGuSuoLXKutAOLMEmQZRowslTyO0XdhVCwn8ZX bWY8LuNJmFbAPeUkk9O/tLIHFeA+USeU+DBF2sg= X-Received: by 2002:a05:6402:3785:b0:461:e598:e0bb with SMTP id et5-20020a056402378500b00461e598e0bbmr5362428edb.21.1668759826917; Fri, 18 Nov 2022 00:23:46 -0800 (PST) MIME-Version: 1.0 References: <20221118003057.3223394-1-nathan@kernel.org> In-Reply-To: <20221118003057.3223394-1-nathan@kernel.org> From: Ard Biesheuvel Date: Fri, 18 Nov 2022 09:23:34 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] ARM: Drop '-mthumb' from AFLAGS_ISA To: Nathan Chancellor Cc: Russell King , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, "kernelci.org bot" , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" 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 On Fri, 18 Nov 2022 at 01:34, Nathan Chancellor wrote: > > 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(-) > > 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 >