From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389913AbgFXVN7 (ORCPT ); Wed, 24 Jun 2020 17:13:59 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B405C061796 for ; Wed, 24 Jun 2020 14:13:59 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id s14so1635201plq.6 for ; Wed, 24 Jun 2020 14:13:59 -0700 (PDT) MIME-Version: 1.0 References: <20200624203200.78870-1-samitolvanen@google.com> <20200624203200.78870-9-samitolvanen@google.com> In-Reply-To: <20200624203200.78870-9-samitolvanen@google.com> From: Nick Desaulniers Date: Wed, 24 Jun 2020 14:13:46 -0700 Message-ID: Subject: Re: [PATCH 08/22] kbuild: lto: remove duplicate dependencies from .mod files Content-Type: text/plain; charset="UTF-8" Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Sami Tolvanen Cc: Masahiro Yamada , Will Deacon , Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , clang-built-linux , Kernel Hardening , linux-arch , Linux ARM , Linux Kbuild mailing list , LKML , linux-pci@vger.kernel.org, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" On Wed, Jun 24, 2020 at 1:33 PM 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: Nick Desaulniers > --- > scripts/Makefile.build | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index 82977350f5a6..82b465ce3ca0 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -291,7 +291,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.27.0.212.ge8ba1cc988-goog > -- Thanks, ~Nick Desaulniers