aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2013-03-18 05:08:56 -0400
committerRusty Russell <rusty@rustcorp.com.au>2013-03-19 20:57:27 -0400
commitd70f82acf32affa78ae4957caa0fb2a550d2c6ea (patch)
treea2de468af34a67f06057f7ef38225e500d5f78de /scripts
parenta4b6a77b77ba4f526392612c2365797fab956014 (diff)
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. Signed-off-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build3
-rw-r--r--scripts/genksyms/genksyms.c18
2 files changed, 9 insertions, 12 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 0e801c3cdaf8..d5d859c80729 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -211,7 +211,8 @@ $(obj)/%.i: $(src)/%.c FORCE
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
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
index d25e4a118d37..88632df4381b 100644
--- a/scripts/genksyms/genksyms.c
+++ b/scripts/genksyms/genksyms.c
@@ -45,7 +45,6 @@ int in_source_file;
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)
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)
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)
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)
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)
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;