lkml.org 
[lkml]   [2020]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subject[PATCH v7 06/17] kbuild: lto: remove duplicate dependencies from .mod files
    From
    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 <samitolvanen@google.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    ---
    scripts/Makefile.build | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/scripts/Makefile.build b/scripts/Makefile.build
    index eae2f5386a03..f80ada58271d 100644
    --- a/scripts/Makefile.build
    +++ b/scripts/Makefile.build
    @@ -281,7 +281,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.29.2.299.gdc1121823c-goog
    \
     
     \ /
      Last update: 2020-11-18 23:10    [W:4.099 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site