mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild updates from Michal Marek: - new option CONFIG_TRIM_UNUSED_KSYMS which does a two-pass build and unexports symbols which are not used in the current config [Nicolas Pitre] - several kbuild rule cleanups [Masahiro Yamada] - warning option adjustments for gcov etc [Arnd Bergmann] - a few more small fixes * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: (31 commits) kbuild: move -Wunused-const-variable to W=1 warning level kbuild: fix if_change and friends to consider argument order kbuild: fix adjust_autoksyms.sh for modules that need only one symbol kbuild: fix ksym_dep_filter when multiple EXPORT_SYMBOL() on the same line gcov: disable -Wmaybe-uninitialized warning gcov: disable tree-loop-im to reduce stack usage gcov: disable for COMPILE_TEST Kbuild: disable 'maybe-uninitialized' warning for CONFIG_PROFILE_ALL_BRANCHES Kbuild: change CC_OPTIMIZE_FOR_SIZE definition kbuild: forbid kernel directory to contain spaces and colons kbuild: adjust ksym_dep_filter for some cmd_* renames kbuild: Fix dependencies for final vmlinux link kbuild: better abstract vmlinux sequential prerequisites kbuild: fix call to adjust_autoksyms.sh when output directory specified kbuild: Get rid of KBUILD_STR kbuild: rename cmd_as_s_S to cmd_cpp_s_S kbuild: rename cmd_cc_i_c to cmd_cpp_i_c kbuild: drop redundant "PHONY += FORCE" kbuild: delete unnecessary "@:" kbuild: mark help target as PHONY ...
This commit is contained in:
commit
5b26fc8824
29 changed files with 335 additions and 95 deletions
|
|
@ -38,7 +38,7 @@ extern struct module __this_module;
|
|||
|
||||
#ifdef CONFIG_MODULES
|
||||
|
||||
#ifndef __GENKSYMS__
|
||||
#if defined(__KERNEL__) && !defined(__GENKSYMS__)
|
||||
#ifdef CONFIG_MODVERSIONS
|
||||
/* Mark the CRC weak since genksyms apparently decides not to
|
||||
* generate a checksums for some symbols */
|
||||
|
|
@ -53,7 +53,7 @@ extern struct module __this_module;
|
|||
#endif
|
||||
|
||||
/* For every exported symbol, place a struct in the __ksymtab section */
|
||||
#define __EXPORT_SYMBOL(sym, sec) \
|
||||
#define ___EXPORT_SYMBOL(sym, sec) \
|
||||
extern typeof(sym) sym; \
|
||||
__CRC_SYMBOL(sym, sec) \
|
||||
static const char __kstrtab_##sym[] \
|
||||
|
|
@ -65,6 +65,35 @@ extern struct module __this_module;
|
|||
__attribute__((section("___ksymtab" sec "+" #sym), unused)) \
|
||||
= { (unsigned long)&sym, __kstrtab_##sym }
|
||||
|
||||
#if defined(__KSYM_DEPS__)
|
||||
|
||||
/*
|
||||
* For fine grained build dependencies, we want to tell the build system
|
||||
* about each possible exported symbol even if they're not actually exported.
|
||||
* We use a string pattern that is unlikely to be valid code that the build
|
||||
* system filters out from the preprocessor output (see ksym_dep_filter
|
||||
* in scripts/Kbuild.include).
|
||||
*/
|
||||
#define __EXPORT_SYMBOL(sym, sec) === __KSYM_##sym ===
|
||||
|
||||
#elif defined(CONFIG_TRIM_UNUSED_KSYMS)
|
||||
|
||||
#include <linux/kconfig.h>
|
||||
#include <generated/autoksyms.h>
|
||||
|
||||
#define __EXPORT_SYMBOL(sym, sec) \
|
||||
__cond_export_sym(sym, sec, config_enabled(__KSYM_##sym))
|
||||
#define __cond_export_sym(sym, sec, conf) \
|
||||
___cond_export_sym(sym, sec, conf)
|
||||
#define ___cond_export_sym(sym, sec, enabled) \
|
||||
__cond_export_sym_##enabled(sym, sec)
|
||||
#define __cond_export_sym_1(sym, sec) ___EXPORT_SYMBOL(sym, sec)
|
||||
#define __cond_export_sym_0(sym, sec) /* nothing */
|
||||
|
||||
#else
|
||||
#define __EXPORT_SYMBOL ___EXPORT_SYMBOL
|
||||
#endif
|
||||
|
||||
#define EXPORT_SYMBOL(sym) \
|
||||
__EXPORT_SYMBOL(sym, "")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue