Skip to content

Commit efffbee

Browse files
author
Linus Torvalds
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: (33 commits) xtensa: use DATA_DATA in xtensa powerpc: add missing DATA_DATA to powerpc cris: use DATA_DATA in cris kallsyms: remove usage of memmem and _GNU_SOURCE from scripts/kallsyms.c kbuild: use -fno-optimize-sibling-calls unconditionally kconfig: reset generated values only if Kconfig and .config agree. kbuild: fix the warning when running make tags kconfig: strip 'CONFIG_' automatically in kernel configuration search kbuild: use POSIX BRE in headers install target Whitelist references from __dbe_table to .init modpost white list pattern adjustment kbuild: do section mismatch check on full vmlinux kbuild: whitelist references from variables named _timer to .init.text kbuild: remove hardcoded _logo names from modpost kbuild: remove hardcoded apic_es7000 from modpost kbuild: warn about references from .init.text to .exit.text kbuild: consolidate section checks kbuild: refactor code in modpost to improve maintainability kbuild: ignore section mismatch warnings originating from .note section kbuild: .paravirtprobe section is obsolete, so modpost doesn't need to handle it ...
2 parents 40b42f1 + b824325 commit efffbee

27 files changed

Lines changed: 474 additions & 200 deletions

File tree

‎Documentation/kbuild/makefiles.txt‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,20 @@ more details, with real examples.
501501
The third parameter may be a text as in this example, but it may also
502502
be an expanded variable or a macro.
503503

504+
cc-fullversion
505+
cc-fullversion is useful when the exact version of gcc is needed.
506+
One typical use-case is when a specific GCC version is broken.
507+
cc-fullversion points out a more specific version than cc-version does.
508+
509+
Example:
510+
#arch/powerpc/Makefile
511+
$(Q)if test "$(call cc-fullversion)" = "040200" ; then \
512+
echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
513+
false ; \
514+
fi
515+
516+
In this example for a specific GCC version the build will error out explaining
517+
to the user why it stops.
504518

505519
=== 4 Host Program support
506520

‎Kbuild‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ offsets-file := include/asm-$(ARCH)/asm-offsets.h
1313
always := $(offsets-file)
1414
targets := $(offsets-file)
1515
targets += arch/$(ARCH)/kernel/asm-offsets.s
16+
clean-files := $(addprefix $(objtree)/,$(targets))
1617

1718
# Default sed regexp - multiline due to syntax constraints
1819
define sed-y

‎Makefile‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ endif
492492
include $(srctree)/arch/$(ARCH)/Makefile
493493

494494
ifdef CONFIG_FRAME_POINTER
495-
CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
495+
CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
496496
else
497497
CFLAGS += -fomit-frame-pointer
498498
endif
@@ -618,7 +618,7 @@ quiet_cmd_vmlinux__ ?= LD $@
618618
cmd_vmlinux__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \
619619
-T $(vmlinux-lds) $(vmlinux-init) \
620620
--start-group $(vmlinux-main) --end-group \
621-
$(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE ,$^)
621+
$(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o FORCE ,$^)
622622

623623
# Generate new vmlinux version
624624
quiet_cmd_vmlinux_version = GEN .version
@@ -742,15 +742,31 @@ debug_kallsyms: .tmp_map$(last_kallsyms)
742742

743743
endif # ifdef CONFIG_KALLSYMS
744744

745+
# Do modpost on a prelinked vmlinux. The finally linked vmlinux has
746+
# relevant sections renamed as per the linker script.
747+
quiet_cmd_vmlinux-modpost = LD $@
748+
cmd_vmlinux-modpost = $(LD) $(LDFLAGS) -r -o $@ \
749+
$(vmlinux-init) --start-group $(vmlinux-main) --end-group \
750+
$(filter-out $(vmlinux-init) $(vmlinux-main) $(vmlinux-lds) FORCE ,$^)
751+
define rule_vmlinux-modpost
752+
:
753+
+$(call cmd,vmlinux-modpost)
754+
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
755+
$(Q)echo 'cmd_$@ := $(cmd_vmlinux-modpost)' > $(dot-target).cmd
756+
endef
757+
745758
# vmlinux image - including updated kernel symbols
746-
vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
759+
vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) vmlinux.o FORCE
747760
ifdef CONFIG_HEADERS_CHECK
748761
$(Q)$(MAKE) -f $(srctree)/Makefile headers_check
749762
endif
763+
$(call vmlinux-modpost)
750764
$(call if_changed_rule,vmlinux__)
751-
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
752765
$(Q)rm -f .old_version
753766

