Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp926220ybt; Wed, 24 Jun 2020 15:02:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxo00PMCSx0S6+XNdk0Wu1ZdXxDI1mXQSiVwlWE5iIgAofEsAO02x5ElPVdZa/834DQoS4D X-Received: by 2002:a17:906:1a11:: with SMTP id i17mr10725958ejf.462.1593036161966; Wed, 24 Jun 2020 15:02:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593036161; cv=none; d=google.com; s=arc-20160816; b=E+/Qa0wB6EZ62pfY7TH2QOpFkqzxhdmzTUfhpT4BiTtvTU636NnYxbE7YNa1GXgA9l bXnhEXvsZ6MxBrNTYFAIFCNrNyWfhMqcckrx4qHdJsczITFoEVOMz8j9cn2ijIDGwhxN BHHdhIx2IotgXHlrVTjra4JJqq7TSxJykApM39gfUJkKc4VG7+e2KCpT/a4ndwNDEFfb ze9DkGvYOipUzUShtJJOvpa/lWP758qFI/e83z6UujAJQEJu1N8RNj5g6z6I3To15F8e 2HuVb1jLtBxNLuZld18YXm2BBiZNWXCHMhd/ef5ZzmFuTEDpcjb8aXLTOINFJPB/ye/A UBIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=omCkUcZNHVXP0sWRywzjOwxTXZ4YyisMAxm749WU5GU=; b=gj1mO22utnkfA0QLBOUdwZke0lOxIz2P61Q0MAo3Lx+QSuioggSMxtQQlD6iI0woNd uvQO+dEJsBaDKCZuwxNZzwh1Sy0hfI846NEHH/8e1AURf2joJCQpaBwaIwVEq2oIDTJj HzwtANjBaVc06hBjv5uGjbOh6B0IertjPLwT+bVfKk7+oOrg9tRU/qjYmadGJiWCvOH0 pdpeKNV3FfyiSGiH0jQciAmqkCU1BmWG952D15AscBPqtnVMkv89s0yvSy7CHpuOXhNg CHaGwo43+IJ98uPcVdJtsGj+8vsTsLWHcf7jZ1yfLTFUEnsjdoZAcxdwMzo/kowT+Qqd fcuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ogyMpgi9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l2si5376957edk.332.2020.06.24.15.02.19; Wed, 24 Jun 2020 15:02:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ogyMpgi9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2390098AbgFXVOB (ORCPT + 99 others); Wed, 24 Jun 2020 17:14:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389905AbgFXVN7 (ORCPT ); Wed, 24 Jun 2020 17:13:59 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5438EC0613ED for ; Wed, 24 Jun 2020 14:13:59 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id q90so1231915pjh.3 for ; Wed, 24 Jun 2020 14:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=omCkUcZNHVXP0sWRywzjOwxTXZ4YyisMAxm749WU5GU=; b=ogyMpgi9tPFXqD3+b4TskFtzlAE3qRSfSFlhxLkMzfZQl068z8vqJlL5I/k1hQA4j2 8+KaTuQNKpStTyBjn2ssQsUKa/GWq7f607kaEaeXU2o8/Ft2sUgUsqmcJHltC+KgIKVl o3jZ4P3X6AywcFpecW/k8P5ZOrqPI9Z99iVivwkxvFoyUq4G2KcudRcYQ4mOacJiN+sQ WfzuwRbr7it+GIQZRqsNndeZ4kbhXyBxzlSPEB5SEo0dkcZcdM6751ifbYi1L0YxNGzl zLZYU7QD65uDvjwEcqlKMDaY6jKyUjhUxCFnXE3C+lzv6bRpSkWGLHXOkAgDh/7Se2CC j7Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=omCkUcZNHVXP0sWRywzjOwxTXZ4YyisMAxm749WU5GU=; b=LPvsNjDchmcHieCDJoCX4oGfiT93MR2bMoQ3P3SOxe38OsWCp7aavmdRQgIIvXjF4l hGO0cm8H8DegKAzSexprDJRAhdbxRG/AfiWS0s1qThaQbz/yYVSrgYKnV9aojq9tQbGZ PyksXY955fY6h4N+L7Qb4TSMmwfhnJPaiS+hgJ3UpSwpqiMOqZ/BJ8epilg5TsntkUbT GCvFQwTW6t+MpwdEDcAds1tsMM5FiYqrjb+vtu0BWGzCogWKu9EV/qmRYR9ajYXKjMNd KbH4poaaOuL/WVATcN93GoJO2VRUUr/bJVyDE8O7OAfkvg2lCTlHIup2NQi2UAHhGJ9N soIQ== X-Gm-Message-State: AOAM532aZsglmeFOpWYLkU0w1ZZlH0NH71ZRb4LgfVIam8wRYt7AQ3Rc TQT6qCvRub+1yx7uVW4AksDB1UuW18nCb2iixZtlyQ== X-Received: by 2002:a17:902:b698:: with SMTP id c24mr29536869pls.223.1593033238474; Wed, 24 Jun 2020 14:13:58 -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 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)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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