From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36AD0C2D0E4 for ; Tue, 17 Nov 2020 16:22:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C36D424248 for ; Tue, 17 Nov 2020 16:22:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uvD33qC6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aJlDOBsA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C36D424248 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GZ48cu7fbUYCH4w8K0nRqZkfOJFYett2kuVXUoOH3Xw=; b=uvD33qC6YJs6txYxS86ETf7AH Gmc2RAvygZcSwQqQNPNt00uN3gTW/GFRFWIY1Xb6v2Pqyrn5Wfxcmn3aYd/4FIWFzN9poHiTS7Ki6 lYnaYAEAiO7pY9JA+vxVfWhZl1Xup0p8qxRN3GejXIZRF9a+YVYiM8ADJPTzGwMT8es1xmpm/OKs6 9EWzZNOq/mF6T4gBy0eg3PxQWT00qFKKMYogCCVUXQjExN4UmuGSgh/gnHV7gTOvNdlsMC94eCCeI S+RxVwZVUOKVRruzcWqVXjJIlDGqLvQ8dK+IIFN+HD2DjHXCutOsdEZU25otXyk1sGQk+FukYYuph zGDV0LaPg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kf3kU-0001cD-V4; Tue, 17 Nov 2020 16:22:30 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kf3kS-0001av-6J for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2020 16:22:29 +0000 Received: by mail-qk1-x741.google.com with SMTP id q5so20881969qkc.12 for ; Tue, 17 Nov 2020 08:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9JS/uYKk8GrJCTbc2FAe05O+XJ9e/pB4+Xwp7tXwPZ0=; b=aJlDOBsATEWSe1rlycoHMeV4ei94yuVwrrm65Xysp4oVHYz7irZb27aTwZ7IgeMrMO rwVNaVpE25sjKuSTnOO7NmkzBWOBSTx4fb3R/DCWK4SogrXa2AC7enZkjLsyuNjXxuvM NTnekDgslWYIalrCbTxJ86SdaNtQP3cHwjrypdeVUFonoFUCuScqV6kG/ZkGwOFtl6yH GGnqDGXXV/Rp0vgelpRy+c9ngWmBiSSV1q/ABKAKx6pMiIrVNRaIq9LBAGHm9r1XHYPX JJd8Mz5c3TX5hRrGoRqUPlThTtb3gM5hidlGyqicc9LqyBTLzcNk5GjMNiGQAYvcDs09 OmmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9JS/uYKk8GrJCTbc2FAe05O+XJ9e/pB4+Xwp7tXwPZ0=; b=eDa//8hX1mIP1/g2usHxQSot88zbVFcnLrmJKt08CZyceInd6HJX5G+Ay/RLuB6k51 qRmRgJe80Hy0wIXZ8Ft3Xr9JbpoNVnag0Stf9Lz32ygqoQ1aq36XDqmqKAwbJs1eTJTD j1FBIWVcAnRB3fGMKB8TLHiQZWSpIlIRI0bXe28VKSGs0qDo/HVREqDnngBP5148i/Kj KOu+vK5tx+rYuVfbg32PAN3DSH4ez79l2VQScx8spF/6Xj/3tn9Ulb1q8KrH/UVOLPhA hzKx1AAKOiBr7BbF6UopkStsWSk26Ok48zXYp7KgBlxLPAeVewgPhsPd9UOTsF8vR09x F1NQ== X-Gm-Message-State: AOAM532kjMtg9KouiIOZS28QbI9maJObw9Ztmxij1yiCMPXK7vOXwY+X LGg892ej+G9V/K9oeCDiroQ= X-Google-Smtp-Source: ABdhPJxFV05KKJ6XDlOOAOJnsbl9Wf8WKTjRzQrKCSJ0EvUBlKv7/HeKNXgdCIuMoNy2WooiBd+UYw== X-Received: by 2002:a37:8542:: with SMTP id h63mr366329qkd.102.1605630146479; Tue, 17 Nov 2020 08:22:26 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id v16sm15074576qka.72.2020.11.17.08.22.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:22:25 -0800 (PST) Date: Tue, 17 Nov 2020 09:22:23 -0700 From: Nathan Chancellor To: Michael Ellerman Subject: Re: [PATCH 1/2] kbuild: Hoist '--orphan-handling' into Kconfig Message-ID: <20201117162223.GA1428250@ubuntu-m3-large-x86> References: <20201113195553.1487659-1-natechancellor@gmail.com> <87tuto2qke.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87tuto2qke.fsf@mpe.ellerman.id.au> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201117_112228_271780_E4CC1F29 X-CRM114-Status: GOOD ( 27.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Marek , Kees Cook , linux-kbuild@vger.kernel.org, Catalin Marinas , Masahiro Yamada , x86@kernel.org, Nick Desaulniers , Russell King , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Arvind Sankar , Ingo Molnar , Borislav Petkov , clang-built-linux@googlegroups.com, Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 17, 2020 at 10:03:29PM +1100, Michael Ellerman wrote: > Nathan Chancellor writes: > > Currently, '--orphan-handling=warn' is spread out across four different > > architectures in their respective Makefiles, which makes it a little > > unruly to deal with in case it needs to be disabled for a specific > > linker version (in this case, ld.lld 10.0.1). > > > > To make it easier to control this, hoist this warning into Kconfig and > > the main Makefile so that disabling it is simpler, as the warning will > > only be enabled in a couple places (main Makefile and a couple of > > compressed boot folders that blow away LDFLAGS_vmlinx) and making it > > conditional is easier due to Kconfig syntax. One small additional > > benefit of this is saving a call to ld-option on incremental builds > > because we will have already evaluated it for CONFIG_LD_ORPHAN_WARN. > > > > To keep the list of supported architectures the same, introduce > > CONFIG_ARCH_WANT_LD_ORPHAN_WARN, which an architecture can select to > > gain this automatically after all of the sections are specified and size > > asserted. A special thanks to Kees Cook for the help text on this > > config. > > > > Link: https://github.com/ClangBuiltLinux/linux/issues/1187 > > Signed-off-by: Nathan Chancellor > > --- > > Makefile | 6 ++++++ > > arch/Kconfig | 9 +++++++++ > > arch/arm/Kconfig | 1 + > > arch/arm/Makefile | 4 ---- > > arch/arm/boot/compressed/Makefile | 4 +++- > > arch/arm64/Kconfig | 1 + > > arch/arm64/Makefile | 4 ---- > > arch/powerpc/Kconfig | 1 + > > arch/powerpc/Makefile | 1 - > > Acked-by: Michael Ellerman (powerpc) > > > > arch/x86/Kconfig | 1 + > > arch/x86/Makefile | 3 --- > > arch/x86/boot/compressed/Makefile | 4 +++- > > init/Kconfig | 3 +++ > > 13 files changed, 28 insertions(+), 14 deletions(-) > > > > diff --git a/Makefile b/Makefile > > index 008aba5f1a20..c443afd61886 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -984,6 +984,12 @@ ifeq ($(CONFIG_RELR),y) > > LDFLAGS_vmlinux += --pack-dyn-relocs=relr > > endif > > > > +# We never want expected sections to be placed heuristically by the > > +# linker. All sections should be explicitly named in the linker script. > > +ifeq ($(CONFIG_LD_ORPHAN_WARN),y) > > +LDFLAGS_vmlinux += --orphan-handling=warn > > +endif > > This is a nit, but you can use ifdef with bool CONFIG symbols in > Makefiles, which reads a bit nicer, eg: > > ifdef CONFIG_LD_ORPHAN_WARN > LDFLAGS_vmlinux += --orphan-handling=warn > endif That is indeed cleaner, I did not realize I could do that as long as the config was a boolean. I will use that in v2, which I will send along within the next few days to give Masahiro some time to comment. Cheers, Nathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel