From 544e433a9e2a8771b8281ac58acb5c794613e705 Mon Sep 17 00:00:00 2001 From: Cheng Renquan Date: Sun, 12 Jul 2009 16:11:43 +0800 Subject: kconfig: add symbol value to help find the real depend Sometimes when configuring need to disable some unused item, but the item is selected by many other items, it's hard to find the real dependency which selected it, This patch add every symbol's value accompanied to make it possible to find the real dependency easily. An example is CONFIG_RFKILL, ---------------------- RF switch subsystem support ---------------------- | CONFIG_RFKILL: | | | | Say Y here if you want to have control over RF switches | | found on many WiFi and Bluetooth cards. | | | | To compile this driver as a module, choose M here: the | | module will be called rfkill. | | | | Symbol: RFKILL [=m] | | Prompt: RF switch subsystem support | | Defined at net/rfkill/Kconfig:4 | | Depends on: NET [=y] | | Location: | | -> Networking support (NET [=y]) | | Selected by: IWLCORE [=n] && NETDEVICES [=y] && !S390 [=S390] && PC | | | ----------------------------------------------------------------( 99%)--- Signed-off-by: Cheng Renquan Cc: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/expr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index 579ece4fa584..cd8a2f00a97e 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -1098,6 +1098,8 @@ void expr_fprint(struct expr *e, FILE *out) static void expr_print_gstr_helper(void *data, struct symbol *sym, const char *str) { str_append((struct gstr*)data, str); + if (sym) + str_printf((struct gstr*)data, " [=%s]", sym_get_string_value(sym)); } void expr_gstr_print(struct expr *e, struct gstr *gs) -- cgit v1.2.3 From 6bd5999d1a6166ad357f2ebf5e998ce49a407f62 Mon Sep 17 00:00:00 2001 From: Cheng Renquan Date: Sun, 12 Jul 2009 16:11:44 +0800 Subject: kconfig: add menu_get_ext_help function to display more information The three functions are moved from mconf.c, then they can be shared in all menuconfig & gconfig & xconfig & config. +void menu_get_ext_help(struct menu *menu, struct gstr *help) +static void get_prompt_str(struct gstr *r, struct property *prop) +void get_symbol_str(struct gstr *r, struct symbol *sym) Signed-off-by: Cheng Renquan Cc: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/lkc_proto.h | 2 ++ scripts/kconfig/menu.c | 79 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) (limited to 'scripts') diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 8e69461313d1..ffeb532b2cff 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h @@ -17,6 +17,8 @@ P(menu_get_root_menu,struct menu *,(struct menu *menu)); P(menu_get_parent_menu,struct menu *,(struct menu *menu)); P(menu_has_help,bool,(struct menu *menu)); P(menu_get_help,const char *,(struct menu *menu)); +P(get_symbol_str,void,(struct gstr *r, struct symbol *sym)); +P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help)); /* symbol.c */ P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]); diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 07ff8d105c9d..931d782a2392 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -9,6 +9,9 @@ #define LKC_DIRECT_LINK #include "lkc.h" +static const char nohelp_text[] = N_( + "There is no help available for this kernel option.\n"); + struct menu rootmenu; static struct menu **last_entry_ptr; @@ -451,3 +454,79 @@ const char *menu_get_help(struct menu *menu) else return ""; } + +static void get_prompt_str(struct gstr *r, struct property *prop) +{ + int i, j; + struct menu *submenu[8], *menu; + + str_printf(r, _("Prompt: %s\n"), _(prop->text)); + str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name, + prop->menu->lineno); + if (!expr_is_yes(prop->visible.expr)) { + str_append(r, _(" Depends on: ")); + expr_gstr_print(prop->visible.expr, r); + str_append(r, "\n"); + } + menu = prop->menu->parent; + for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) + submenu[i++] = menu; + if (i > 0) { + str_printf(r, _(" Location:\n")); + for (j = 4; --i >= 0; j += 2) { + menu = submenu[i]; + str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); + if (menu->sym) { + str_printf(r, " (%s [=%s])", menu->sym->name ? + menu->sym->name : _(""), + sym_get_string_value(menu->sym)); + } + str_append(r, "\n"); + } + } +} + +void get_symbol_str(struct gstr *r, struct symbol *sym) +{ + bool hit; + struct property *prop; + + if (sym && sym->name) + str_printf(r, "Symbol: %s [=%s]\n", sym->name, + sym_get_string_value(sym)); + for_all_prompts(sym, prop) + get_prompt_str(r, prop); + hit = false; + for_all_properties(sym, prop, P_SELECT) { + if (!hit) { + str_append(r, " Selects: "); + hit = true; + } else + str_printf(r, " && "); + expr_gstr_print(prop->expr, r); + } + if (hit) + str_append(r, "\n"); + if (sym->rev_dep.expr) { + str_append(r, _(" Selected by: ")); + expr_gstr_print(sym->rev_dep.expr, r); + str_append(r, "\n"); + } + str_append(r, "\n\n"); +} + +void menu_get_ext_help(struct menu *menu, struct gstr *help) +{ + struct symbol *sym = menu->sym; + + if (menu_has_help(menu)) { + if (sym->name) { + str_printf(help, "CONFIG_%s:\n\n", sym->name); + str_append(help, _(menu_get_help(menu))); + str_append(help, "\n"); + } + } else { + str_append(help, nohelp_text); + } + get_symbol_str(help, sym); +} -- cgit v1.2.3 From 1d525e7c1f8c34b74ddeb317f18c2ca9e9d81884 Mon Sep 17 00:00:00 2001 From: Cheng Renquan Date: Sun, 12 Jul 2009 16:11:45 +0800 Subject: kconfig: make use of menu_get_ext_help in menuconfig The removed functions are moved into menu.c for sharing with gconfig & xconfig & config. Signed-off-by: Cheng Renquan Cc: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/mconf.c | 78 ++----------------------------------------------- 1 file changed, 3 insertions(+), 75 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 25b60bc117f7..d82953573588 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -199,8 +199,6 @@ inputbox_instructions_string[] = N_( setmod_text[] = N_( "This feature depends on another which has been configured as a module.\n" "As a result, this feature will be built as a module."), -nohelp_text[] = N_( - "There is no help available for this kernel option.\n"), load_config_text[] = N_( "Enter the name of the configuration file you wish to load. " "Accept the name shown to restore the configuration you " @@ -284,66 +282,6 @@ static void show_textbox(const char *title, const char *text, int r, int c); static void show_helptext(const char *title, const char *text); static void show_help(struct menu *menu); -static void get_prompt_str(struct gstr *r, struct property *prop) -{ - int i, j; - struct menu *submenu[8], *menu; - - str_printf(r, _("Prompt: %s\n"), _(prop->text)); - str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name, - prop->menu->lineno); - if (!expr_is_yes(prop->visible.expr)) { - str_append(r, _(" Depends on: ")); - expr_gstr_print(prop->visible.expr, r); - str_append(r, "\n"); - } - menu = prop->menu->parent; - for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) - submenu[i++] = menu; - if (i > 0) { - str_printf(r, _(" Location:\n")); - for (j = 4; --i >= 0; j += 2) { - menu = submenu[i]; - str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); - if (menu->sym) { - str_printf(r, " (%s [=%s])", menu->sym->name ? - menu->sym->name : _(""), - sym_get_string_value(menu->sym)); - } - str_append(r, "\n"); - } - } -} - -static void get_symbol_str(struct gstr *r, struct symbol *sym) -{ - bool hit; - struct property *prop; - - if (sym && sym->name) - str_printf(r, "Symbol: %s [=%s]\n", sym->name, - sym_get_string_value(sym)); - for_all_prompts(sym, prop) - get_prompt_str(r, prop); - hit = false; - for_all_properties(sym, prop, P_SELECT) { - if (!hit) { - str_append(r, " Selects: "); - hit = true; - } else - str_printf(r, " && "); - expr_gstr_print(prop->expr, r); - } - if (hit) - str_append(r, "\n"); - if (sym->rev_dep.expr) { - str_append(r, _(" Selected by: ")); - expr_gstr_print(sym->rev_dep.expr, r); - str_append(r, "\n"); - } - str_append(r, "\n\n"); -} - static struct gstr get_relations_str(struct symbol **sym_arr) { struct symbol *sym; @@ -699,19 +637,9 @@ static void show_helptext(const char *title, const char *text) static void show_help(struct menu *menu) { struct gstr help = str_new(); - struct symbol *sym = menu->sym; - - if (menu_has_help(menu)) - { - if (sym->name) { - str_printf(&help, "CONFIG_%s:\n\n", sym->name); - str_append(&help, _(menu_get_help(menu))); - str_append(&help, "\n"); - } - } else { - str_append(&help, nohelp_text); - } - get_symbol_str(&help, sym); + + menu_get_ext_help(menu, &help); + show_helptext(_(menu_get_prompt(menu)), str_get(&help)); str_free(&help); } -- cgit v1.2.3 From d74c15f3b71804472dde59355d4960ce8287dae8 Mon Sep 17 00:00:00 2001 From: Cheng Renquan Date: Sun, 12 Jul 2009 16:11:47 +0800 Subject: kconfig: make use of menu_get_ext_help in qconfig Signed-off-by: Cheng Renquan Cc: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/qconf.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index ce7d508c7520..00c51507cfcc 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -1042,12 +1042,10 @@ void ConfigInfoView::menuInfo(void) if (showDebug()) debug = debug_info(sym); - help = menu_get_help(menu); - /* Gettextize if the help text not empty */ - if (help.isEmpty()) - help = print_filter(menu_get_help(menu)); - else - help = print_filter(_(menu_get_help(menu))); + struct gstr help_gstr = str_new(); + menu_get_ext_help(menu, &help_gstr); + help = print_filter(str_get(&help_gstr)); + str_free(&help_gstr); } else if (menu->prompt) { head += ""; head += print_filter(_(menu->prompt->text)); -- cgit v1.2.3 From 66c4bd808508ae99e00e979ab3e9a1c6a6a7ad45 Mon Sep 17 00:00:00 2001 From: Cheng Renquan Date: Sun, 12 Jul 2009 16:11:48 +0800 Subject: kconfig: make use of menu_get_ext_help in "make config" Signed-off-by: Cheng Renquan Cc: Roman Zippel Signed-off-by: Sam Ravnborg --- scripts/kconfig/conf.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 3baaaecd6b13..5de3303e65f5 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -38,14 +38,14 @@ static int conf_cnt; static char line[128]; static struct menu *rootEntry; -static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); - -static const char *get_help(struct menu *menu) +static void print_help(struct menu *menu) { - if (menu_has_help(menu)) - return _(menu_get_help(menu)); - else - return nohelp_text; + struct gstr help = str_new(); + + menu_get_ext_help(menu, &help); + + printf("\n%s\n", str_get(&help)); + str_free(&help); } static void strip(char *str) @@ -140,7 +140,7 @@ int conf_string(struct menu *menu) case '?': /* print help */ if (line[1] == '\n') { - printf("\n%s\n", get_help(menu)); + print_help(menu); def = NULL; break; } @@ -220,7 +220,7 @@ static int conf_sym(struct menu *menu) if (sym_set_tristate_value(sym, newval)) return 0; help: - printf("\n%s\n", get_help(menu)); + print_help(menu); } } @@ -307,7 +307,7 @@ static int conf_choice(struct menu *menu) fgets(line, 128, stdin); strip(line); if (line[0] == '?') { - printf("\n%s\n", get_help(menu)); + print_help(menu); continue; } if (!line[0]) @@ -331,7 +331,7 @@ static int conf_choice(struct menu *menu) if (!child) continue; if (line[strlen(line) - 1] == '?') { - printf("\n%s\n", get_help(child)); + print_help(child); continue; } sym_set_choice_value(sym, child->sym); -- cgit v1.2.3 From 4779105e03cdb6639706991081839451d709230b Mon Sep 17 00:00:00 2001 From: Cheng Renquan Date: Sun, 12 Jul 2009 16:11:46 +0800 Subject: kconfig: make use of menu_get_ext_help in gconfig Futhermore, gconfig interface lack the "search a symbol" function, do later. Signed-off-by: Cheng Renquan Cc: Roman Zippel [sam: fix SEGV in gconfig] Signed-off-by: Sam Ravnborg --- scripts/kconfig/gconf.c | 21 ++++----------------- scripts/kconfig/menu.c | 3 ++- 2 files changed, 6 insertions(+), 18 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 199b22bb49e2..65464366fe38 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -456,19 +456,9 @@ static void text_insert_help(struct menu *menu) GtkTextBuffer *buffer; GtkTextIter start, end; const char *prompt = _(menu_get_prompt(menu)); - gchar *name; - const char *help; + struct gstr help = str_new(); - help = menu_get_help(menu); - - /* Gettextize if the help text not empty */ - if ((help != 0) && (help[0] != 0)) - help = _(help); - - if (menu->sym && menu->sym->name) - name = g_strdup_printf(menu->sym->name); - else - name = g_strdup(""); + menu_get_ext_help(menu, &help); buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w)); gtk_text_buffer_get_bounds(buffer, &start, &end); @@ -478,14 +468,11 @@ static void text_insert_help(struct menu *menu) gtk_text_buffer_get_end_iter(buffer, &end); gtk_text_buffer_insert_with_tags(buffer, &end, prompt, -1, tag1, NULL); - gtk_text_buffer_insert_at_cursor(buffer, " ", 1); - gtk_text_buffer_get_end_iter(buffer, &end); - gtk_text_buffer_insert_with_tags(buffer, &end, name, -1, tag1, - NULL); gtk_text_buffer_insert_at_cursor(buffer, "\n\n", 2); gtk_text_buffer_get_end_iter(buffer, &end); - gtk_text_buffer_insert_with_tags(buffer, &end, help, -1, tag2, + gtk_text_buffer_insert_with_tags(buffer, &end, str_get(&help), -1, tag2, NULL); + str_free(&help); } diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 931d782a2392..b74f74687005 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -528,5 +528,6 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help) } else { str_append(help, nohelp_text); } - get_symbol_str(help, sym); + if (sym) + get_symbol_str(help, sym); } -- cgit v1.2.3 From f86fd306605287d7c7f4f0f8e8e2a9d49d28b396 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sat, 19 Sep 2009 10:14:33 +0200 Subject: kbuild: rename ld-option to cc-ldoption ld-option is misnamed as it test options to gcc, not to ld. Renamed it to reflect this. Cc: Andi Kleen Cc: Roland McGrath Signed-off-by: Sam Ravnborg --- scripts/Kbuild.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index c29be8f90248..94a4f682f385 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -130,9 +130,9 @@ cc-fullversion = $(shell $(CONFIG_SHELL) \ # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ] && echo $(3)) -# ld-option -# Usage: ldflags += $(call ld-option, -Wl$(comma)--hash-style=both) -ld-option = $(call try-run,\ +# cc-ldoption +# Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) +cc-ldoption = $(call try-run,\ $(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2)) ###### -- cgit v1.2.3 From 691ef3e7fdc1fe4dded169d9404f740987f67d66 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sat, 19 Sep 2009 10:31:45 +0200 Subject: kbuild: introduce ld-option ld-option is used to check if $(LD) supports a specific option. Based on patch from Andi Kleen. Cc: Andi Kleen Signed-off-by: Sam Ravnborg First use is to check if option -X is supported (upcoming patch). Theis is ne --- scripts/Kbuild.include | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 94a4f682f385..b3452601b0b1 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -83,11 +83,12 @@ TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) # is automatically cleaned up. try-run = $(shell set -e; \ TMP="$(TMPOUT).$$$$.tmp"; \ + TMPO="$(TMPOUT).$$$$.o"; \ if ($(1)) >/dev/null 2>&1; \ then echo "$(2)"; \ else echo "$(3)"; \ fi; \ - rm -f "$$TMP") + rm -f "$$TMP" "$$TMPO") # as-option # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) @@ -135,6 +136,11 @@ cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ] && echo $(3)) cc-ldoption = $(call try-run,\ $(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2)) +# ld-option +# Usage: LDFLAGS += $(call ld-option, -X) +ld-option = $(call try-run,\ + $(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2)) + ###### ### -- cgit v1.2.3 From 7db86dc97fb0c47af63e6b965e8ff37126050d25 Mon Sep 17 00:00:00 2001 From: Stefani Seibold Date: Fri, 18 Sep 2009 12:49:24 -0700 Subject: ctags: usability fix The tag file generated by the tags.sh script has some issue. First: The identifier-list miss the DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL special handling, which can result in a wrong tag, not to jump to the right variable definition or function implementation. Second: It makes no real sense to include function prototypes and external and forward variable declarations, because jumping to a tag will sometimes go to this and not to the real definition and implementation. The information about the declaration is still there at the definition and implementation place. So this patch make it lot easier to navigate through the kernel source tree using vi. Signed-off-by: Stefani Seibold Acked-by: WANG Cong Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/tags.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/tags.sh b/scripts/tags.sh index 4a34ec591e8c..d52f7a01557c 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -101,7 +101,8 @@ exuberant() -I ____cacheline_aligned_in_smp \ -I ____cacheline_internodealigned_in_smp \ -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ - --extra=+f --c-kinds=+px \ + -I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \ + --extra=+f --c-kinds=-px \ --regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \ --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' -- cgit v1.2.3 From d9a7a2bd07ed3b838d95559d547061afcf3e45f6 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 18 Sep 2009 12:49:25 -0700 Subject: checkincludes.pl: close file as soon as we're done with it Signed-off-by: Luis R. Rodriguez Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/checkincludes.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/checkincludes.pl b/scripts/checkincludes.pl index 8e6b716c191c..32ebff659fcc 100755 --- a/scripts/checkincludes.pl +++ b/scripts/checkincludes.pl @@ -13,12 +13,12 @@ foreach $file (@ARGV) { ++$includedfiles{$1}; } } + + close(FILE); foreach $filename (keys %includedfiles) { if ($includedfiles{$filename} > 1) { print "$file: $filename is included more than once.\n"; } } - - close(FILE); } -- cgit v1.2.3 From f9d490ab374236a115440c771ecf0fb2890eb929 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 18 Sep 2009 12:49:26 -0700 Subject: checkincludes.pl: provide usage helper Signed-off-by: Luis R. Rodriguez Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/checkincludes.pl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/checkincludes.pl b/scripts/checkincludes.pl index 32ebff659fcc..4bff13985ebd 100755 --- a/scripts/checkincludes.pl +++ b/scripts/checkincludes.pl @@ -3,6 +3,15 @@ # checkincludes: Find files included more than once in (other) files. # Copyright abandoned, 2000, Niels Kristian Bech Jensen . +sub usage { + print "Usage: checkincludes.pl \n"; + exit 1; +} + +if ($#ARGV < 0) { + usage(); +} + foreach $file (@ARGV) { open(FILE, $file) or die "Cannot open $file: $!.\n"; -- cgit v1.2.3 From 82fa39552fd858468a5647fa58d14955ecd50eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87aglayan?= Date: Fri, 18 Sep 2009 12:49:27 -0700 Subject: markup_oops: use modinfo to avoid confusion with underscored module names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When EIP is at a module having an underscore in its name, the current code fails to find it because the module filenames has '-' instead of '_'. Use modinfo for a better path finding. Signed-off-by: Ozan Çaglayan Acked-by: WANG Cong Cc: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/markup_oops.pl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl index 89774011965d..5f0fcb712e29 100644 --- a/scripts/markup_oops.pl +++ b/scripts/markup_oops.pl @@ -184,10 +184,7 @@ if ($target eq "0") { # if it's a module, we need to find the .ko file and calculate a load offset if ($module ne "") { - my $dir = dirname($filename); - $dir = $dir . "/"; - my $mod = $module . ".ko"; - my $modulefile = `find $dir -name $mod | head -1`; + my $modulefile = `modinfo $module | grep '^filename:' | awk '{ print \$2 }'`; chomp($modulefile); $filename = $modulefile; if ($filename eq "") { -- cgit v1.2.3 From 92f3f19c519d2eb18812a38312b05075cf0407db Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 18 Sep 2009 12:49:27 -0700 Subject: checkincludes.pl: add option to remove duplicates in place checkincludes.pl is more useful if it actually removed the lines. This adds support for that with -r. [akpm@linux-foundation.org: improve usage message] Signed-off-by: Luis R. Rodriguez Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/checkincludes.pl | 66 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/checkincludes.pl b/scripts/checkincludes.pl index 4bff13985ebd..676ddc07d6fa 100755 --- a/scripts/checkincludes.pl +++ b/scripts/checkincludes.pl @@ -1,33 +1,85 @@ #!/usr/bin/perl # -# checkincludes: Find files included more than once in (other) files. +# checkincludes: find/remove files included more than once +# # Copyright abandoned, 2000, Niels Kristian Bech Jensen . +# Copyright 2009 Luis R. Rodriguez +# +# This script checks for duplicate includes. It also has support +# to remove them in place. Note that this will not take into +# consideration macros so you should run this only if you know +# you do have real dups and do not have them under #ifdef's. You +# could also just review the results. sub usage { - print "Usage: checkincludes.pl \n"; + print "Usage: checkincludes.pl [-r]\n"; + print "By default we just warn of duplicates\n"; + print "To remove duplicated includes in place use -r\n"; exit 1; } +my $remove = 0; + if ($#ARGV < 0) { - usage(); + usage(); +} + +if ($#ARGV >= 1) { + if ($ARGV[0] =~ /^-/) { + if ($ARGV[0] eq "-r") { + $remove = 1; + shift; + } else { + usage(); + } + } } foreach $file (@ARGV) { open(FILE, $file) or die "Cannot open $file: $!.\n"; my %includedfiles = (); + my @file_lines = (); while () { if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) { ++$includedfiles{$1}; } + push(@file_lines, $_); } close(FILE); - - foreach $filename (keys %includedfiles) { - if ($includedfiles{$filename} > 1) { - print "$file: $filename is included more than once.\n"; + + if (!$remove) { + foreach $filename (keys %includedfiles) { + if ($includedfiles{$filename} > 1) { + print "$file: $filename is included more than once.\n"; + } } + next; } + + open(FILE,">$file") || die("Cannot write to $file: $!"); + + my $dups = 0; + foreach (@file_lines) { + if (m/^\s*#\s*include\s*[<"](\S*)[>"]/o) { + foreach $filename (keys %includedfiles) { + if ($1 eq $filename) { + if ($includedfiles{$filename} > 1) { + $includedfiles{$filename}--; + $dups++; + } else { + print FILE $_; + } + } + } + } else { + print FILE $_; + } + } + if ($dups > 0) { + print "$file: removed $dups duplicate includes\n"; + } + close(FILE); } -- cgit v1.2.3 From c47efe5548abbf53c2f66e06dcb46183b11d6b22 Mon Sep 17 00:00:00 2001 From: "Jory A. Pratt" Date: Fri, 18 Sep 2009 12:49:31 -0700 Subject: kbuild: fix cc1 options check to ensure we do not use -fPIC when compiling The arch/*/boot/Makefile use cc-options to check for GCC command options and cc-options use the hardened specs when checking for GCC command options. When -fPIE is pass to cc1 it can't use -ffreestanding or -fno-toplevel-reorder. Then it fail to build stuff with -ffreestanding and -fno-toplevel-reorder. Thanks to Fredric Johansson for finding the main problem behind a failed build using a hardened toolchain. Signed-off-by: Magnus Granberg Signed-off-by: Jory A. Pratt Cc: Fredric Johansson Cc: "H. Peter Anvin" Signed-off-by: Andrew Morton Cc: Signed-off-by: Sam Ravnborg --- scripts/Kbuild.include | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index b3452601b0b1..4f9c1908593b 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -106,12 +106,12 @@ as-instr = $(call try-run,\ # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) cc-option = $(call try-run,\ - $(CC) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",$(1),$(2)) + $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",$(1),$(2)) # cc-option-yn # Usage: flag := $(call cc-option-yn,-march=winchip-c6) cc-option-yn = $(call try-run,\ - $(CC) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",y,n) + $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",y,n) # cc-option-align # Prefix align with either -falign or -malign -- cgit v1.2.3 From 78222caaeec01a84876f7e955d03e0c22d321287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20=27Flameeyes=27=20Petten=C3=B2?= Date: Fri, 18 Sep 2009 12:49:33 -0700 Subject: gconfig: disable "typeahead find" search in treeviews MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When typeahead find is enabled, using 'y', 'n' and 'm' to change the status of the configuration items will also start up the search system, making you jump around the configuration. Disabling the enable_search property does not mean that search is not possible, it only disables the typeahead; to execute a search in the treeview, you can just call it up explicitly (i.e.: on most systems that will be Ctrl-f). Signed-off-by: Diego Elio 'Flameeyes' Pettenò Cc: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/kconfig/gconf.glade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/kconfig/gconf.glade b/scripts/kconfig/gconf.glade index 803233fdd6dd..b1c86c19292c 100644 --- a/scripts/kconfig/gconf.glade +++ b/scripts/kconfig/gconf.glade @@ -547,7 +547,7 @@ True False False - True + False @@ -582,7 +582,7 @@ True False False - True + False -- cgit v1.2.3 From c3c63b6bec3135e814fa07d30d57a253f41d53de Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 18 Sep 2009 12:49:36 -0700 Subject: kbuild: echo the record_mcount command I had some problems with record_mcount in the Makefile and it was hard to track down. Echo it by default to make it easier to diagnose. Signed-off-by: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/Makefile.build | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 5c4b7a400c18..83eef0a82d96 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -216,6 +216,7 @@ define rule_cc_o_c $(call echo-cmd,checksrc) $(cmd_checksrc) \ $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ $(cmd_modversions) \ + $(call echo-cmd,record_mcount) \ $(cmd_record_mcount) \ scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ $(dot-target).tmp; \ -- cgit v1.2.3 From 66a570623be0d96130470a41cd38bce889b7e885 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 18 Sep 2009 12:49:37 -0700 Subject: kbuild: fail build if recordmcount.pl fails When this script fails the build should fail too. Otherwise there are mysterious build failures later. Signed-off-by: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/Makefile.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 83eef0a82d96..6e41b3b6b154 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -206,7 +206,7 @@ cmd_modversions = \ endif ifdef CONFIG_FTRACE_MCOUNT_RECORD -cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ +cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ "$(if $(CONFIG_64BIT),64,32)" \ "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" \ "$(if $(part-of-module),1,0)" "$(@)"; -- cgit v1.2.3 From 4356f4890792a678936c93c9196e8f7742e04535 Mon Sep 17 00:00:00 2001 From: Trevor Keith Date: Fri, 18 Sep 2009 12:49:23 -0700 Subject: kbuild: add static to prototypes Warnings found via gcc -Wmissing-prototypes. Signed-off-by: Trevor Keith Acked-by: WANG Cong Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/basic/docproc.c | 34 +++++++++++++++++----------------- scripts/basic/fixdep.c | 26 +++++++++++++------------- scripts/basic/hash.c | 4 ++-- scripts/kconfig/conf.c | 2 +- scripts/kconfig/confdata.c | 2 +- scripts/kconfig/expr.c | 4 ++-- scripts/kconfig/kxgettext.c | 4 ++-- scripts/kconfig/menu.c | 4 ++-- scripts/kconfig/symbol.c | 6 +++--- 9 files changed, 43 insertions(+), 43 deletions(-) (limited to 'scripts') diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c index 99ca7a698687..79ab973fb43a 100644 --- a/scripts/basic/docproc.c +++ b/scripts/basic/docproc.c @@ -71,7 +71,7 @@ FILELINE * docsection; static char *srctree, *kernsrctree; -void usage (void) +static void usage (void) { fprintf(stderr, "Usage: docproc {doc|depend} file\n"); fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); @@ -84,7 +84,7 @@ void usage (void) /* * Execute kernel-doc with parameters given in svec */ -void exec_kernel_doc(char **svec) +static void exec_kernel_doc(char **svec) { pid_t pid; int ret; @@ -129,7 +129,7 @@ struct symfile struct symfile symfilelist[MAXFILES]; int symfilecnt = 0; -void add_new_symbol(struct symfile *sym, char * symname) +static void add_new_symbol(struct symfile *sym, char * symname) { sym->symbollist = realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *)); @@ -137,14 +137,14 @@ void add_new_symbol(struct symfile *sym, char * symname) } /* Add a filename to the list */ -struct symfile * add_new_file(char * filename) +static struct symfile * add_new_file(char * filename) { symfilelist[symfilecnt++].filename = strdup(filename); return &symfilelist[symfilecnt - 1]; } /* Check if file already are present in the list */ -struct symfile * filename_exist(char * filename) +static struct symfile * filename_exist(char * filename) { int i; for (i=0; i < symfilecnt; i++) @@ -157,20 +157,20 @@ struct symfile * filename_exist(char * filename) * List all files referenced within the template file. * Files are separated by tabs. */ -void adddep(char * file) { printf("\t%s", file); } -void adddep2(char * file, char * line) { line = line; adddep(file); } -void noaction(char * line) { line = line; } -void noaction2(char * file, char * line) { file = file; line = line; } +static void adddep(char * file) { printf("\t%s", file); } +static void adddep2(char * file, char * line) { line = line; adddep(file); } +static void noaction(char * line) { line = line; } +static void noaction2(char * file, char * line) { file = file; line = line; } /* Echo the line without further action */ -void printline(char * line) { printf("%s", line); } +static void printline(char * line) { printf("%s", line); } /* * Find all symbols in filename that are exported with EXPORT_SYMBOL & * EXPORT_SYMBOL_GPL (& EXPORT_SYMBOL_GPL_FUTURE implicitly). * All symbols located are stored in symfilelist. */ -void find_export_symbols(char * filename) +static void find_export_symbols(char * filename) { FILE * fp; struct symfile *sym; @@ -227,7 +227,7 @@ void find_export_symbols(char * filename) * intfunc uses -nofunction * extfunc uses -function */ -void docfunctions(char * filename, char * type) +static void docfunctions(char * filename, char * type) { int i,j; int symcnt = 0; @@ -258,15 +258,15 @@ void docfunctions(char * filename, char * type) fflush(stdout); free(vec); } -void intfunc(char * filename) { docfunctions(filename, NOFUNCTION); } -void extfunc(char * filename) { docfunctions(filename, FUNCTION); } +static void intfunc(char * filename) { docfunctions(filename, NOFUNCTION); } +static void extfunc(char * filename) { docfunctions(filename, FUNCTION); } /* * Document specific function(s) in a file. * Call kernel-doc with the following parameters: * kernel-doc -docbook -function function1 [-function function2] */ -void singfunc(char * filename, char * line) +static void singfunc(char * filename, char * line) { char *vec[200]; /* Enough for specific functions */ int i, idx = 0; @@ -297,7 +297,7 @@ void singfunc(char * filename, char * line) * Call kernel-doc with the following parameters: * kernel-doc -docbook -function "doc section" filename */ -void docsect(char *filename, char *line) +static void docsect(char *filename, char *line) { char *vec[6]; /* kerneldoc -docbook -function "section" file NULL */ char *s; @@ -324,7 +324,7 @@ void docsect(char *filename, char *line) * 5) Lines containing !P * 6) Default lines - lines not matching the above */ -void parse_file(FILE *infile) +static void parse_file(FILE *infile) { char line[MAXLINESZ]; char * s; diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 72c15205bb2b..d7c1b04791f7 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -125,7 +125,7 @@ char *target; char *depfile; char *cmdline; -void usage(void) +static void usage(void) { fprintf(stderr, "Usage: fixdep \n"); @@ -135,7 +135,7 @@ void usage(void) /* * Print out the commandline prefixed with cmd_ := */ -void print_cmdline(void) +static void print_cmdline(void) { printf("cmd_%s := %s\n\n", target, cmdline); } @@ -148,7 +148,7 @@ int len_config = 0; * Grow the configuration string to a desired length. * Usually the first growth is plenty. */ -void grow_config(int len) +static void grow_config(int len) { while (len_config + len > size_config) { if (size_config == 0) @@ -164,7 +164,7 @@ void grow_config(int len) /* * Lookup a value in the configuration string. */ -int is_defined_config(const char * name, int len) +static int is_defined_config(const char * name, int len) { const char * pconfig; const char * plast = str_config + len_config - len; @@ -180,7 +180,7 @@ int is_defined_config(const char * name, int len) /* * Add a new value to the configuration string. */ -void define_config(const char * name, int len) +static void define_config(const char * name, int len) { grow_config(len + 1); @@ -192,7 +192,7 @@ void define_config(const char * name, int len) /* * Clear the set of configuration strings. */ -void clear_config(void) +static void clear_config(void) { len_config = 0; define_config("", 0); @@ -201,7 +201,7 @@ void clear_config(void) /* * Record the use of a CONFIG_* word. */ -void use_config(char *m, int slen) +static void use_config(char *m, int slen) { char s[PATH_MAX]; char *p; @@ -222,7 +222,7 @@ void use_config(char *m, int slen) printf(" $(wildcard include/config/%s.h) \\\n", s); } -void parse_config_file(char *map, size_t len) +static void parse_config_file(char *map, size_t len) { int *end = (int *) (map + len); /* start at +1, so that p can never be < map */ @@ -256,7 +256,7 @@ void parse_config_file(char *map, size_t len) } /* test is s ends in sub */ -int strrcmp(char *s, char *sub) +static int strrcmp(char *s, char *sub) { int slen = strlen(s); int sublen = strlen(sub); @@ -267,7 +267,7 @@ int strrcmp(char *s, char *sub) return memcmp(s + slen - sublen, sub, sublen); } -void do_config_file(char *filename) +static void do_config_file(char *filename) { struct stat st; int fd; @@ -298,7 +298,7 @@ void do_config_file(char *filename) close(fd); } -void parse_dep_file(void *map, size_t len) +static void parse_dep_file(void *map, size_t len) { char *m = map; char *end = m + len; @@ -338,7 +338,7 @@ void parse_dep_file(void *map, size_t len) printf("$(deps_%s):\n", target); } -void print_deps(void) +static void print_deps(void) { struct stat st; int fd; @@ -370,7 +370,7 @@ void print_deps(void) close(fd); } -void traps(void) +static void traps(void) { static char test[] __attribute__((aligned(sizeof(int)))) = "CONF"; int *p = (int *)test; diff --git a/scripts/basic/hash.c b/scripts/basic/hash.c index 3299ad7fc8c0..2ef5d3f666b8 100644 --- a/scripts/basic/hash.c +++ b/scripts/basic/hash.c @@ -21,7 +21,7 @@ static void usage(void) * http://www.cse.yorku.ca/~oz/hash.html */ -unsigned int djb2_hash(char *str) +static unsigned int djb2_hash(char *str) { unsigned long hash = 5381; int c; @@ -34,7 +34,7 @@ unsigned int djb2_hash(char *str) return (unsigned int)(hash & ((1 << DYNAMIC_DEBUG_HASH_BITS) - 1)); } -unsigned int r5_hash(char *str) +static unsigned int r5_hash(char *str) { unsigned long hash = 0; int c; diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 5de3303e65f5..9960d1c303f8 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -121,7 +121,7 @@ static int conf_askvalue(struct symbol *sym, const char *def) return 1; } -int conf_string(struct menu *menu) +static int conf_string(struct menu *menu) { struct symbol *sym = menu->sym; const char *def; diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index a04da3459f0f..b55e72ff2fc6 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -560,7 +560,7 @@ int conf_write(const char *name) return 0; } -int conf_split_config(void) +static int conf_split_config(void) { const char *name; char path[128]; diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index cd8a2f00a97e..edd3f39a080a 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -348,7 +348,7 @@ struct expr *expr_trans_bool(struct expr *e) /* * e1 || e2 -> ? */ -struct expr *expr_join_or(struct expr *e1, struct expr *e2) +static struct expr *expr_join_or(struct expr *e1, struct expr *e2) { struct expr *tmp; struct symbol *sym1, *sym2; @@ -412,7 +412,7 @@ struct expr *expr_join_or(struct expr *e1, struct expr *e2) return NULL; } -struct expr *expr_join_and(struct expr *e1, struct expr *e2) +static struct expr *expr_join_and(struct expr *e1, struct expr *e2) { struct expr *tmp; struct symbol *sym1, *sym2; diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c index 8d9ce22b0fc5..dcc3fcc0cc9a 100644 --- a/scripts/kconfig/kxgettext.c +++ b/scripts/kconfig/kxgettext.c @@ -166,7 +166,7 @@ static int message__add(const char *msg, char *option, char *file, int lineno) return rc; } -void menu_build_message_list(struct menu *menu) +static void menu_build_message_list(struct menu *menu) { struct menu *child; @@ -211,7 +211,7 @@ static void message__print_gettext_msgid_msgstr(struct message *self) "msgstr \"\"\n", self->msg); } -void menu__xgettext(void) +static void menu__xgettext(void) { struct message *m = message__list; diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index b74f74687005..059a2465c574 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -77,7 +77,7 @@ void menu_end_menu(void) current_menu = current_menu->parent; } -struct expr *menu_check_dep(struct expr *e) +static struct expr *menu_check_dep(struct expr *e) { if (!e) return e; @@ -187,7 +187,7 @@ static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2) (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); } -void sym_check_prop(struct symbol *sym) +static void sym_check_prop(struct symbol *sym) { struct property *prop; struct symbol *sym2; diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 18f3e5c33634..6c8fbbb66ebc 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -36,7 +36,7 @@ tristate modules_val; struct expr *sym_env_list; -void sym_add_default(struct symbol *sym, const char *def) +static void sym_add_default(struct symbol *sym, const char *def) { struct property *prop = prop_alloc(P_DEFAULT, sym); @@ -125,7 +125,7 @@ struct property *sym_get_default_prop(struct symbol *sym) return NULL; } -struct property *sym_get_range_prop(struct symbol *sym) +static struct property *sym_get_range_prop(struct symbol *sym) { struct property *prop; @@ -943,7 +943,7 @@ const char *prop_get_type_name(enum prop_type type) return "unknown"; } -void prop_add_env(const char *env) +static void prop_add_env(const char *env) { struct symbol *sym, *sym2; struct property *prop; -- cgit v1.2.3 From 51b563fc93c8cb5bff1d67a0a71c374e4a4ea049 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 20 Sep 2009 12:28:22 +0200 Subject: arm, cris, mips, sparc, powerpc, um, xtensa: fix build with bash 4.0 Albin Tonnerre reported: Bash 4 filters out variables which contain a dot in them. This happends to be the case of CPPFLAGS_vmlinux.lds. This is rather unfortunate, as it now causes build failures when using SHELL=/bin/bash to compile, or when bash happens to be used by make (eg when it's /bin/sh) Remove the common definition of CPPFLAGS_vmlinux.lds by pushing relevant stuff to either Makefile.build or the arch specific kernel/Makefile where we build the linker script. This is also nice cleanup as we move the information out where it is used. Notes for the different architectures touched: arm - we use an already exported symbol cris - we use a config symbol aleady available [Not build tested] mips - the jiffies complexity has moved to vmlinux.lds.S where we need it. Added a few variables to CPPFLAGS - they are only used by the linker script. [Not build tested] powerpc - removed assignment that is not needed [not build tested] sparc - simplified it using $(BITS) um - introduced a few new exported variables to deal with this xtensa - added options to CPP invocation [not build tested] Cc: Albin Tonnerre Cc: Russell King Cc: Mikael Starvik Cc: Jesper Nilsson Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: "David S. Miller" Cc: Jeff Dike Cc: Chris Zankel Signed-off-by: Sam Ravnborg --- scripts/Makefile.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 6e41b3b6b154..d5425660a3df 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -270,7 +270,8 @@ targets += $(extra-y) $(MAKECMDGOALS) $(always) # Linker scripts preprocessor (.lds.S -> .lds) # --------------------------------------------------------------------------- quiet_cmd_cpp_lds_S = LDS $@ - cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $< + cmd_cpp_lds_S = $(CPP) $(cpp_flags) -P -C -U$(ARCH) \ + -D__ASSEMBLY__ -o $@ $< $(obj)/%.lds: $(src)/%.lds.S FORCE $(call if_changed_dep,cpp_lds_S) -- cgit v1.2.3 From 42f29a25207dc7b3051d299cc028d4b395d1328d Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sun, 20 Sep 2009 18:14:12 -0400 Subject: kbuild: Don't define ALIGN and ENTRY when preprocessing linker scripts. Adding a reference to to x86's causes the x86 linker script to have syntax errors, because the ALIGN and ENTRY keywords get redefined to the assembly implementations of those. One could fix this by adjusting the include structure, but I think any solution based on that approach would be fragile. Currently, it is impossible when writing a header to do something different for assembly files and linker scripts, even though there are clearly cases where one wants them to define macros differently for the two (ENTRY being an excellent example). So I think the right solution here is to introduce a new preprocessor definition, called LINKER_SCRIPT that is set along with __ASSEMBLY__ for linker scripts, and to use that to not define ALIGN and ENTRY in linker scripts. I suspect we'll find other uses for this mechanism in the future. Signed-off-by: Tim Abbott Signed-off-by: Sam Ravnborg --- scripts/Makefile.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.build b/scripts/Makefile.build index d5425660a3df..341b58902ffc 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -271,7 +271,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(always) # --------------------------------------------------------------------------- quiet_cmd_cpp_lds_S = LDS $@ cmd_cpp_lds_S = $(CPP) $(cpp_flags) -P -C -U$(ARCH) \ - -D__ASSEMBLY__ -o $@ $< + -D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $< $(obj)/%.lds: $(src)/%.lds.S FORCE $(call if_changed_dep,cpp_lds_S) -- cgit v1.2.3