Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1234451pxm; Thu, 3 Mar 2022 13:05:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyw/2Xd1YPLhG7tzv0fBhI49DsMsTJvT1dCMo5fv+0JlY7d2uvpvsHcH0JQ9+10vEsmNTAc X-Received: by 2002:a17:906:4443:b0:6cf:6a7d:5f9b with SMTP id i3-20020a170906444300b006cf6a7d5f9bmr28497735ejp.12.1646341539902; Thu, 03 Mar 2022 13:05:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646341539; cv=none; d=google.com; s=arc-20160816; b=f5j8coXXe1okx31SOLIDxjd7v2KHtPo/oDdp/0vCRCLbSJjW6TnX3dfSCwCFrhT5EN ALfdcSfmovuW0ZDW8zl1kyulyIJa3bjpuMoSRLGJgQdUJYV5fgOk3VWXhXF/7kR/HAbf Jit9gqVa0Olcsb2i1tFZ07/g60TAo7YOUj61aJkByHtdL6W0lQqY3hy2QzX8K7nMePoY /re/QCoUVGxQJqNyVQ48d4ryb93dA6EWeU4Iqjjb7Hp/ZSpbkisfHMtKitFGvYeLYuvX Dz2q0fEUjNip9y5aos5L8z7uqixrdZXprk/f0BTahQtiomd+tyHvbqFW6Qh8cnJ35h9I IvYw== 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=Y9eIeQ0ho5+PgyAKnaaB11UpUGBa3mppG5jHpvKWnBA=; b=q/w5cyxRUQOYV+I6m4ZmBuyY9ZfSQEYRG0LGI0U7b38gFj6dyue2D9xMK2/yky8t52 EKXnfKJdR2NzsOoqXVeShMef7qfokYAEPfKpBQkht8ttFP7NljjlphFxgAqIEf82JMRp kua92ACQbh770cz6Jv4ngsdTvAMniBEmaTG7hXklCY6JG1R2e/YUJV3+x65PlvA1y0GN ikBvXMPLltEP/R8150immzeNET2zUFRFCSe4BgGzVz8ya7ZmUbjgNKj8SzPw+WUay+iW ETHfMBLs/1cNz6AOKbZQvdkHJcTjwD/R1Z5Sa8X9WW7iPe7rcH3U2ByT7CY0JQleMnFw mIQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BjH5X6Yj; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id do11-20020a170906c10b00b006daa061a874si994966ejc.881.2022.03.03.13.05.15; Thu, 03 Mar 2022 13:05:39 -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=@google.com header.s=20210112 header.b=BjH5X6Yj; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235752AbiCCSlC (ORCPT + 99 others); Thu, 3 Mar 2022 13:41:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235753AbiCCSlA (ORCPT ); Thu, 3 Mar 2022 13:41:00 -0500 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CECFE32996 for ; Thu, 3 Mar 2022 10:40:12 -0800 (PST) Received: by mail-lj1-x22d.google.com with SMTP id v28so7953005ljv.9 for ; Thu, 03 Mar 2022 10:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y9eIeQ0ho5+PgyAKnaaB11UpUGBa3mppG5jHpvKWnBA=; b=BjH5X6Yj0lRLeYOc8+oSpAblIl1dkXNqVGcH9rXpzrumLG854C8lBpc1Hf32dy9X7S qN144M6BlKdb/TeKDx4m4KlRfbXCKSuIqZSqDAKIaMsp/mNK0QGzcF0nI54JGHx/GDIf JiaQLSrtU95mf2sbhwjFSoKjW96x+Y/thc44fNJ1JCLIcNzbIhDJPp339LrPgRBP548x Lqw1WlROjRYD6A8BHvM+qqmOmYuhm94stV8lJbFSYie+bs4si8ZjxZPjzxUSVl2KkMlH E45QFbuyDCz8Jrn4GPhNWcrNdFjXLzSLHep6Zk6vW/eISe6AvtEYi0RsmuJydwV0rYk7 zKbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y9eIeQ0ho5+PgyAKnaaB11UpUGBa3mppG5jHpvKWnBA=; b=XCH9bHmRlnhnEH5whgHhFso8Jo0dhHXxEdDTPwUTPkyar7V/Iqr9lEfrDGaX/7XmSx GOVwoVkqcXsS2emVsf03hpayv3SKZVxDGaSiAHYi6r5eVPSca/hUDoyQHh8SMVIrRIEO k3EIFOIVVwh8ny9k1gXt8TQHrS6DwkVjc2dyPT7/ti7E2H5g4pDsyxtTK2RGpa0SEQGV Z4zUqRf/afOcJPGCBsXL2UETcS9wphuG56lRbhkMKP/nwSOO+VIdDDZioNw9jZIrAebZ 1dW/bIjI2BmrbCgfI1qZVpRGcI7LNbSwgvtgRBF23lWbMQqyq4iz/ELu+sljG3aIS+XR pe1w== X-Gm-Message-State: AOAM533/gr/UaKRhxlSu+XEpVkU37pw+ATVQIxeeldsOfRfCGDWSZyRU Sh9I5ShOwAONaUnRVNzHdycM1VlW7GRicdvRzdS2Hw== X-Received: by 2002:a2e:bf24:0:b0:246:801e:39d3 with SMTP id c36-20020a2ebf24000000b00246801e39d3mr17157636ljr.472.1646332810871; Thu, 03 Mar 2022 10:40:10 -0800 (PST) MIME-Version: 1.0 References: <20220303090643.241747-1-davidgow@google.com> <202203030947.E2FA3D9@keescook> In-Reply-To: From: Nick Desaulniers Date: Thu, 3 Mar 2022 10:39:58 -0800 Message-ID: Subject: Re: [PATCH] um: clang: Strip out -mno-global-merge from USER_CFLAGS To: Nathan Chancellor Cc: Kees Cook , David Gow , Jeff Dike , Richard Weinberger , Anton Ivanov , Masahiro Yamada , linux-um@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-18.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 3, 2022 at 10:26 AM Nathan Chancellor wrote: > > On Thu, Mar 03, 2022 at 10:04:28AM -0800, Kees Cook wrote: > > How does -mno-global-merge get KBUILD_CFLAGS in the first place? If it's > > arm/arm64 only, shouldn't that get relocated to those architectures? > > > > *time travel* found it: > > > > 61163efae020 ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang") > > > > So I think this may have been universally true long ago, and now only > > arm/arm64 need it? Looks like that's the case from LLVM sources. > > diff --git a/arch/arm/Makefile b/arch/arm/Makefile > > index a2391b8de5a5..dcab28c44c26 100644 > > --- a/arch/arm/Makefile > > +++ b/arch/arm/Makefile > > @@ -48,6 +48,13 @@ CHECKFLAGS += -D__ARMEL__ > > KBUILD_LDFLAGS += -EL > > endif > > > > +ifdef CONFIG_CC_IS_CLANG > > +# 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. I think there's a typo in the original comment. s/on of/one of/ ? Also, I'm not sure what's meant by _MergedGlobals. Perhaps this is an opportunity to make this clearer? "Clang's "global-merge" pass (implemented only for arm and aarch64) may break modpost Pattern 2 if symbols are renamed and thus don't appear on modpost's allowlist. > > +# See modpost pattern 2 > > +KBUILD_CFLAGS += -mno-global-merge > > +endif > > + -- Thanks, ~Nick Desaulniers