767+
vmlinux.o: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
768+
$(call if_changed_rule,vmlinux-modpost)
769+
754770
# The actual objects are generated when descending,
755771
# make sure no implicit rule kicks in
756772
$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
@@ -1323,7 +1339,7 @@ define xtags
13231339
-I __initdata,__exitdata,__acquires,__releases \
13241340
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
13251341
--extra=+f --c-kinds=+px \
1326-
--regex-asm='/ENTRY\(([^)]*)\).*/\1/'; \
1342+
--regex-asm='/^ENTRY\(([^)]*)\).*/\1/'; \
13271343
$(all-kconfigs) | xargs $1 -a \
13281344
--langdef=kconfig \
13291345
--language-force=kconfig \

‎arch/cris/arch-v10/vmlinux.lds.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ SECTIONS
4444
___data_start = . ;
4545
__Sdata = . ;
4646
.data : { /* Data */
47-
*(.data)
47+
DATA_DATA
4848
}
4949
__edata = . ; /* End of data section */
5050
_edata = . ;

‎arch/cris/arch-v32/vmlinux.lds.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ SECTIONS
4949
___data_start = . ;
5050
__Sdata = . ;
5151
.data : { /* Data */
52-
*(.data)
52+
DATA_DATA
5353
}
5454
__edata = . ; /* End of data section. */
5555
_edata = . ;

‎arch/i386/mach-generic/es7000.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
6666
}
6767
#endif
6868

69-
struct genapic apic_es7000 = APIC_INIT("es7000", probe_es7000);
69+
struct genapic __initdata_refok apic_es7000 = APIC_INIT("es7000", probe_es7000);

‎arch/powerpc/Makefile‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ checkbin:
201201
false; \
202202
fi ; \
203203
fi
204+
@if test "$(call cc-fullversion)" = "040200" \
205+
&& test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
206+
echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \
207+
echo 'kernel with modules enabled.' ; \
208+
echo -n '*** Please use a different GCC version or ' ; \
209+
echo 'disable kernel modules' ; \
210+
false ; \
211+
fi
204212
@if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
205213
echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
206214
echo 'correctly with old versions of binutils.' ; \

‎arch/powerpc/kernel/vmlinux.lds.S‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ SECTIONS
177177
}
178178
#else
179179
.data : {
180-
*(.data .data.rel* .toc1)
180+
DATA_DATA
181+
*(.data.rel*)
182+
*(.toc1)
181183
*(.branch_lt)
182184
}
183185

‎arch/xtensa/kernel/vmlinux.lds.S‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ SECTIONS
118118
_fdata = .;
119119
.data :
120120
{
121-
*(.data) CONSTRUCTORS
121+
DATA_DATA
122+
CONSTRUCTORS
122123
. = ALIGN(XCHAL_ICACHE_LINESIZE);
123124
*(.data.cacheline_aligned)
124125
}

‎drivers/video/logo/logo.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ extern const struct linux_logo logo_superh_vga16;
3434
extern const struct linux_logo logo_superh_clut224;
3535
extern const struct linux_logo logo_m32r_clut224;
3636

37-
38-
const struct linux_logo *fb_find_logo(int depth)
37+
/* logo's are marked __initdata. Use __init_refok to tell
38+
* modpost that it is intended that this function uses data
39+
* marked __initdata.
40+
*/
41+
const struct linux_logo * __init_refok fb_find_logo(int depth)
3942
{
4043
const struct linux_logo *logo = NULL;
4144

0 commit comments

Comments
 (0)