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

Showing the changes to scripts (2 of 2 files). Show all

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
211211
212212 cmd_gensymtypes = \
213213 $(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)) \
215216 $(if $(KBUILD_PRESERVE),-p) \
216217 -r $(firstword $(wildcard $(2:.symtypes=.symref) /dev/null))
217218
scripts/genksyms/genksyms.c+7−11
@@ -45,7 +45,6 @@ int in_source_file; · 44 unmodified lines
4545
4646 static int flag_debug, flag_dump_defs, flag_reference, flag_dump_types,
4747 flag_preserve, flag_warnings;
48−static const char *arch = "";
4948 static const char *mod_prefix = "";
5049
5150 static int errors;
@@ -731,7 +730,7 @@ static void genksyms_usage(void) · 679 unmodified lines
731730 {
732731 fputs("Usage:\n" "genksyms [-adDTwqhV] > /path/to/.tmp_obj.ver\n" "\n"
733732 #ifdef __GNU_LIBRARY__
734− " -a, --arch Select architecture\n"
733+ " -s, --symbol-prefix Select symbol prefix\n"
735734 " -d, --debug Increment the debug level (repeatable)\n"
736735 " -D, --dump Dump expanded symbol defs (for debugging only)\n"
737736 " -r, --reference file Read reference symbols from a file\n"
@@ -742,7 +741,7 @@ static void genksyms_usage(void) · 4 unmodified lines
742741 " -h, --help Print this message\n"
743742 " -V, --version Print the release version\n"
744743 #else /* __GNU_LIBRARY__ */
745− " -a Select architecture\n"
744+ " -s Select symbol prefix\n"
746745 " -d Increment the debug level (repeatable)\n"
747746 " -D Dump expanded symbol defs (for debugging only)\n"
748747 " -r file Read reference symbols from a file\n"
@@ -763,7 +762,7 @@ int main(int argc, char **argv) · 14 unmodified lines
763762
764763 #ifdef __GNU_LIBRARY__
765764 struct option long_opts[] = {
766− {"arch", 1, 0, 'a'},
765+ {"symbol-prefix", 1, 0, 's'},
767766 {"debug", 0, 0, 'd'},
768767 {"warnings", 0, 0, 'w'},
769768 {"quiet", 0, 0, 'q'},
@@ -776,14 +775,14 @@ int main(int argc, char **argv) · 6 unmodified lines
776775 {0, 0, 0, 0}
777776 };
778777
779− while ((o = getopt_long(argc, argv, "a:dwqVDr:T:ph",
778+ while ((o = getopt_long(argc, argv, "s:dwqVDr:T:ph",
780779 &long_opts[0], NULL)) != EOF)
781780 #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)
783782 #endif /* __GNU_LIBRARY__ */
784783 switch (o) {
785− case 'a':
786− arch = optarg;
784+ case 's':
785+ mod_prefix = optarg;
787786 break;
788787 case 'd':
789788 flag_debug++;
@@ -826,9 +825,6 @@ int main(int argc, char **argv) · 36 unmodified lines
826825 genksyms_usage();
827826 return 1;
828827 }
829− if ((strcmp(arch, "h8300") == 0) || (strcmp(arch, "blackfin") == 0) ||
830− (strcmp(arch, "metag") == 0))
831− mod_prefix = "_";
832828 {
833829 extern int yydebug;
834830 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