History

genksyms: pass symbol-prefix instead of arch

Pass symbol-prefix to genksyms instead of arch, so that the decision what symbol prefix to use is kept in one place. Basically genksyms used to take a -a $ARCH argument and it used that to determine whether to add an underscore symbol prefix. It's now changed to take a -s $SYMBOL_PREFIX argument so that the caller decides whether a symbol prefix is required. The build system then uses CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX to determine whether to pass the argument.

James Hogan committed 13 years ago

Commit d70f82a1 parent a4b6a772 files · +9 −12Browse files

Unified · Split

2 files
  1. scripts/Makefile.build +2 −1
  2. scripts/genksyms/genksyms.c +7 −11
scripts/Makefile.build+2−1
@@ -211,7 +211,8 @@ $(obj)/%.i: $(src)/%.c FORCE · 210 unmodified lines
211 211
212cmd_gensymtypes = \212cmd_gensymtypes = \
213 $(CPP) -D__GENKSYMS__ $(c_flags) $< | \213 $(CPP) -D__GENKSYMS__ $(c_flags) $< | \
214 $(GENKSYMS) $(if $(1), -T $(2)) -a $(ARCH) \214 $(GENKSYMS) $(if $(1), -T $(2)) \
215 $(patsubst y,-s _,$(CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX)) \
215 $(if $(KBUILD_PRESERVE),-p) \216 $(if $(KBUILD_PRESERVE),-p) \
216 -r $(firstword $(wildcard $(2:.symtypes=.symref) /dev/null))217 -r $(firstword $(wildcard $(2:.symtypes=.symref) /dev/null))
217 218
scripts/genksyms/genksyms.c+7−11
@@ -45,7 +45,6 @@ int in_source_file; · 44 unmodified lines
45 45
46static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types,46static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types,
47 flag_preserve, flag_warnings;47 flag_preserve, flag_warnings;
48static const char *arch = "";
49static const char *mod_prefix = "";48static const char *mod_prefix = "";
50 49
51static int errors;50static int errors;
@@ -731,7 +730,7 @@ static void genksyms_usage(void) · 679 unmodified lines
731{730{
732 fputs("Usage:\n" "genksyms [-adDTwqhV] > /path/to/.tmp_obj.ver\n" "\n"731 fputs("Usage:\n" "genksyms [-adDTwqhV] > /path/to/.tmp_obj.ver\n" "\n"
733#ifdef __GNU_LIBRARY__732#ifdef __GNU_LIBRARY__
734 " -a, --arch Select architecture\n"733 " -s, --symbol-prefix Select symbol prefix\n"
735 " -d, --debug Increment the debug level (repeatable)\n"734 " -d, --debug Increment the debug level (repeatable)\n"
736 " -D, --dump Dump expanded symbol defs (for debugging only)\n"735 " -D, --dump Dump expanded symbol defs (for debugging only)\n"
737 " -r, --reference file Read reference symbols from a file\n"736 " -r, --reference file Read reference symbols from a file\n"
@@ -742,7 +741,7 @@ static void genksyms_usage(void) · 4 unmodified lines
742 " -h, --help Print this message\n"741 " -h, --help Print this message\n"
743 " -V, --version Print the release version\n"742 " -V, --version Print the release version\n"
744#else /* __GNU_LIBRARY__ */743#else /* __GNU_LIBRARY__ */
745 " -a Select architecture\n"744 " -s Select symbol prefix\n"
746 " -d Increment the debug level (repeatable)\n"745 " -d Increment the debug level (repeatable)\n"
747 " -D Dump expanded symbol defs (for debugging only)\n"746 " -D Dump expanded symbol defs (for debugging only)\n"
748 " -r file Read reference symbols from a file\n"747 " -r file Read reference symbols from a file\n"
@@ -763,7 +762,7 @@ int main(int argc, char **argv) · 14 unmodified lines
763 762
764#ifdef __GNU_LIBRARY__763#ifdef __GNU_LIBRARY__
765 struct option long_opts[] = {764 struct option long_opts[] = {
766 {"arch", 1, 0, 'a'},765 {"symbol-prefix", 1, 0, 's'},
767 {"debug", 0, 0, 'd'},766 {"debug", 0, 0, 'd'},
768 {"warnings", 0, 0, 'w'},767 {"warnings", 0, 0, 'w'},
769 {"quiet", 0, 0, 'q'},768 {"quiet", 0, 0, 'q'},
@@ -776,14 +775,14 @@ int main(int argc, char **argv) · 6 unmodified lines
776 {0, 0, 0, 0}775 {0, 0, 0, 0}
777 };776 };
778 777
779 while ((o = getopt_long(argc, argv, "a:dwqVDr:T:ph",778 while ((o = getopt_long(argc, argv, "s:dwqVDr:T:ph",
780 &long_opts[0], NULL)) != EOF)779 &long_opts[0], NULL)) != EOF)
781#else /* __GNU_LIBRARY__ */780#else /* __GNU_LIBRARY__ */
782 while ((o = getopt(argc, argv, "a:dwqVDr:T:ph")) != EOF)781 while ((o = getopt(argc, argv, "s:dwqVDr:T:ph")) != EOF)
783#endif /* __GNU_LIBRARY__ */782#endif /* __GNU_LIBRARY__ */
784 switch (o) {783 switch (o) {
785 case 'a':784 case 's':
786 arch = optarg;785 mod_prefix = optarg;
787 break;786 break;
788 case 'd':787 case 'd':
789 flag_debug++;788 flag_debug++;
@@ -826,9 +825,6 @@ int main(int argc, char **argv) · 36 unmodified lines
826 genksyms_usage();825 genksyms_usage();
827 return 1;826 return 1;
828 }827 }
829 if ((strcmp(arch, "h8300") == 0) || (strcmp(arch, "blackfin") == 0) ||
830 (strcmp(arch, "metag") == 0))
831 mod_prefix = "_";
832 {828 {
833 extern int yydebug;829 extern int yydebug;
834 extern int yy_flex_debug;830 extern int yy_flex_debug;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t