提交 c79c7b09 编写于 作者: S Sam Ravnborg

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: NSam Ravnborg <sam@ravnborg.org>
上级 172c3ae3
...@@ -166,7 +166,7 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $< ...@@ -166,7 +166,7 @@ cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
cmd_modversions = \ cmd_modversions = \
if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \ if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then \
$(CPP) -D__GENKSYMS__ $(c_flags) $< \ $(CPP) -D__GENKSYMS__ $(c_flags) $< \
| $(GENKSYMS) \ | $(GENKSYMS) -a $(ARCH) \
> $(@D)/.tmp_$(@F:.o=.ver); \ > $(@D)/.tmp_$(@F:.o=.ver); \
\ \
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#endif /* __GNU_LIBRARY__ */ #endif /* __GNU_LIBRARY__ */
#include "genksyms.h" #include "genksyms.h"
#include "../mod/elfconfig.h"
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
#define HASH_BUCKETS 4096 #define HASH_BUCKETS 4096
...@@ -44,6 +43,8 @@ int cur_line = 1; ...@@ -44,6 +43,8 @@ int cur_line = 1;
char *cur_filename, *output_directory; char *cur_filename, *output_directory;
int flag_debug, flag_dump_defs, flag_warnings; int flag_debug, flag_dump_defs, flag_warnings;
const char *arch = "";
const char *mod_prefix = "";
static int errors; static int errors;
static int nsyms; static int nsyms;
...@@ -458,7 +459,7 @@ export_symbol(const char *name) ...@@ -458,7 +459,7 @@ export_symbol(const char *name)
fputs(">\n", debugfile); fputs(">\n", debugfile);
/* Used as a linker script. */ /* Used as a linker script. */
printf("%s__crc_%s = 0x%08lx ;\n", MODULE_SYMBOL_PREFIX, name, crc); printf("%s__crc_%s = 0x%08lx ;\n", mod_prefix, name, crc);
} }
} }
...@@ -529,6 +530,7 @@ main(int argc, char **argv) ...@@ -529,6 +530,7 @@ main(int argc, char **argv)
#ifdef __GNU_LIBRARY__ #ifdef __GNU_LIBRARY__
struct option long_opts[] = { struct option long_opts[] = {
{"arch", 1, 0, 'a'},
{"debug", 0, 0, 'd'}, {"debug", 0, 0, 'd'},
{"warnings", 0, 0, 'w'}, {"warnings", 0, 0, 'w'},
{"quiet", 0, 0, 'q'}, {"quiet", 0, 0, 'q'},
...@@ -538,13 +540,16 @@ main(int argc, char **argv) ...@@ -538,13 +540,16 @@ main(int argc, char **argv)
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
while ((o = getopt_long(argc, argv, "dwqVDk:p:", while ((o = getopt_long(argc, argv, "a:dwqVDk:p:",
&long_opts[0], NULL)) != EOF) &long_opts[0], NULL)) != EOF)
#else /* __GNU_LIBRARY__ */ #else /* __GNU_LIBRARY__ */
while ((o = getopt(argc, argv, "dwqVDk:p:")) != EOF) while ((o = getopt(argc, argv, "a:dwqVDk:p:")) != EOF)
#endif /* __GNU_LIBRARY__ */ #endif /* __GNU_LIBRARY__ */
switch (o) switch (o)
{ {
case 'a':
arch = optarg;
break;
case 'd': case 'd':
flag_debug++; flag_debug++;
break; break;
...@@ -567,7 +572,9 @@ main(int argc, char **argv) ...@@ -567,7 +572,9 @@ main(int argc, char **argv)
genksyms_usage(); genksyms_usage();
return 1; return 1;
} }
if ((strcmp(arch, "v850") == 0) ||
(strcmp(arch, "h8300") == 0))
mod_prefix = "_";
{ {
extern int yydebug; extern int yydebug;
extern int yy_flex_debug; extern int yy_flex_debug;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册