Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp879067ybt; Wed, 24 Jun 2020 13:37:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywMp0YytXH7Xv2DLrg06NEEs14kN/cSDy0Tq+3GW3Ov9Q6RBsSxT87MofUkbR7hzRF16sw X-Received: by 2002:aa7:d744:: with SMTP id a4mr2608550eds.94.1593031023517; Wed, 24 Jun 2020 13:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593031023; cv=none; d=google.com; s=arc-20160816; b=dgQJZpvRzVeaK4ZKvUJL/LPJsiQ+Sh6cOY5EfqwmAsiN3hlJQ2FCrpvue/15fUE7A7 PoUj1+xrp/e/BDSNPXFZkNf0CKONWkkeNzRivZttib8tOY/Gjdf9vFg702Zh4bQf3Bwh hF2A+N7hRxgFaGWsjufmLCrZaOSGILTAVtpBBHPumAnpn+Z7Q/tZf5PIkoIwEBzq2LR1 k0Hfa38k3enIBhc40mFObX/w9Yd1GDvPRrPdGe165sjXyEviCnavxATT9VhkZz8rquks zYqeEa76UDtI/HnkjinmdodoxBXPeeM1JqX9xqZdX5nyYoJr+hrjGRhBgJO5eYp+JGct Yi5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=RZTReFFMdjgTHNlONDHd9zt1v7eMyKbgxXLu5A5pzj0=; b=08YfP2U+a8nqrda2d8g0RtwVtkcIzpPblTPwGGvttpUdSLusMvW9lnlkuEP8HlmnO6 XRfP1KKuWFa7TLrFCpRqoo+lXqVi/mAE4WN8P1dCN07eSgnz2sYuaHTH0d6fqlJS0Qog +ttrt1DIsR/imI5+X00C6v/ecdVHO5Et5fnMSuiYH1UyAuJuvONFEb1+2iEUwxQxDN1X odaqIm54ubrsMNpPDJQmjH6TgW2LVzMiEN88qKvnwLVOx0YAPaeOzCvChQ+hE6LwP4hk 6xVN7DOeMKXie4FXO28tussNiJJNnkGLjQYkMyE/+ENKtR1ParSbm1EN9VBjGMoxUsgz NkhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EWRzLy7u; 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 o24si13752493edz.484.2020.06.24.13.36.40; Wed, 24 Jun 2020 13:37:03 -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=EWRzLy7u; 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 S2406698AbgFXUeh (ORCPT + 99 others); Wed, 24 Jun 2020 16:34:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406486AbgFXUdO (ORCPT ); Wed, 24 Jun 2020 16:33:14 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B66EC061797 for ; Wed, 24 Jun 2020 13:33:13 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id r17so3465909ybj.22 for ; Wed, 24 Jun 2020 13:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=RZTReFFMdjgTHNlONDHd9zt1v7eMyKbgxXLu5A5pzj0=; b=EWRzLy7ubn55a8LmKy3CDH4ngbdy7XK7KBx2ndgKQ/3d1qkgK3E2e2e0LoML9LtpAP te8DFa082g+gVIfEAqVPkw42n2K5N8oZDQPqI2EE+tN42iDW7P8u4zkwFKaeUaEIL3oq RsZa2tBkB8ErLDOh0+LYJEGFNduXUPYCZZp6PS5HSeXJMWIblGduZ6jmagNoIsWizsER wasijgerBJQ81R7rPMfgWDc43sju3PnN23fU0SKh+4T9fa3wRlwROOUy5biDfDpraPBM LfcrqPMgzOl+e9NbqEnHTOdpcfO4/PQ3tkVTmfAbrRs5+l+SSnKRsruNnEenHpqLqPiQ nuGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=RZTReFFMdjgTHNlONDHd9zt1v7eMyKbgxXLu5A5pzj0=; b=cF4NgPfzjZXnxOpHc+J7NFMvJ3ybyIbP7xM2YV+ae0iL2bRAs4TCAaF8kFB5Sc8+a+ roI3tq7JufXcQpbvU4Coy6m9udRa8HoUua52hyfuzYWzs4HqdOLSAa9ofwfCjI2OtsgE CKi/l45ANtgHfcwjnasCjpwaaWYQB+pyu/l/Tudtu0B02XNh+PQBdexFRLC52OVTf8hs +2c+wTl9hKziyRRDrJplU3HhOGZrJ0dbrOWJxsbETwlYYYJEBPnV7Q17/1mae6CmUesE FAiHLjE5ufDgLlV+LaHlfz0QNzZuyCCAGoGTmLH8MXrf8AY4xjS+O8t08iYfrq30JwJ4 8fUA== X-Gm-Message-State: AOAM533rDU6Ps4xXEmpf07qk1njcWN6t3QvpPM3PgTwH7oF7Km0Zfy+o V6rL4F+VQWOwXKGEDuTEnaoE9ia2FSMEhjnkOjI= X-Received: by 2002:a25:4e0a:: with SMTP id c10mr44794280ybb.346.1593030792698; Wed, 24 Jun 2020 13:33:12 -0700 (PDT) Date: Wed, 24 Jun 2020 13:31:46 -0700 In-Reply-To: <20200624203200.78870-1-samitolvanen@google.com> Message-Id: <20200624203200.78870-9-samitolvanen@google.com> Mime-Version: 1.0 References: <20200624203200.78870-1-samitolvanen@google.com> X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog Subject: [PATCH 08/22] kbuild: lto: remove duplicate dependencies from .mod files From: Sami Tolvanen To: Masahiro Yamada , Will Deacon Cc: Greg Kroah-Hartman , "Paul E. McKenney" , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org, Sami Tolvanen 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 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 --- 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