diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-03-12 16:54:34 -0500 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-03-12 16:54:34 -0500 |
commit | c79c7b0923ff353d12194e83628bcca5a8606564 (patch) | |
tree | edea52fad10d6961004d26a9c17e73bd44560a71 /scripts | |
parent | 172c3ae3e686f548a0eba950405e5cc321460005 (diff) |
kbuild: fix genksyms build error
genksyms needs to know when a symbol must have a "_" prefex as is
true for a few architectures.
Pass $(ARCH) as commandline argument and hardcode what architectures that
needs this info.
Previous attemt to take it from elfconfig.h was br0ken since elfconfig.h
is a generated file.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 2 | ||||
-rw-r--r-- | scripts/genksyms/genksyms.c | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 7afe3e76cb5a..19ef2bc514c2 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -166,7 +166,7 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $< | |||
166 | cmd_modversions = \ | 166 | cmd_modversions = \ |
167 | if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ | 167 | if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ |
168 | $(CPP) -D__GENKSYMS__ $(c_flags) $< \ | 168 | $(CPP) -D__GENKSYMS__ $(c_flags) $< \ |
169 | | $(GENKSYMS) \ | 169 | | $(GENKSYMS) -a $(ARCH) \ |
170 | > $(@D)/.tmp_$(@F:.o=.ver); \ | 170 | > $(@D)/.tmp_$(@F:.o=.ver); \ |
171 | \ | 171 | \ |
172 | $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ | 172 | $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ |
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c index ef8822e59cda..da8ff4fa5001 100644 --- a/scripts/genksyms/genksyms.c +++ b/scripts/genksyms/genksyms.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #endif /* __GNU_LIBRARY__ */ | 32 | #endif /* __GNU_LIBRARY__ */ |
33 | 33 | ||
34 | #include "genksyms.h" | 34 | #include "genksyms.h" |
35 | #include "../mod/elfconfig.h" | ||
36 | /*----------------------------------------------------------------------*/ | 35 | /*----------------------------------------------------------------------*/ |
37 | 36 | ||
38 | #define HASH_BUCKETS 4096 | 37 | #define HASH_BUCKETS 4096 |
@@ -44,6 +43,8 @@ int cur_line = 1; | |||
44 | char *cur_filename, *output_directory; | 43 | char *cur_filename, *output_directory; |
45 | 44 | ||
46 | int flag_debug, flag_dump_defs, flag_warnings; | 45 | int flag_debug, flag_dump_defs, flag_warnings; |
46 | const char *arch = ""; | ||
47 | const char *mod_prefix = ""; | ||
47 | 48 | ||
48 | static int errors; | 49 | static int errors; |
49 | static int nsyms; | 50 | static int nsyms; |
@@ -458,7 +459,7 @@ export_symbol(const char *name) | |||
458 | fputs(">\n", debugfile); | 459 | fputs(">\n", debugfile); |
459 | 460 | ||
460 | /* Used as a linker script. */ | 461 | /* Used as a linker script. */ |
461 | printf("%s__crc_%s = 0x%08lx ;\n", MODULE_SYMBOL_PREFIX, name, crc); | 462 | printf("%s__crc_%s = 0x%08lx ;\n", mod_prefix, name, crc); |
462 | } | 463 | } |
463 | } | 464 | } |
464 | 465 | ||
@@ -529,6 +530,7 @@ main(int argc, char **argv) | |||
529 | 530 | ||
530 | #ifdef __GNU_LIBRARY__ | 531 | #ifdef __GNU_LIBRARY__ |
531 | struct option long_opts[] = { | 532 | struct option long_opts[] = { |
533 | {"arch", 1, 0, 'a'}, | ||
532 | {"debug", 0, 0, 'd'}, | 534 | {"debug", 0, 0, 'd'}, |
533 | {"warnings", 0, 0, 'w'}, | 535 | {"warnings", 0, 0, 'w'}, |
534 | {"quiet", 0, 0, 'q'}, | 536 | {"quiet", 0, 0, 'q'}, |
@@ -538,13 +540,16 @@ main(int argc, char **argv) | |||
538 | {0, 0, 0, 0} | 540 | {0, 0, 0, 0} |
539 | }; | 541 | }; |
540 | 542 | ||
541 | while ((o = getopt_long(argc, argv, "dwqVDk:p:", | 543 | while ((o = getopt_long(argc, argv, "a:dwqVDk:p:", |
542 | &long_opts[0], NULL)) != EOF) | 544 | &long_opts[0], NULL)) != EOF) |
543 | #else /* __GNU_LIBRARY__ */ | 545 | #else /* __GNU_LIBRARY__ */ |
544 | while ((o = getopt(argc, argv, "dwqVDk:p:")) != EOF) | 546 | while ((o = getopt(argc, argv, "a:dwqVDk:p:")) != EOF) |
545 | #endif /* __GNU_LIBRARY__ */ | 547 | #endif /* __GNU_LIBRARY__ */ |
546 | switch (o) | 548 | switch (o) |
547 | { | 549 | { |
550 | case 'a': | ||
551 | arch = optarg; | ||
552 | break; | ||
548 | case 'd': | 553 | case 'd': |
549 | flag_debug++; | 554 | flag_debug++; |
550 | break; | 555 | break; |
@@ -567,7 +572,9 @@ main(int argc, char **argv) | |||
567 | genksyms_usage(); | 572 | genksyms_usage(); |
568 | return 1; | 573 | return 1; |
569 | } | 574 | } |
570 | 575 | if ((strcmp(arch, "v850") == 0) || | |
576 | (strcmp(arch, "h8300") == 0)) | ||
577 | mod_prefix = "_"; | ||
571 | { | 578 | { |
572 | extern int yydebug; | 579 | extern int yydebug; |
573 | extern int yy_flex_debug; | 580 | extern int yy_flex_debug; |