]> Git Repo - linux.git/commitdiff
kbuild: be more careful about matching preprocessed asm ___EXPORT_SYMBOL
authorNicholas Piggin <[email protected]>
Wed, 9 Nov 2016 04:34:05 +0000 (15:34 +1100)
committerMichal Marek <[email protected]>
Wed, 9 Nov 2016 21:29:53 +0000 (22:29 +0100)
The CRC code for asm exports grabs the preprocessed asm, finds the
___EXPORT_SYMBOL and turns those into EXPORT_SYMBOL in a C program
that can be preprocessed and parsed to create the CRC signatures from
the type.

The existing regex matching and replacement is too strict, and doesn't
deal well with whitespace among other things. The line
" EXPORT_SYMBOL(sym)" in a .S file would not match due to initial
whitespace, for example, which resulted in x86's ___preempt_schedule
failing to get CRCs.

Reported-by: Philip Müller <[email protected]>
Signed-off-by: Nicholas Piggin <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
scripts/Makefile.build

index 3e223c26446997b13d8ff8698e795a74e012217b..7675d11ee65e6d41e353debcd2fc51abff9a5dfa 100644 (file)
@@ -332,8 +332,8 @@ cmd_gensymtypes_S =                                                         \
     (echo "\#include <linux/kernel.h>" ;                                    \
      echo "\#include <asm/asm-prototypes.h>" ;                              \
     $(CPP) $(a_flags) $< |                                                  \
-     grep ^___EXPORT_SYMBOL |                                               \
-     sed 's/___EXPORT_SYMBOL \([a-zA-Z0-9_]*\),.*/EXPORT_SYMBOL(\1);/' ) |  \
+     grep "\<___EXPORT_SYMBOL\>" |                                          \
+     sed 's/.*___EXPORT_SYMBOL[[:space:]]*\([a-zA-Z0-9_]*\)[[:space:]]*,.*/EXPORT_SYMBOL(\1);/' ) | \
     $(CPP) -D__GENKSYMS__ $(c_flags) -xc - |                                \
     $(GENKSYMS) $(if $(1), -T $(2))                                         \
      $(patsubst y,-s _,$(CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX))             \
This page took 0.053115 seconds and 4 git commands to generate.