Re: Intermittent build failure with TRIM_UNUSED_KSYMS and related problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 13 Mar 2018, Masahiro Yamada wrote:

> 2018-03-05 22:07 GMT+09:00 Thomas Lindroth <thomas.lindroth@xxxxxxxxx>:
> > 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 <nico@xxxxxxxxxx>

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;	                             \
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux