Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1240890pxb; Fri, 1 Apr 2022 08:12:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylOdxpoxFhF6bb8qd1ShAzC0AlQrj3ZOtDrT/75OWyrvTdmO/fbutTF0ypX9C8UwE1TRqh X-Received: by 2002:a05:6402:218:b0:419:d804:9483 with SMTP id t24-20020a056402021800b00419d8049483mr21616582edv.396.1648825923161; Fri, 01 Apr 2022 08:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648825923; cv=none; d=google.com; s=arc-20160816; b=zbwIphHf6iL6A8Dz/Z+hXJ3ANeBmTdFBGhHKUjoLCdMOf5QC+ILEaEChAcMZJhSkf4 SfLHwjSF/d2ct4NcP9m6eTUdfHIuYn++W3oz8BPCCS0eOCbZBpcHpuK/OrfFb7yW9Vz5 UwpqcwW7w1ymiianBCEQusT7k1SF05jFMp9gbMvolByrADrsaRvQwelVW9E7FiPmmY3L fgTm2jV5QJtRA+UnzP2YVwliHqX1b5qrYiCtXIUxYBij5jM+40B3+OVq91FI6fyYa+1o gcU2o/N8SxQ4a2JTPBOsHtWX9MFCiEZ7IxYg/ZRJgXmZvhZJwt0hLDqhwmKbYJe04J+W JTZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bZIWzipdVetuLYL1Cv6/r4LKZSYzNVonUGBye9cVLfI=; b=UJvJPp7n0e6iyvagbhN1zX8XOaBeonjEMOheIXcTl+YAJpqumMWZxhC8IAfdMG+Ouv qdU+EzRkt8xSwL+bFjuyrGjLnaWSvkx54kEleXYfuZ6HeCizJo8xS+TloqaeC/FbcSIf 9L4d2RmSpbnoMKD0iRtuUunZsicjsB5KFulVnPZUbcYeovuvCVSGEI27pbchbeV9NuE0 RqFxQs3SNSMiSxRFUezt0+RLMOJW5E4Lw8EPaXywGjbo1ItFJB4L5XHk4I5L8CavTicJ fhD+Osm9c7x6ltyqsLySXYzCZlte2f5g5oDxDmKx+Ot0OOZdF7bGFdIhvwy2TB8czcH/ gmAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RNmWiGT+; 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 ke8-20020a17090798e800b006df76385d0bsi1605406ejc.427.2022.04.01.08.11.36; Fri, 01 Apr 2022 08:12:03 -0700 (PDT) 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=RNmWiGT+; 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 S238666AbiCaPma (ORCPT + 99 others); Thu, 31 Mar 2022 11:42:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239073AbiCaPmJ (ORCPT ); Thu, 31 Mar 2022 11:42:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5E8B4C402; Thu, 31 Mar 2022 08:37:09 -0700 (PDT) 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 3F9C361B6C; Thu, 31 Mar 2022 15:37:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01886C340ED; Thu, 31 Mar 2022 15:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648741028; bh=1WPwzaVch64w0jPi0NN43I4/H8/WTq+VtwzIW+KkQKA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RNmWiGT+crMQsM0b3tQ+NN/NzxNDX8/ABeNcRPmBNkdmXt7kmIb3hVQ0nHMHWfWku 9/l2fK1sHy2Elc7UGMtooY/262uX9gkPe2CLYRb1T5z5pfjHi+L0R2Sok2wSRI+4KN xiGlR3mUDFoYPoY0uH6ttuz0i19W5JoJGKAD7XV5RT6lzlKEafCkzoKcOkqzcGhZ7b OfRl/2UvC3QgSmYnSrjhdfvfiMTuCv0O3wj5VlqlXEK61YjhnCQ5jw9AXee1W/nMqO N91d5dq9OkpWt2sQahIYVpKw/gHr48+8zOlpB0wh0ysz9+XjG/KI4Fbu5u0qKb7hvx zZuxrPq+apX9Q== Date: Thu, 31 Mar 2022 08:37:01 -0700 From: Nathan Chancellor To: Sedat Dilek Cc: Masahiro Yamada , Nick Desaulniers , Richard Weinberger , Anton Ivanov , Johannes Berg , Kees Cook , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-um@lists.infradead.org, llvm@lists.linux.dev, patches@lists.linux.dev Subject: Re: [PATCH 1/2] kbuild: Remove '-mno-global-merge' Message-ID: References: <20220330234528.1426991-1-nathan@kernel.org> <20220330234528.1426991-2-nathan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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,T_SCC_BODY_TEXT_LINE 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 Thu, Mar 31, 2022 at 09:11:12AM +0200, Sedat Dilek wrote: > On Thu, Mar 31, 2022 at 5:27 AM Nathan Chancellor wrote: > > > > This flag is specific to clang, where it is only used by the 32-bit and > > 64-bit ARM backends. In certain situations, the presence of this flag > > will cause a warning, as shown by commit 6580c5c18fb3 ("um: clang: Strip > > out -mno-global-merge from USER_CFLAGS"). > > > > Since commit 61163efae020 ("kbuild: LLVMLinux: Add Kbuild support for > > building kernel with Clang") that added this flag back in 2014, there > > have been quite a few changes to the GlobalMerge pass in LLVM. Building > > several different ARCH=arm and ARCH=arm64 configurations with LLVM 11 > > (minimum) and 15 (current main version) with this flag removed (i.e., > > with the default of '-mglobal-merge') reveals no modpost warnings, so it > > is likely that the issue noted in the comment is no longer relevant due > > to changes in LLVM or modpost, meaning this flag can be removed. > > > > If any new warnings show up that are a result of the removal of this > > flag, it can be added back under arch/arm{,64}/Makefile to avoid > > warnings on other architectures. > > > > Signed-off-by: Nathan Chancellor > > --- > > Makefile | 4 ---- > > 1 file changed, 4 deletions(-) > > > > diff --git a/Makefile b/Makefile > > index daeb5c88b50b..f2723d9bfca4 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -784,10 +784,6 @@ ifdef CONFIG_CC_IS_CLANG > > KBUILD_CPPFLAGS += -Qunused-arguments > > # The kernel builds with '-std=gnu89' so use of GNU extensions is acceptable. > > KBUILD_CFLAGS += -Wno-gnu > > -# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the > > -# source of a reference will be _MergedGlobals and not on of the whitelisted names. > > -# See modpost pattern 2 > > -KBUILD_CFLAGS += -mno-global-merge > > else > > > > # gcc inanely warns about local variables called 'main' > > -- > > 2.35.1 > > > > I have tested this several times and was able to boot into bar metal - > no problems with building and/or booting my kernel-modules. > > Tested-by: Sedat Dilek > Reviewed-by: Sedat Dilek I would be very concerned if you did see any impact, given this flag is ARM specific :) thanks as always for verifying! > Just as a side-note: > As with Linux v5.18-rc1 and -std=gnu11 we change the above comment ...? > > # The kernel builds with '-std=gnu89' so use of GNU extensions is acceptable. > KBUILD_CFLAGS += -Wno-gnu It was updated as part of the shift to '-std=gnu11': https://git.kernel.org/linus/e8c07082a810fbb9db303a2b66b66b8d7e588b53 The UML tree is based on 5.17-rc6, which does not have that change. There should not be a merge conflict though. Cheers, Nathan