aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2006-05-09 14:37:30 -0400
committerSam Ravnborg <sam@mars.ravnborg.org>2006-06-24 17:42:46 -0400
commit15fde6751886fd972a64ed65ba49db309919c504 (patch)
tree513c1eec2135f65ba0d980627346f7c07ad2b897 /scripts/Makefile.build
parent3041e47e8b08d51188b2cbdbd9c1e6f43314c8f1 (diff)
kbuild: support for %.symtypes files
Here is a patch that adds a new -T option to genksyms for generating dumps of the type definition that makes up the symbol version hashes. This allows to trace modversion changes back to what caused them. The dump format is the name of the type defined, followed by its definition (which is almost C): s#list_head struct list_head { s#list_head * next , * prev ; } The s#, u#, e#, and t# prefixes stand for struct, union, enum, and typedef. The exported symbols do not define types, and thus do not have an x# prefix: nfs4_acl_get_whotype int nfs4_acl_get_whotype ( char * , t#u32 ) The symbol type defintion of a single file can be generated with: make fs/jbd/journal.symtypes If KBUILD_SYMTYPES is defined, all the *.symtypes of all object files that export symbols are generated. The single *.symtypes files can be combined into a single file after a kernel build with a script like the following: for f in $(find -name '*.symtypes' | sort); do f=${f#./} echo "/* ${f%.symtypes}.o */" cat $f echo done \ | sed -e '\:UNKNOWN:d' \ -e 's:[,;] }:}:g' \ -e 's:\([[({]\) :\1:g' \ -e 's: \([])},;]\):\1:g' \ -e 's: $::' \ $f \ | awk ' /^.#/ { if (defined[$1] == $0) { print $1 next } defined[$1] = $0 } { print } ' When the kernel ABI changes, diffing individual *.symtype files, or the combined files, against each other will show which symbol changes caused the ABI changes. This can save a tremendous amount of time. Dump the types that make up modversions Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e8e7d27cfc9a..3cb445cc7432 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -140,6 +140,15 @@ cmd_cc_i_c = $(CPP) $(c_flags) -o $@ $<
140%.i: %.c FORCE 140%.i: %.c FORCE
141 $(call if_changed_dep,cc_i_c) 141 $(call if_changed_dep,cc_i_c)
142 142
143quiet_cmd_cc_symtypes_c = SYM $(quiet_modtag) $@
144cmd_cc_symtypes_c = \
145 $(CPP) -D__GENKSYMS__ $(c_flags) $< \
146 | $(GENKSYMS) -T $@ >/dev/null; \
147 test -s $@ || rm -f $@
148
149%.symtypes : %.c FORCE
150 $(call if_changed_dep,cc_symtypes_c)
151
143# C (.c) files 152# C (.c) files
144# The C file is compiled and updated dependency information is generated. 153# The C file is compiled and updated dependency information is generated.
145# (See cmd_cc_o_c + relevant part of rule_cc_o_c) 154# (See cmd_cc_o_c + relevant part of rule_cc_o_c)
@@ -166,7 +175,8 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
166cmd_modversions = \ 175cmd_modversions = \
167 if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ 176 if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
168 $(CPP) -D__GENKSYMS__ $(c_flags) $< \ 177 $(CPP) -D__GENKSYMS__ $(c_flags) $< \
169 | $(GENKSYMS) -a $(ARCH) \ 178 | $(GENKSYMS) $(if $(KBUILD_SYMTYPES), \
179 -T $(@D)/$(@F:.o=.symtypes)) -a $(ARCH) \
170 > $(@D)/.tmp_$(@F:.o=.ver); \ 180 > $(@D)/.tmp_$(@F:.o=.ver); \
171 \ 181 \
172 $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ 182 $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \