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.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, 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 B88ECC433FE for ; Thu, 3 Dec 2020 18:02:28 +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 56FBD20754 for ; Thu, 3 Dec 2020 18:02:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56FBD20754 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3I09x8IJIe7NZQFoiRvqUQFMB7NdrorMpG5FDl//gzc=; b=phvN8XNcw5QsYz7qCekaMFPKd /802KYX1Vc24tH1WiI/dDiJPnlLJ3kddTk/OfpWeSOWj/oTzOWphjXLd7ljFubbw9JSpNRI1VtXCn DqGeEW1WCq/Q+CZx08Wc45lcNybuAG9m1YmmnfPe7S0I99QzclyFn8qaAph13PDGdCuqrMD4D35nx fvRXZU1i17FJ7X06CMA1UhgywMcnQien9Jmm0i97MzwxfHtw6QMrznBPZkqzJ1L6bWHkRklq1oW+8 D6qIrEuDykmEmvEbTHs6XPoXSW3p+4G+Tnfq/EIdSCQbU19Q+uxaHOGn9it+AcyyfnYwCBuKRoWSk ZwzUc8DBA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kksuU-0007nt-7d; Thu, 03 Dec 2020 18:00:54 +0000 Received: from conssluserg-02.nifty.com ([210.131.2.81]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kksuS-0007nZ-0p for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2020 18:00:53 +0000 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 0B3I09g1020582 for ; Fri, 4 Dec 2020 03:00:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 0B3I09g1020582 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1607018410; bh=Q8rUUiuQPCHtIjHKZ25iSma0yE471Wc2ZwPZ52EYpXA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=c8s94mdsXSLOpVko39GE94yfv+2gzeMV/HXHNgIMkxeaqs8gjTvHpyvc2Xc0x9pOj AOo5icsDHKvZetFGaTQCnk0cKQ64JBO/QcME0MIpJmNR70qzQGBLDVLMQriKEtrf09 yv65KIKeqMTg7CQGAkp2+G7PJhG/gZuWBLu3nsI5/gRf3JF1p4iFNrgeogUg5sMZDX OxZGYC0MUVzIDtPDfvYm6yrGA+cQgoxRX8vOCyoRkUFyfnh//b803fH+Mwg1ZMkR4k +6+9QN+iT25bS1Wl0RaAhdLej2oBMXB47uOpVd1xqElr2bZakypeGE/bv0usqrCRg6 ibM489qfF/Jbg== X-Nifty-SrcIP: [209.85.216.49] Received: by mail-pj1-f49.google.com with SMTP id p21so2430768pjv.0 for ; Thu, 03 Dec 2020 10:00:09 -0800 (PST) X-Gm-Message-State: AOAM531Jfe5l5W8ljlYicMPTdV/e1fzPDOQCpqkxmjbSvNKDieQ4MLZE x7tByro9B2pbMnO6AU4NDKz2SG0f0yPN62Q7lBc= X-Google-Smtp-Source: ABdhPJyWwlayA/XR+Bnh4a5mDodnSKw0H8nrbACrY1JSJtlwr6wE2FkK0g+IV8XwwRNT2lr2uJVlldeyzgyNeL0U9xo= X-Received: by 2002:a17:90a:fa0c:: with SMTP id cm12mr265364pjb.87.1607018409010; Thu, 03 Dec 2020 10:00:09 -0800 (PST) MIME-Version: 1.0 References: <20201013003203.4168817-1-samitolvanen@google.com> <20201013003203.4168817-15-samitolvanen@google.com> <202010141549.412F2BF0@keescook> In-Reply-To: <202010141549.412F2BF0@keescook> From: Masahiro Yamada Date: Fri, 4 Dec 2020 02:59:31 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 14/25] kbuild: lto: remove duplicate dependencies from .mod files To: Kees Cook X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201203_130052_437513_542916EE X-CRM114-Status: GOOD ( 30.95 ) 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: linux-arch , X86 ML , "Paul E. McKenney" , Kernel Hardening , Peter Zijlstra , Greg Kroah-Hartman , Linux Kbuild mailing list , Nick Desaulniers , Linux Kernel Mailing List , Steven Rostedt , clang-built-linux , Sami Tolvanen , linux-pci@vger.kernel.org, Will Deacon , linux-arm-kernel 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 Thu, Oct 15, 2020 at 7:50 AM Kees Cook wrote: > > On Mon, Oct 12, 2020 at 05:31:52PM -0700, Sami Tolvanen wrote: > > With LTO, llvm-nm prints out symbols for each archive member > > separately, which results in a lot of duplicate dependencies in the > > .mod file when CONFIG_TRIM_UNUSED_SYMS is enabled. When a module > > consists of several compilation units, the output can exceed the > > default xargs command size limit and split the dependency list to > > multiple lines, which results in used symbols getting trimmed. > > > > This change removes duplicate dependencies, which will reduce the > > probability of this happening and makes .mod files smaller and > > easier to read. > > > > Signed-off-by: Sami Tolvanen > > Reviewed-by: Kees Cook > > Hi Masahiro, > > This appears to be a general improvement as well. This looks like it can > land without depending on the rest of the series. It cannot. Adding "sort -u" is pointless without the rest of the series since the symbol duplication happens only with Clang LTO. This is not a solution. "reduce the probability of this happening" well describes it. I wrote a different patch. > -Kees > > > --- > > scripts/Makefile.build | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > > index ab0ddf4884fd..96d6c9e18901 100644 > > --- a/scripts/Makefile.build > > +++ b/scripts/Makefile.build > > @@ -266,7 +266,7 @@ endef > > > > # List module undefined symbols (or empty line if not enabled) > > ifdef CONFIG_TRIM_UNUSED_KSYMS > > -cmd_undef_syms = $(NM) $< | sed -n 's/^ *U //p' | xargs echo > > +cmd_undef_syms = $(NM) $< | sed -n 's/^ *U //p' | sort -u | xargs echo > > else > > cmd_undef_syms = echo > > endif > > -- > > 2.28.0.1011.ga647a8990f-goog > > > > -- > Kees Cook > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202010141549.412F2BF0%40keescook. -- Best Regards Masahiro Yamada _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel