All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@fluxnic.net>
To: Quentin Perret <qperret@google.com>
Cc: masahiroy@kernel.org, linux-kernel@vger.kernel.org,
	linux-kbuild@vger.kernel.org, maennich@google.com,
	kernel-team@android.com, jeyu@kernel.org, hch@infradead.org
Subject: Re: [PATCH v3 1/3] kbuild: allow symbol whitelisting with TRIM_UNUSED_KSYMS
Date: Fri, 7 Feb 2020 13:22:12 -0500 (EST)	[thread overview]
Message-ID: <nycvar.YSQ.7.76.2002071319200.1559@knanqh.ubzr> (raw)
In-Reply-To: <20200207180755.100561-2-qperret@google.com>

On Fri, 7 Feb 2020, Quentin Perret wrote:

> @Nicolas: I left your Reviewed-by behind as the code has changed a bit
> but let me know what you think
> ---
>  init/Kconfig                | 13 +++++++++++++
>  scripts/adjust_autoksyms.sh |  5 +++++
>  2 files changed, 18 insertions(+)
> 
> diff --git a/init/Kconfig b/init/Kconfig
> index a34064a031a5..79fd976ce031 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -2180,6 +2180,19 @@ config TRIM_UNUSED_KSYMS
>  
>  	  If unsure, or if you need to build out-of-tree modules, say N.
>  
> +config UNUSED_KSYMS_WHITELIST
> +	string "Whitelist of symbols to keep in ksymtab"
> +	depends on TRIM_UNUSED_KSYMS
> +	help
> +	  By default, all unused exported symbols will be un-exported from the
> +	  build when TRIM_UNUSED_KSYMS is selected.
> +
> +	  UNUSED_KSYMS_WHITELIST allows to whitelist symbols that must be kept
> +	  exported at all times, even in absence of in-tree users. The value to
> +	  set here is the path to a text file containing the list of symbols,
> +	  one per line. The path can be absolute, or relative to the kernel
> +	  source tree.
> +
>  endif # MODULES
>  
>  config MODULES_TREE_LOOKUP
> diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh
> index a904bf1f5e67..58335eee4b38 100755
> --- a/scripts/adjust_autoksyms.sh
> +++ b/scripts/adjust_autoksyms.sh
> @@ -38,6 +38,10 @@ esac
>  # We need access to CONFIG_ symbols
>  . include/config/auto.conf
>  
> +# The symbol whitelist, relative to the source tree
> +eval ksym_wl="${CONFIG_UNUSED_KSYMS_WHITELIST:-/dev/null}"
> +[[ "$ksym_wl" =~ ^/ ]] || ksym_wl="$abs_srctree/$ksym_wl"

This "[[ ]]" is a bashism. I think there was an effort not to depend on 
bash for the build system. So either this needs to be changed to basic 
bourne shell, or the interpretor has to be /bin/bash not /bin/sh.


Nicolas

  reply	other threads:[~2020-02-07 18:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 18:07 [PATCH v3 0/3] kbuild: allow symbol whitelisting with TRIM_UNUSED_KSYM Quentin Perret
2020-02-07 18:07 ` [PATCH v3 1/3] kbuild: allow symbol whitelisting with TRIM_UNUSED_KSYMS Quentin Perret
2020-02-07 18:22   ` Nicolas Pitre [this message]
2020-02-11  5:41     ` Quentin Perret
2020-02-08  5:05   ` Masahiro Yamada
2020-02-11  5:44     ` Quentin Perret
2020-02-07 18:07 ` [PATCH v3 2/3] kbuild: split adjust_autoksyms.sh in two parts Quentin Perret
2020-02-08  5:08   ` Masahiro Yamada
2020-02-11  5:45     ` Quentin Perret
2020-02-07 18:07 ` [PATCH v3 3/3] kbuild: generate autoksyms.h early Quentin Perret
2020-02-08  5:09   ` Masahiro Yamada
2020-02-11  5:46     ` Quentin Perret
2020-02-11  2:14   ` kbuild test robot
2020-02-11  2:14     ` kbuild test robot
2020-02-11  2:14     ` kbuild test robot
2020-02-12 19:56     ` Quentin Perret
2020-02-12 19:56       ` Quentin Perret
2020-02-13  8:46       ` kernel test robot
2020-02-13 18:07         ` [kbuild-all] " Quentin Perret
2020-02-13 18:07           ` Quentin Perret

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.YSQ.7.76.2002071319200.1559@knanqh.ubzr \
    --to=nico@fluxnic.net \
    --cc=hch@infradead.org \
    --cc=jeyu@kernel.org \
    --cc=kernel-team@android.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maennich@google.com \
    --cc=masahiroy@kernel.org \
    --cc=qperret@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.