From patchwork Mon Mar 12 20:54:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 10277469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D33AD60467 for ; Mon, 12 Mar 2018 20:54:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C649F28E71 for ; Mon, 12 Mar 2018 20:54:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB00D28E74; Mon, 12 Mar 2018 20:54:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3224F28E73 for ; Mon, 12 Mar 2018 20:54:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932498AbeCLUy6 (ORCPT ); Mon, 12 Mar 2018 16:54:58 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:43896 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932488AbeCLUyz (ORCPT ); Mon, 12 Mar 2018 16:54:55 -0400 Received: by mail-qk0-f195.google.com with SMTP id j4so13055593qke.10 for ; Mon, 12 Mar 2018 13:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=diLVjlrLjSWvQpYcHorNRj6TIyD7ScsqK56Qt6z/+sg=; b=eKuuuldOTmem6r5ofjvS34XvgDyO7631XinCYXnzCZVO18Wk5CYeWZDfvyBPDSPb1f YpnPi8KHp8kY/vr77FjfNAB2JvckDSJ4HcUaKbUc2uYrzU8Y1tUvQATe4C5TcgSe2aUi 8MuPLTTn7uyZc+OzMcRZaeJbRLNWIBCIZ/i68= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=diLVjlrLjSWvQpYcHorNRj6TIyD7ScsqK56Qt6z/+sg=; b=OjJf09KwB/kXK9NW1TT4f/NUi6Ek8Rr6bF5y9sFwDypVFkz6a5gFhynUFg5RCZyJG2 SxRYHrUlPmp5bOa3x6HYkYrFoNmIUfxa+P3I9WR50+TY1p+qp/AY56DdASwiHUU9rLFm Qh7rmQoKMr/emWCP1nlrct8+P9zOYN7OARaH9MrInr0xlBObiHRPcyuUnbxGl2IxpZI5 VOw7qs633KrUtLZ+794LlxWgXnvi+jXgwCj58xHGoSpDy/1E8pPvBFXKvqxDwgHx/qpC Onfqz8Y93xmVJX1d/YLfZP6jGqh0dDJLBIzMQKDROtDY1uq8GFIWir2mdn7QNgtzIOGm HZKg== X-Gm-Message-State: AElRT7GpPOeUEr8APC3cjTl8vs+ifRo+/msc0Mv8pBbrioahQvzLCDqX zEnUBKsvo4aAQ8wVrOyJliQQRA== X-Google-Smtp-Source: AG47ELsxDXOmZCVZ6lh6FUoWbTe1LkiW2VRUEHPP1EnbfQufqADKBl/PlqUnNRTl2nqDC9ld4AaWTA== X-Received: by 10.55.123.197 with SMTP id w188mr14165140qkc.70.1520888094490; Mon, 12 Mar 2018 13:54:54 -0700 (PDT) Received: from xanadu.home (modemcable228.104-82-70.mc.videotron.ca. [70.82.104.228]) by smtp.gmail.com with ESMTPSA id m8sm6413684qkm.26.2018.03.12.13.54.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Mar 2018 13:54:53 -0700 (PDT) Date: Mon, 12 Mar 2018 16:54:52 -0400 (EDT) From: Nicolas Pitre To: Masahiro Yamada cc: Thomas Lindroth , Linux Kbuild mailing list Subject: Re: Intermittent build failure with TRIM_UNUSED_KSYMS and related problems In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 13 Mar 2018, Masahiro Yamada wrote: > 2018-03-05 22:07 GMT+09:00 Thomas Lindroth : > > As I understand it TRIM_UNUSED_KSYMS will build the kernel and > > modules, then check which symbols are used by the modules and remove > > all unused EXPORT_SYMBOL_* from the kernel and rebuild it again. > > > > EXPORT_SYMBOL_GPL(pci_user_read_config_##size); > > EXPORT_SYMBOL_GPL(pci_user_write_config_##size); > > > > drivers/pci/access.c got these two exports. They stand out because > > they are macros instead of functions. I propose the following patch to clear up doubts about the most obscure part of the build for which there is currently no direct visibility, which is the actual extraction of exported symbols. ---- >8 Subject: kbuild: show the list of exported symbols with V=1 for TRIM_UNUSED_KSYMS When CONFIG_TRIM_UNUSED_KSYMS=y the list of exported symbols is extracted from the source code and piped directly into the fixdep tool. Because of that, there is no direct way of obtaining that list to make sure it is correct when debugging related issues. Let's log that list of symbols when the verbosity level is set to 1. Signed-off-by: Nicolas Pitre --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 9ffd3dda38..141a63787b 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -298,6 +298,7 @@ ksym_dep_filter = \ cmd_and_fixdep = \ $(echo-cmd) $(cmd_$(1)); \ + $(if $(findstring 1,$(KBUILD_VERBOSE)), $(ksym_dep_filter);) \ $(ksym_dep_filter) | \ scripts/basic/fixdep -e $(depfile) $@ '$(make-cmd)' \ > $(dot-target).tmp; \