History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: kbuild: explain why DEBUG_SECTION_MISMATCH is UNDEFINED kbuild: fix building vmlinux.o kbuild: allow -fstack-protector to take effect kconfig: fix select in combination with default

Linus Torvalds committed 18 years ago

Commit 230b5482 parents 1309d4e fa2144b3 files · +31 −17Browse files

Unified · Split

3 files
  1. Makefile +7 −4
  2. lib/Kconfig.debug +3 −0
  3. scripts/kconfig/symbol.c +21 −13
Makefile+7−4
@@ -507,6 +507,10 @@ else · 506 unmodified lines
507KBUILD_CFLAGS += -O2507KBUILD_CFLAGS += -O2
508endif508endif
509 509
510# Force gcc to behave correct even for buggy distributions
511# Arch Makefiles may override this setting
512KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
513
510include $(srctree)/arch/$(SRCARCH)/Makefile514include $(srctree)/arch/$(SRCARCH)/Makefile
511 515
512ifdef CONFIG_FRAME_POINTER516ifdef CONFIG_FRAME_POINTER
@@ -525,9 +529,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH · 12 unmodified lines
525KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)529KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
526endif530endif
527 531
528# Force gcc to behave correct even for buggy distributions
529KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
530
531# arch Makefile may override CC so keep this after arch Makefile is included532# arch Makefile may override CC so keep this after arch Makefile is included
532NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)533NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
533CHECKFLAGS += $(NOSTDINC_FLAGS)534CHECKFLAGS += $(NOSTDINC_FLAGS)
@@ -810,7 +811,9 @@ endif · 276 unmodified lines
810 $(Q)rm -f .old_version811 $(Q)rm -f .old_version
811 812
812# build vmlinux.o first to catch section mismatch errors early813# build vmlinux.o first to catch section mismatch errors early
813$(kallsyms.o): vmlinux.o814ifdef CONFIG_KALLSYMS
815.tmp_vmlinux1: vmlinux.o
816endif
814vmlinux.o: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE817vmlinux.o: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE
815 $(call if_changed_rule,vmlinux-modpost)818 $(call if_changed_rule,vmlinux-modpost)
816 819
lib/Kconfig.debug+3−0
@@ -82,6 +82,9 @@ config HEADERS_CHECK · 81 unmodified lines
82config DEBUG_SECTION_MISMATCH82config DEBUG_SECTION_MISMATCH
83 bool "Enable full Section mismatch analysis"83 bool "Enable full Section mismatch analysis"
84 depends on UNDEFINED84 depends on UNDEFINED
85 # This option is on purpose disabled for now.
86 # It will be enabled when we are down to a resonable number
87 # of section mismatch warnings (< 10 for an allyesconfig build)
85 help88 help
86 The section mismatch analysis checks if there are illegal89 The section mismatch analysis checks if there are illegal
87 references from one section to another section.90 references from one section to another section.
scripts/kconfig/symbol.c+21−13
@@ -298,22 +298,30 @@ void sym_calc_value(struct symbol *sym) · 297 unmodified lines
298 if (sym_is_choice_value(sym) && sym->visible == yes) {298 if (sym_is_choice_value(sym) && sym->visible == yes) {
299 prop = sym_get_choice_prop(sym);299 prop = sym_get_choice_prop(sym);
300 newval.tri = (prop_get_symbol(prop)->curr.val == sym) ? yes : no;300 newval.tri = (prop_get_symbol(prop)->curr.val == sym) ? yes : no;
301 } else if (EXPR_OR(sym->visible, sym->rev_dep.tri) != no) {301 } else {
302 sym->flags |= SYMBOL_WRITE;302 if (sym->visible != no) {
303 if (sym_has_value(sym))303 /* if the symbol is visible use the user value
304 newval.tri = sym->def[S_DEF_USER].tri;304 * if available, otherwise try the default value
305 else if (!sym_is_choice(sym)) {305 */
306 prop = sym_get_default_prop(sym);306 sym->flags |= SYMBOL_WRITE;
307 if (prop)307 if (sym_has_value(sym)) {
308 newval.tri = expr_calc_value(prop->expr);308 newval.tri = EXPR_AND(sym->def[S_DEF_USER].tri,
309 sym->visible);
310 goto calc_newval;
311 }
309 }312 }
310 newval.tri = EXPR_OR(EXPR_AND(newval.tri, sym->visible), sym->rev_dep.tri);313 if (sym->rev_dep.tri != no)
311 } else if (!sym_is_choice(sym)) {
312 prop = sym_get_default_prop(sym);
313 if (prop) {
314 sym->flags |= SYMBOL_WRITE;314 sym->flags |= SYMBOL_WRITE;
315 newval.tri = expr_calc_value(prop->expr);315 if (!sym_is_choice(sym)) {
316 prop = sym_get_default_prop(sym);
317 if (prop) {
318 sym->flags |= SYMBOL_WRITE;
319 newval.tri = EXPR_AND(expr_calc_value(prop->expr),
320 prop->visible.tri);
321 }
316 }322 }
323 calc_newval:
324 newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
317 }325 }
318 if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)326 if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
319 newval.tri = yes;327 newval.tri = yes;

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