remove def-* and und-* list files

This commit is contained in:
BVK Chaitanya 2010-08-29 11:17:30 +05:30
parent a0bf9fc930
commit 0d4552faca
6 changed files with 72 additions and 41 deletions

View file

@ -86,8 +86,6 @@ CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime
# Define these variables to calm down automake
PP_FILES =
DEF_FILES =
UND_FILES =
IMG_FILES =
MOD_FILES =
MODULE_FILES =

View file

@ -284,8 +284,6 @@ def module(platform):
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
r += gvar_add("DEF_FILES", "def-[+ name +].lst")
r += gvar_add("UND_FILES", "und-[+ name +].lst")
r += gvar_add("MOD_FILES", "[+ name +].mod")
r += gvar_add("platform_DATA", "[+ name +].mod")
r += gvar_add("CLEANFILES", "def-[+ name +].lst und-[+ name +].lst mod-[+ name +].c mod-[+ name +].o [+ name +].mod")
@ -296,16 +294,6 @@ def module(platform):
[+ name +].pp: $(""" + cname() + """_SOURCES) $(nodist_""" + cname() + """_SOURCES)
$(TARGET_CPP) -DGRUB_LST_GENERATOR $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname() + """_CPPFLAGS) $(CPPFLAGS) $^ > $@ || (rm -f $@; exit 1)
def-[+ name +].lst: [+ name +].module$(EXEEXT)
if test x$(USE_APPLE_CC_FIXES) = xyes; then \
$(NM) -g -P -p $< | grep -E '^[a-zA-Z0-9_]* [TDS]' | sed "s/^\\([^ ]*\\).*/\\1 [+ name +]/" >> $@; \
else \
$(NM) -g --defined-only -P -p $< | sed "s/^\\([^ ]*\\).*/\\1 [+ name +]/" >> $@; \
fi
und-[+ name +].lst: [+ name +].module$(EXEEXT)
$(NM) -u -P -p $< | sed "s/^\\([^ ]*\\).*/\\1 [+ name +]/" >> $@
mod-[+ name +].c: [+ name +].module$(EXEEXT) moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh [+ name +] moddep.lst > $@ || (rm -f $@; exit 1)
@ -448,9 +436,8 @@ def script(platform):
r += "[+ IF mansection +]" + manpage() + "[+ ENDIF +]"
r += "[+ ENDIF +]"
r += rule("[+ name +]", "$(top_builddir)/config.status " + platform_sources(platform), """
$(top_builddir)/config.status --file=-:""" + platform_sources(platform) + """ \
| sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g' > $@
r += rule("[+ name +]", platform_sources(platform) + " $(top_builddir)/config.status", """
$(top_builddir)/config.status --file=-:$< | sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g' > $@
chmod a+x [+ name +]
""")

View file

@ -235,8 +235,8 @@ kernel_syms.lst: $(KERNEL_HEADER_FILES) $(top_builddir)/config.h
$(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) $(CFLAGS) -DGRUB_SYMBOL_GENERATOR=1 $^ >kernel_syms.input
if grep "^#define HAVE_ASM_USCORE" $(top_builddir)/config.h; then u="_"; else u=""; fi; \
cat kernel_syms.input | grep -v '^#' | sed -n \
-e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/'"$$u"'\1 kernel/;p;}' \
-e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/'"$$u"'\1 kernel/;p;}' \
-e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/defined '"$$u"'kernel \1/;p;}' \
-e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/defined '"$$u"' kernel \1/;p;}' \
| sort -u >$@
rm -f kernel_syms.input
CLEANFILES += kernel_syms.lst
@ -333,15 +333,18 @@ crypto.lst: $(srcdir)/lib/libgcrypt-grub/cipher/crypto.lst
platform_DATA += crypto.lst
CLEANFILES += crypto.lst
# .lst files
platform_DATA += moddep.lst
CLEANFILES += moddep.lst
syminfo.lst: gensyminfo.sh kernel_syms.lst $(MODULE_FILES)
cat kernel_syms.lst > $@.new
for m in $(MODULE_FILES); do \
sh $< $$m >> $@.new || exit 1; \
done
mv $@.new $@
# generate global module dependencies list
moddep.lst: kernel_syms.lst genmoddep.awk $(DEF_FILES) $(UND_FILES)
cat $(DEF_FILES) kernel_syms.lst /dev/null \
| $(AWK) -f $(srcdir)/genmoddep.awk $(UND_FILES) > $@ \
|| (rm -f $@; exit 1)
moddep.lst: syminfo.lst genmoddep.awk
cat $< | sort | awk -f $(srcdir)/genmoddep.awk > $@ || (rm -f $@; exit 1)
platform_DATA += moddep.lst
CLEANFILES += moddep.lst
if COND_i386_pc
if COND_ENABLE_EFIEMU

View file

@ -1403,3 +1403,8 @@ module = {
name = datehook;
common = hook/datehook.c;
};
script = {
name = gensyminfo.sh;
common = gensyminfo.sh.in;
};

View file

@ -11,23 +11,27 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Read defined symbols from stdin.
# Read symbols' info from stdin.
BEGIN {
error = 0
lineno = 0;
while (getline <"/dev/stdin") {
symtab[$1] = $2
}
}
# The rest is undefined symbols.
{
module = $2
if ($1 in symtab) {
modtab[module] = modtab[module] " " symtab[$1];
}
else if ($1 != "__gnu_local_gp") {
printf "%s in %s is not defined\n", $1, module >"/dev/stderr";
error++;
lineno++;
if ($1 == "defined")
symtab[$3] = $2;
else if ($1 == "undefined") {
if ($3 in symtab)
modtab[$2] = modtab[$2] " " symtab[$3];
else if ($3 != "__gnu_local_gp") {
printf "%s in %s is not defined\n", $3, $2 >"/dev/stderr";
error++;
}
}
else {
printf "error: %u: unrecognized input format\n", lineno;
error++;
break;
}
}
}

View file

@ -0,0 +1,34 @@
#! /bin/sh -e
#
# Copyright (C) 2010 Free Software Foundation, Inc.
#
# This gensymlist.sh is free software; the author
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
#
# Example:
#
# gensyms.sh normal.module
#
module=$1
modname=`echo $module | sed -e 's@\.module.*$@@'`
# Print all symbols defined by module
if test x@TARGET_APPLE_CC@ = x1; then
@NM@ -g -P -p $module | \
grep -E '^[a-zA-Z0-9_]* [TDS]' | \
sed "s@^\([^ ]*\).*@defined $modname \1@g"
else
@NM@ -g --defined-only -P -p $module | \
sed "s@^\([^ ]*\).*@defined $modname \1@g"
fi
# Print all undefined symbols used by module
@NM@ -u -P -p $module | sed "s@^\([^ ]*\).*@undefined $modname \1@g"