Commit 41e0e24b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kbuild updates from Michal Marek:

 - prototypes for x86 asm-exported symbols (Adam Borowski) and a warning
   about missing CRCs (Nick Piggin)

 - asm-exports fix for LTO (Nicolas Pitre)

 - thin archives improvements (Nick Piggin)

 - linker script fix for CONFIG_LD_DEAD_CODE_DATA_ELIMINATION (Nick
   Piggin)

 - genksyms support for __builtin_va_list keyword

 - misc minor fixes

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  x86/kbuild: enable modversions for symbols exported from asm
  kbuild: fix scripts/adjust_autoksyms.sh* for the no modules case
  scripts/kallsyms: remove last remnants of --page-offset option
  make use of make variable CURDIR instead of calling pwd
  kbuild: cmd_export_list: tighten the sed script
  kbuild: minor improvement for thin archives build
  kbuild: modpost warn if export version crc is missing
  kbuild: keep data tables through dead code elimination
  kbuild: improve linker compatibility with lib-ksyms.o build
  genksyms: Regenerate parser
  kbuild/genksyms: handle va_list type
  kbuild: thin archives for multi-y targets
  kbuild: kallsyms allow 3-pass generation if symbols size has changed
parents 0aaf2146 334bb773
#include <asm/ftrace.h>
#include <asm/uaccess.h>
#include <asm/string.h>
#include <asm/page.h>
#include <asm/checksum.h>
#include <asm-generic/asm-prototypes.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/special_insns.h>
#include <asm/preempt.h>
#ifndef CONFIG_X86_CMPXCHG64
extern void cmpxchg8b_emu(void);
#endif
#include <linux/bitops.h>
extern void *__memset(void *, int, __kernel_size_t);
extern void *__memcpy(void *, const void *, __kernel_size_t);
extern void *__memmove(void *, const void *, __kernel_size_t);
extern void *memset(void *, int, __kernel_size_t);
extern void *memcpy(void *, const void *, __kernel_size_t);
extern void *memmove(void *, const void *, __kernel_size_t);
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
#ifdef CONFIG_KPROBES #ifdef CONFIG_KPROBES
#define KPROBE_BLACKLIST() . = ALIGN(8); \ #define KPROBE_BLACKLIST() . = ALIGN(8); \
VMLINUX_SYMBOL(__start_kprobe_blacklist) = .; \ VMLINUX_SYMBOL(__start_kprobe_blacklist) = .; \
*(_kprobe_blacklist) \ KEEP(*(_kprobe_blacklist)) \
VMLINUX_SYMBOL(__stop_kprobe_blacklist) = .; VMLINUX_SYMBOL(__stop_kprobe_blacklist) = .;
#else #else
#define KPROBE_BLACKLIST() #define KPROBE_BLACKLIST()
...@@ -123,10 +123,10 @@ ...@@ -123,10 +123,10 @@
#ifdef CONFIG_EVENT_TRACING #ifdef CONFIG_EVENT_TRACING
#define FTRACE_EVENTS() . = ALIGN(8); \ #define FTRACE_EVENTS() . = ALIGN(8); \
VMLINUX_SYMBOL(__start_ftrace_events) = .; \ VMLINUX_SYMBOL(__start_ftrace_events) = .; \
*(_ftrace_events) \ KEEP(*(_ftrace_events)) \
VMLINUX_SYMBOL(__stop_ftrace_events) = .; \ VMLINUX_SYMBOL(__stop_ftrace_events) = .; \
VMLINUX_SYMBOL(__start_ftrace_enum_maps) = .; \ VMLINUX_SYMBOL(__start_ftrace_enum_maps) = .; \
*(_ftrace_enum_map) \ KEEP(*(_ftrace_enum_map)) \
VMLINUX_SYMBOL(__stop_ftrace_enum_maps) = .; VMLINUX_SYMBOL(__stop_ftrace_enum_maps) = .;
#else #else
#define FTRACE_EVENTS() #define FTRACE_EVENTS()
...@@ -134,10 +134,10 @@ ...@@ -134,10 +134,10 @@
#ifdef CONFIG_TRACING #ifdef CONFIG_TRACING
#define TRACE_PRINTKS() VMLINUX_SYMBOL(__start___trace_bprintk_fmt) = .; \ #define TRACE_PRINTKS() VMLINUX_SYMBOL(__start___trace_bprintk_fmt) = .; \
*(__trace_printk_fmt) /* Trace_printk fmt' pointer */ \ KEEP(*(__trace_printk_fmt)) /* Trace_printk fmt' pointer */ \
VMLINUX_SYMBOL(__stop___trace_bprintk_fmt) = .; VMLINUX_SYMBOL(__stop___trace_bprintk_fmt) = .;
#define TRACEPOINT_STR() VMLINUX_SYMBOL(__start___tracepoint_str) = .; \ #define TRACEPOINT_STR() VMLINUX_SYMBOL(__start___tracepoint_str) = .; \
*(__tracepoint_str) /* Trace_printk fmt' pointer */ \ KEEP(*(__tracepoint_str)) /* Trace_printk fmt' pointer */ \
VMLINUX_SYMBOL(__stop___tracepoint_str) = .; VMLINUX_SYMBOL(__stop___tracepoint_str) = .;
#else #else
#define TRACE_PRINTKS() #define TRACE_PRINTKS()
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
#ifdef CONFIG_FTRACE_SYSCALLS #ifdef CONFIG_FTRACE_SYSCALLS
#define TRACE_SYSCALLS() . = ALIGN(8); \ #define TRACE_SYSCALLS() . = ALIGN(8); \
VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \ VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \
*(__syscalls_metadata) \ KEEP(*(__syscalls_metadata)) \
VMLINUX_SYMBOL(__stop_syscalls_metadata) = .; VMLINUX_SYMBOL(__stop_syscalls_metadata) = .;
#else #else
#define TRACE_SYSCALLS() #define TRACE_SYSCALLS()
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
#ifdef CONFIG_SERIAL_EARLYCON #ifdef CONFIG_SERIAL_EARLYCON
#define EARLYCON_TABLE() STRUCT_ALIGN(); \ #define EARLYCON_TABLE() STRUCT_ALIGN(); \
VMLINUX_SYMBOL(__earlycon_table) = .; \ VMLINUX_SYMBOL(__earlycon_table) = .; \
*(__earlycon_table) \ KEEP(*(__earlycon_table)) \
VMLINUX_SYMBOL(__earlycon_table_end) = .; VMLINUX_SYMBOL(__earlycon_table_end) = .;
#else #else
#define EARLYCON_TABLE() #define EARLYCON_TABLE()
...@@ -169,8 +169,8 @@ ...@@ -169,8 +169,8 @@
#define _OF_TABLE_1(name) \ #define _OF_TABLE_1(name) \
. = ALIGN(8); \ . = ALIGN(8); \
VMLINUX_SYMBOL(__##name##_of_table) = .; \ VMLINUX_SYMBOL(__##name##_of_table) = .; \
*(__##name##_of_table) \ KEEP(*(__##name##_of_table)) \
*(__##name##_of_table_end) KEEP(*(__##name##_of_table_end))
#define CLKSRC_OF_TABLES() OF_TABLE(CONFIG_CLKSRC_OF, clksrc) #define CLKSRC_OF_TABLES() OF_TABLE(CONFIG_CLKSRC_OF, clksrc)
#define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip) #define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip)
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
#define ACPI_PROBE_TABLE(name) \ #define ACPI_PROBE_TABLE(name) \
. = ALIGN(8); \ . = ALIGN(8); \
VMLINUX_SYMBOL(__##name##_acpi_probe_table) = .; \ VMLINUX_SYMBOL(__##name##_acpi_probe_table) = .; \
*(__##name##_acpi_probe_table) \ KEEP(*(__##name##_acpi_probe_table)) \
VMLINUX_SYMBOL(__##name##_acpi_probe_table_end) = .; VMLINUX_SYMBOL(__##name##_acpi_probe_table_end) = .;
#else #else
#define ACPI_PROBE_TABLE(name) #define ACPI_PROBE_TABLE(name)
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
#define KERNEL_DTB() \ #define KERNEL_DTB() \
STRUCT_ALIGN(); \ STRUCT_ALIGN(); \
VMLINUX_SYMBOL(__dtb_start) = .; \ VMLINUX_SYMBOL(__dtb_start) = .; \
*(.dtb.init.rodata) \ KEEP(*(.dtb.init.rodata)) \
VMLINUX_SYMBOL(__dtb_end) = .; VMLINUX_SYMBOL(__dtb_end) = .;
/* /*
...@@ -214,11 +214,11 @@ ...@@ -214,11 +214,11 @@
/* implement dynamic printk debug */ \ /* implement dynamic printk debug */ \
. = ALIGN(8); \ . = ALIGN(8); \
VMLINUX_SYMBOL(__start___jump_table) = .; \ VMLINUX_SYMBOL(__start___jump_table) = .; \
*(__jump_table) \ KEEP(*(__jump_table)) \
VMLINUX_SYMBOL(__stop___jump_table) = .; \ VMLINUX_SYMBOL(__stop___jump_table) = .; \
. = ALIGN(8); \ . = ALIGN(8); \
VMLINUX_SYMBOL(__start___verbose) = .; \ VMLINUX_SYMBOL(__start___verbose) = .; \
*(__verbose) \ KEEP(*(__verbose)) \
VMLINUX_SYMBOL(__stop___verbose) = .; \ VMLINUX_SYMBOL(__stop___verbose) = .; \
LIKELY_PROFILE() \ LIKELY_PROFILE() \
BRANCH_PROFILE() \ BRANCH_PROFILE() \
...@@ -274,10 +274,10 @@ ...@@ -274,10 +274,10 @@
VMLINUX_SYMBOL(__start_rodata) = .; \ VMLINUX_SYMBOL(__start_rodata) = .; \
*(.rodata) *(.rodata.*) \ *(.rodata) *(.rodata.*) \
RO_AFTER_INIT_DATA /* Read only after init */ \ RO_AFTER_INIT_DATA /* Read only after init */ \
*(__vermagic) /* Kernel version magic */ \ KEEP(*(__vermagic)) /* Kernel version magic */ \
. = ALIGN(8); \ . = ALIGN(8); \
VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \ VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \
*(__tracepoints_ptrs) /* Tracepoints: pointer array */\ KEEP(*(__tracepoints_ptrs)) /* Tracepoints: pointer array */ \
VMLINUX_SYMBOL(__stop___tracepoints_ptrs) = .; \ VMLINUX_SYMBOL(__stop___tracepoints_ptrs) = .; \
*(__tracepoints_strings)/* Tracepoints: strings */ \ *(__tracepoints_strings)/* Tracepoints: strings */ \
} \ } \
...@@ -291,35 +291,35 @@ ...@@ -291,35 +291,35 @@
/* PCI quirks */ \ /* PCI quirks */ \
.pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \ .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \ VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \
*(.pci_fixup_early) \ KEEP(*(.pci_fixup_early)) \
VMLINUX_SYMBOL(__end_pci_fixups_early) = .; \ VMLINUX_SYMBOL(__end_pci_fixups_early) = .; \
VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \ VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \
*(.pci_fixup_header) \ KEEP(*(.pci_fixup_header)) \
VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \ VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \
VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \ VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \
*(.pci_fixup_final) \ KEEP(*(.pci_fixup_final)) \
VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \ VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \
VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \ VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \
*(.pci_fixup_enable) \ KEEP(*(.pci_fixup_enable)) \
VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \ VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \
VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \ VMLINUX_SYMBOL(__start_pci_fixups_resume) = .; \
*(.pci_fixup_resume) \ KEEP(*(.pci_fixup_resume)) \
VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \ VMLINUX_SYMBOL(__end_pci_fixups_resume) = .; \
VMLINUX_SYMBOL(__start_pci_fixups_resume_early) = .; \ VMLINUX_SYMBOL(__start_pci_fixups_resume_early) = .; \
*(.pci_fixup_resume_early) \ KEEP(*(.pci_fixup_resume_early)) \
VMLINUX_SYMBOL(__end_pci_fixups_resume_early) = .; \ VMLINUX_SYMBOL(__end_pci_fixups_resume_early) = .; \
VMLINUX_SYMBOL(__start_pci_fixups_suspend) = .; \ VMLINUX_SYMBOL(__start_pci_fixups_suspend) = .; \
*(.pci_fixup_suspend) \ KEEP(*(.pci_fixup_suspend)) \
VMLINUX_SYMBOL(__end_pci_fixups_suspend) = .; \ VMLINUX_SYMBOL(__end_pci_fixups_suspend) = .; \
VMLINUX_SYMBOL(__start_pci_fixups_suspend_late) = .; \ VMLINUX_SYMBOL(__start_pci_fixups_suspend_late) = .; \
*(.pci_fixup_suspend_late) \ KEEP(*(.pci_fixup_suspend_late)) \
VMLINUX_SYMBOL(__end_pci_fixups_suspend_late) = .; \ VMLINUX_SYMBOL(__end_pci_fixups_suspend_late) = .; \
} \ } \
\ \
/* Built-in firmware blobs */ \ /* Built-in firmware blobs */ \
.builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \ .builtin_fw : AT(ADDR(.builtin_fw) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_builtin_fw) = .; \ VMLINUX_SYMBOL(__start_builtin_fw) = .; \
*(.builtin_fw) \ KEEP(*(.builtin_fw)) \
VMLINUX_SYMBOL(__end_builtin_fw) = .; \ VMLINUX_SYMBOL(__end_builtin_fw) = .; \
} \ } \
\ \
...@@ -397,7 +397,7 @@ ...@@ -397,7 +397,7 @@
\ \
/* Kernel symbol table: strings */ \ /* Kernel symbol table: strings */ \
__ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \
KEEP(*(__ksymtab_strings)) \ *(__ksymtab_strings) \
} \ } \
\ \
/* __*init sections */ \ /* __*init sections */ \
...@@ -410,14 +410,14 @@ ...@@ -410,14 +410,14 @@
/* Built-in module parameters. */ \ /* Built-in module parameters. */ \
__param : AT(ADDR(__param) - LOAD_OFFSET) { \ __param : AT(ADDR(__param) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start___param) = .; \ VMLINUX_SYMBOL(__start___param) = .; \
*(__param) \ KEEP(*(__param)) \
VMLINUX_SYMBOL(__stop___param) = .; \ VMLINUX_SYMBOL(__stop___param) = .; \
} \ } \
\ \
/* Built-in module versions. */ \ /* Built-in module versions. */ \
__modver : AT(ADDR(__modver) - LOAD_OFFSET) { \ __modver : AT(ADDR(__modver) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start___modver) = .; \ VMLINUX_SYMBOL(__start___modver) = .; \
*(__modver) \ KEEP(*(__modver)) \
VMLINUX_SYMBOL(__stop___modver) = .; \ VMLINUX_SYMBOL(__stop___modver) = .; \
. = ALIGN((align)); \ . = ALIGN((align)); \
VMLINUX_SYMBOL(__end_rodata) = .; \ VMLINUX_SYMBOL(__end_rodata) = .; \
...@@ -520,7 +520,7 @@ ...@@ -520,7 +520,7 @@
. = ALIGN(align); \ . = ALIGN(align); \
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { \ __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start___ex_table) = .; \ VMLINUX_SYMBOL(__start___ex_table) = .; \
*(__ex_table) \ KEEP(*(__ex_table)) \
VMLINUX_SYMBOL(__stop___ex_table) = .; \ VMLINUX_SYMBOL(__stop___ex_table) = .; \
} }
...@@ -536,9 +536,9 @@ ...@@ -536,9 +536,9 @@
#ifdef CONFIG_CONSTRUCTORS #ifdef CONFIG_CONSTRUCTORS
#define KERNEL_CTORS() . = ALIGN(8); \ #define KERNEL_CTORS() . = ALIGN(8); \
VMLINUX_SYMBOL(__ctors_start) = .; \ VMLINUX_SYMBOL(__ctors_start) = .; \
*(.ctors) \ KEEP(*(.ctors)) \
*(SORT(.init_array.*)) \ KEEP(*(SORT(.init_array.*))) \
*(.init_array) \ KEEP(*(.init_array)) \
VMLINUX_SYMBOL(__ctors_end) = .; VMLINUX_SYMBOL(__ctors_end) = .;
#else #else
#define KERNEL_CTORS() #define KERNEL_CTORS()
...@@ -663,7 +663,7 @@ ...@@ -663,7 +663,7 @@
. = ALIGN(8); \ . = ALIGN(8); \
__bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \ __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start___bug_table) = .; \ VMLINUX_SYMBOL(__start___bug_table) = .; \
*(__bug_table) \ KEEP(*(__bug_table)) \
VMLINUX_SYMBOL(__stop___bug_table) = .; \ VMLINUX_SYMBOL(__stop___bug_table) = .; \
} }
#else #else
...@@ -675,7 +675,7 @@ ...@@ -675,7 +675,7 @@
. = ALIGN(4); \ . = ALIGN(4); \
.tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \ .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__tracedata_start) = .; \ VMLINUX_SYMBOL(__tracedata_start) = .; \
*(.tracedata) \ KEEP(*(.tracedata)) \
VMLINUX_SYMBOL(__tracedata_end) = .; \ VMLINUX_SYMBOL(__tracedata_end) = .; \
} }
#else #else
...@@ -692,7 +692,7 @@ ...@@ -692,7 +692,7 @@
#define INIT_SETUP(initsetup_align) \ #define INIT_SETUP(initsetup_align) \
. = ALIGN(initsetup_align); \ . = ALIGN(initsetup_align); \
VMLINUX_SYMBOL(__setup_start) = .; \ VMLINUX_SYMBOL(__setup_start) = .; \
*(.init.setup) \ KEEP(*(.init.setup)) \
VMLINUX_SYMBOL(__setup_end) = .; VMLINUX_SYMBOL(__setup_end) = .;
#define INIT_CALLS_LEVEL(level) \ #define INIT_CALLS_LEVEL(level) \
......
...@@ -141,10 +141,10 @@ CLANG ?= clang ...@@ -141,10 +141,10 @@ CLANG ?= clang
# Trick to allow make to be run from this directory # Trick to allow make to be run from this directory
all: all:
$(MAKE) -C ../../ $$PWD/ $(MAKE) -C ../../ $(CURDIR)/
clean: clean:
$(MAKE) -C ../../ M=$$PWD clean $(MAKE) -C ../../ M=$(CURDIR) clean
@rm -f *~ @rm -f *~
# Verify LLVM compiler tools are available and bpf target is supported by llc # Verify LLVM compiler tools are available and bpf target is supported by llc
......
...@@ -13,4 +13,4 @@ HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include ...@@ -13,4 +13,4 @@ HOSTCFLAGS_ucon.o += -I$(objtree)/usr/include
all: modules all: modules
modules clean: modules clean:
$(MAKE) -C ../.. SUBDIRS=$(PWD) $@ $(MAKE) -C ../.. SUBDIRS=$(CURDIR) $@
...@@ -488,9 +488,9 @@ endif ...@@ -488,9 +488,9 @@ endif
quiet_cmd_export_list = EXPORTS $@ quiet_cmd_export_list = EXPORTS $@
cmd_export_list = $(OBJDUMP) -h $< | \ cmd_export_list = $(OBJDUMP) -h $< | \
sed -ne '/___ksymtab/{s/.*+/$(ref_prefix)/;s/ .*/)/;p}' >$(ksyms-lds);\ sed -ne '/___ksymtab/s/.*+\([^ ]*\).*/$(ref_prefix)\1)/p' >$(ksyms-lds);\
rm -f $(dummy-object);\ rm -f $(dummy-object);\
$(AR) rcs$(KBUILD_ARFLAGS) $(dummy-object);\ echo | $(CC) $(a_flags) -c -o $(dummy-object) -x assembler -;\
$(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\ $(LD) $(ld_flags) -r -o $@ -T $(ksyms-lds) $(dummy-object);\
rm $(dummy-object) $(ksyms-lds) rm $(dummy-object) $(ksyms-lds)
...@@ -517,11 +517,18 @@ $($(subst $(obj)/,,$(@:.o=-objs))) \ ...@@ -517,11 +517,18 @@ $($(subst $(obj)/,,$(@:.o=-objs))) \
$($(subst $(obj)/,,$(@:.o=-y))) \ $($(subst $(obj)/,,$(@:.o=-y))) \
$($(subst $(obj)/,,$(@:.o=-m)))), $^) $($(subst $(obj)/,,$(@:.o=-m)))), $^)
quiet_cmd_link_multi-y = LD $@ cmd_link_multi-link = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
ifdef CONFIG_THIN_ARCHIVES
quiet_cmd_link_multi-y = AR $@
cmd_link_multi-y = rm -f $@; $(AR) rcST$(KBUILD_ARFLAGS) $@ $(link_multi_deps)
else
quiet_cmd_link_multi-y = LD $@
cmd_link_multi-y = $(cmd_link_multi-link)
endif
quiet_cmd_link_multi-m = LD [M] $@ quiet_cmd_link_multi-m = LD [M] $@
cmd_link_multi-m = $(cmd_link_multi-y) cmd_link_multi-m = $(cmd_link_multi-link)
$(multi-used-y): FORCE $(multi-used-y): FORCE
$(call if_changed,link_multi-y) $(call if_changed,link_multi-y)
......
...@@ -59,6 +59,7 @@ cat > "$new_ksyms_file" << EOT ...@@ -59,6 +59,7 @@ cat > "$new_ksyms_file" << EOT
*/ */
EOT EOT
[ "$(ls -A "$MODVERDIR")" ] &&
sed -ns -e '3{s/ /\n/g;/^$/!p;}' "$MODVERDIR"/*.mod | sort -u | sed -ns -e '3{s/ /\n/g;/^$/!p;}' "$MODVERDIR"/*.mod | sort -u |
while read sym; do while read sym; do
if [ -n "$CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX" ]; then if [ -n "$CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX" ]; then
......
...@@ -27,6 +27,7 @@ __typeof, TYPEOF_KEYW ...@@ -27,6 +27,7 @@ __typeof, TYPEOF_KEYW
__typeof__, TYPEOF_KEYW __typeof__, TYPEOF_KEYW
__volatile, VOLATILE_KEYW __volatile, VOLATILE_KEYW
__volatile__, VOLATILE_KEYW __volatile__, VOLATILE_KEYW
__builtin_va_list, VA_LIST_KEYW
# According to rth, c99 defines _Bool, __restrict, __restrict__, restrict. KAO # According to rth, c99 defines _Bool, __restrict, __restrict__, restrict. KAO
_Bool, BOOL_KEYW _Bool, BOOL_KEYW
_restrict, RESTRICT_KEYW _restrict, RESTRICT_KEYW
......
...@@ -57,7 +57,7 @@ is_reserved_hash (register const char *str, register unsigned int len) ...@@ -57,7 +57,7 @@ is_reserved_hash (register const char *str, register unsigned int len)
101, 101, 101, 101, 101, 101, 101, 101, 101, 0, 101, 101, 101, 101, 101, 101, 101, 101, 101, 0,
101, 101, 101, 101, 101, 101, 15, 101, 101, 101, 101, 101, 101, 101, 101, 101, 15, 101, 101, 101,
0, 101, 101, 101, 101, 101, 101, 101, 101, 101, 0, 101, 101, 101, 101, 101, 101, 101, 101, 101,
101, 101, 101, 101, 101, 0, 101, 0, 101, 5, 101, 101, 101, 101, 101, 0, 101, 0, 0, 5,
25, 20, 55, 30, 101, 15, 101, 101, 10, 0, 25, 20, 55, 30, 101, 15, 101, 101, 10, 0,
10, 40, 10, 101, 10, 5, 0, 10, 15, 101, 10, 40, 10, 101, 10, 5, 0, 10, 15, 101,
101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
...@@ -89,7 +89,7 @@ is_reserved_word (register const char *str, register unsigned int len) ...@@ -89,7 +89,7 @@ is_reserved_word (register const char *str, register unsigned int len)
{ {
enum enum
{ {
TOTAL_KEYWORDS = 46, TOTAL_KEYWORDS = 47,
MIN_WORD_LENGTH = 3, MIN_WORD_LENGTH = 3,
MAX_WORD_LENGTH = 24, MAX_WORD_LENGTH = 24,
MIN_HASH_VALUE = 3, MIN_HASH_VALUE = 3,
...@@ -99,7 +99,7 @@ is_reserved_word (register const char *str, register unsigned int len) ...@@ -99,7 +99,7 @@ is_reserved_word (register const char *str, register unsigned int len)
static const struct resword wordlist[] = static const struct resword wordlist[] =
{ {
{""}, {""}, {""}, {""}, {""}, {""},
#line 35 "scripts/genksyms/keywords.gperf" #line 36 "scripts/genksyms/keywords.gperf"
{"asm", ASM_KEYW}, {"asm", ASM_KEYW},
{""}, {""},
#line 15 "scripts/genksyms/keywords.gperf" #line 15 "scripts/genksyms/keywords.gperf"
...@@ -119,20 +119,21 @@ is_reserved_word (register const char *str, register unsigned int len) ...@@ -119,20 +119,21 @@ is_reserved_word (register const char *str, register unsigned int len)
{"__const__", CONST_KEYW}, {"__const__", CONST_KEYW},
#line 25 "scripts/genksyms/keywords.gperf" #line 25 "scripts/genksyms/keywords.gperf"
{"__signed__", SIGNED_KEYW}, {"__signed__", SIGNED_KEYW},
#line 53 "scripts/genksyms/keywords.gperf" #line 54 "scripts/genksyms/keywords.gperf"
{"static", STATIC_KEYW}, {"static", STATIC_KEYW},
{""}, #line 30 "scripts/genksyms/keywords.gperf"
#line 48 "scripts/genksyms/keywords.gperf" {"__builtin_va_list", VA_LIST_KEYW},
#line 49 "scripts/genksyms/keywords.gperf"
{"int", INT_KEYW}, {"int", INT_KEYW},
#line 41 "scripts/genksyms/keywords.gperf"
{"char", CHAR_KEYW},
#line 42 "scripts/genksyms/keywords.gperf" #line 42 "scripts/genksyms/keywords.gperf"
{"char", CHAR_KEYW},
#line 43 "scripts/genksyms/keywords.gperf"
{"const", CONST_KEYW}, {"const", CONST_KEYW},
#line 54 "scripts/genksyms/keywords.gperf" #line 55 "scripts/genksyms/keywords.gperf"
{"struct", STRUCT_KEYW}, {"struct", STRUCT_KEYW},
#line 33 "scripts/genksyms/keywords.gperf"
{"__restrict__", RESTRICT_KEYW},
#line 34 "scripts/genksyms/keywords.gperf" #line 34 "scripts/genksyms/keywords.gperf"
{"__restrict__", RESTRICT_KEYW},
#line 35 "scripts/genksyms/keywords.gperf"
{"restrict", RESTRICT_KEYW}, {"restrict", RESTRICT_KEYW},
#line 12 "scripts/genksyms/keywords.gperf" #line 12 "scripts/genksyms/keywords.gperf"
{"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW}, {"EXPORT_SYMBOL_GPL_FUTURE", EXPORT_SYMBOL_KEYW},
...@@ -143,7 +144,7 @@ is_reserved_word (register const char *str, register unsigned int len) ...@@ -143,7 +144,7 @@ is_reserved_word (register const char *str, register unsigned int len)
{"__volatile__", VOLATILE_KEYW}, {"__volatile__", VOLATILE_KEYW},
#line 10 "scripts/genksyms/keywords.gperf" #line 10 "scripts/genksyms/keywords.gperf"
{"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW}, {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW},
#line 32 "scripts/genksyms/keywords.gperf" #line 33 "scripts/genksyms/keywords.gperf"
{"_restrict", RESTRICT_KEYW}, {"_restrict", RESTRICT_KEYW},
{""}, {""},
#line 17 "scripts/genksyms/keywords.gperf" #line 17 "scripts/genksyms/keywords.gperf"
...@@ -152,64 +153,64 @@ is_reserved_word (register const char *str, register unsigned int len) ...@@ -152,64 +153,64 @@ is_reserved_word (register const char *str, register unsigned int len)
{"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, {"EXPORT_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
#line 21 "scripts/genksyms/keywords.gperf" #line 21 "scripts/genksyms/keywords.gperf"
{"__extension__", EXTENSION_KEYW}, {"__extension__", EXTENSION_KEYW},
#line 44 "scripts/genksyms/keywords.gperf" #line 45 "scripts/genksyms/keywords.gperf"
{"enum", ENUM_KEYW}, {"enum", ENUM_KEYW},
#line 13 "scripts/genksyms/keywords.gperf" #line 13 "scripts/genksyms/keywords.gperf"
{"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW}, {"EXPORT_UNUSED_SYMBOL", EXPORT_SYMBOL_KEYW},
#line 45 "scripts/genksyms/keywords.gperf" #line 46 "scripts/genksyms/keywords.gperf"
{"extern", EXTERN_KEYW}, {"extern", EXTERN_KEYW},
{""}, {""},
#line 24 "scripts/genksyms/keywords.gperf" #line 24 "scripts/genksyms/keywords.gperf"
{"__signed", SIGNED_KEYW}, {"__signed", SIGNED_KEYW},
#line 14 "scripts/genksyms/keywords.gperf" #line 14 "scripts/genksyms/keywords.gperf"
{"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW}, {"EXPORT_UNUSED_SYMBOL_GPL", EXPORT_SYMBOL_KEYW},
#line 57 "scripts/genksyms/keywords.gperf" #line 58 "scripts/genksyms/keywords.gperf"
{"union", UNION_KEYW}, {"union", UNION_KEYW},
{""}, {""}, {""}, {""},
#line 22 "scripts/genksyms/keywords.gperf" #line 22 "scripts/genksyms/keywords.gperf"
{"__inline", INLINE_KEYW}, {"__inline", INLINE_KEYW},
#line 40 "scripts/genksyms/keywords.gperf" #line 41 "scripts/genksyms/keywords.gperf"
{"auto", AUTO_KEYW}, {"auto", AUTO_KEYW},
#line 28 "scripts/genksyms/keywords.gperf" #line 28 "scripts/genksyms/keywords.gperf"
{"__volatile", VOLATILE_KEYW}, {"__volatile", VOLATILE_KEYW},
{""}, {""}, {""}, {""},
#line 58 "scripts/genksyms/keywords.gperf" #line 59 "scripts/genksyms/keywords.gperf"
{"unsigned", UNSIGNED_KEYW}, {"unsigned", UNSIGNED_KEYW},
{""}, {""},
#line 51 "scripts/genksyms/keywords.gperf" #line 52 "scripts/genksyms/keywords.gperf"
{"short", SHORT_KEYW}, {"short", SHORT_KEYW},
#line 47 "scripts/genksyms/keywords.gperf" #line 48 "scripts/genksyms/keywords.gperf"
{"inline", INLINE_KEYW}, {"inline", INLINE_KEYW},
{""}, {""},
#line 60 "scripts/genksyms/keywords.gperf" #line 61 "scripts/genksyms/keywords.gperf"
{"volatile", VOLATILE_KEYW}, {"volatile", VOLATILE_KEYW},
#line 49 "scripts/genksyms/keywords.gperf" #line 50 "scripts/genksyms/keywords.gperf"
{"long", LONG_KEYW}, {"long", LONG_KEYW},
#line 31 "scripts/genksyms/keywords.gperf" #line 32 "scripts/genksyms/keywords.gperf"
{"_Bool", BOOL_KEYW}, {"_Bool", BOOL_KEYW},
{""}, {""}, {""}, {""},
#line 50 "scripts/genksyms/keywords.gperf" #line 51 "scripts/genksyms/keywords.gperf"
{"register", REGISTER_KEYW}, {"register", REGISTER_KEYW},
#line 59 "scripts/genksyms/keywords.gperf" #line 60 "scripts/genksyms/keywords.gperf"
{"void", VOID_KEYW}, {"void", VOID_KEYW},
{""}, {""},
#line 43 "scripts/genksyms/keywords.gperf" #line 44 "scripts/genksyms/keywords.gperf"
{"double", DOUBLE_KEYW}, {"double", DOUBLE_KEYW},
{""}, {""},
#line 26 "scripts/genksyms/keywords.gperf" #line 26 "scripts/genksyms/keywords.gperf"
{"__typeof", TYPEOF_KEYW}, {"__typeof", TYPEOF_KEYW},
{""}, {""}, {""}, {""},
#line 52 "scripts/genksyms/keywords.gperf" #line 53 "scripts/genksyms/keywords.gperf"
{"signed", SIGNED_KEYW}, {"signed", SIGNED_KEYW},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
#line 56 "scripts/genksyms/keywords.gperf" #line 57 "scripts/genksyms/keywords.gperf"
{"typeof", TYPEOF_KEYW}, {"typeof", TYPEOF_KEYW},
#line 55 "scripts/genksyms/keywords.gperf" #line 56 "scripts/genksyms/keywords.gperf"
{"typedef", TYPEDEF_KEYW}, {"typedef", TYPEDEF_KEYW},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
#line 46 "scripts/genksyms/keywords.gperf" #line 47 "scripts/genksyms/keywords.gperf"
{"float", FLOAT_KEYW} {"float", FLOAT_KEYW}
}; };
......
This diff is collapsed.
...@@ -72,22 +72,23 @@ extern int yydebug; ...@@ -72,22 +72,23 @@ extern int yydebug;
VOID_KEYW = 281, VOID_KEYW = 281,
VOLATILE_KEYW = 282, VOLATILE_KEYW = 282,
TYPEOF_KEYW = 283, TYPEOF_KEYW = 283,
EXPORT_SYMBOL_KEYW = 284, VA_LIST_KEYW = 284,
ASM_PHRASE = 285, EXPORT_SYMBOL_KEYW = 285,
ATTRIBUTE_PHRASE = 286, ASM_PHRASE = 286,
TYPEOF_PHRASE = 287, ATTRIBUTE_PHRASE = 287,
BRACE_PHRASE = 288, TYPEOF_PHRASE = 288,
BRACKET_PHRASE = 289, BRACE_PHRASE = 289,
EXPRESSION_PHRASE = 290, BRACKET_PHRASE = 290,
CHAR = 291, EXPRESSION_PHRASE = 291,
DOTS = 292, CHAR = 292,
IDENT = 293, DOTS = 293,
INT = 294, IDENT = 294,
REAL = 295, INT = 295,
STRING = 296, REAL = 296,
TYPE = 297, STRING = 297,
OTHER = 298, TYPE = 298,
FILENAME = 299 OTHER = 299,
FILENAME = 300
}; };
#endif #endif
......
...@@ -98,6 +98,7 @@ static void record_compound(struct string_list **keyw, ...@@ -98,6 +98,7 @@ static void record_compound(struct string_list **keyw,
%token VOID_KEYW %token VOID_KEYW
%token VOLATILE_KEYW %token VOLATILE_KEYW
%token TYPEOF_KEYW %token TYPEOF_KEYW
%token VA_LIST_KEYW
%token EXPORT_SYMBOL_KEYW %token EXPORT_SYMBOL_KEYW
...@@ -261,6 +262,7 @@ simple_type_specifier: ...@@ -261,6 +262,7 @@ simple_type_specifier:
| DOUBLE_KEYW | DOUBLE_KEYW
| VOID_KEYW | VOID_KEYW
| BOOL_KEYW | BOOL_KEYW
| VA_LIST_KEYW
| TYPE { (*$1)->tag = SYM_TYPEDEF; $$ = $1; } | TYPE { (*$1)->tag = SYM_TYPEDEF; $$ = $1; }
; ;
......
...@@ -76,7 +76,6 @@ static void usage(void) ...@@ -76,7 +76,6 @@ static void usage(void)
{ {
fprintf(stderr, "Usage: kallsyms [--all-symbols] " fprintf(stderr, "Usage: kallsyms [--all-symbols] "
"[--symbol-prefix=<prefix char>] " "[--symbol-prefix=<prefix char>] "
"[--page-offset=<CONFIG_PAGE_OFFSET>] "
"[--base-relative] < in.map > out.S\n"); "[--base-relative] < in.map > out.S\n");
exit(1); exit(1);
} }
......
...@@ -209,15 +209,6 @@ case "${KCONFIG_CONFIG}" in ...@@ -209,15 +209,6 @@ case "${KCONFIG_CONFIG}" in
. "./${KCONFIG_CONFIG}" . "./${KCONFIG_CONFIG}"
esac esac
archive_builtin
#link vmlinux.o
info LD vmlinux.o
modpost_link vmlinux.o
# modpost vmlinux.o to check for section mismatches
${MAKE} -f "${srctree}/scripts/Makefile.modpost" vmlinux.o
# Update version # Update version
info GEN .version info GEN .version
if [ ! -r .version ]; then if [ ! -r .version ]; then
...@@ -231,6 +222,15 @@ fi; ...@@ -231,6 +222,15 @@ fi;
# final build of init/ # final build of init/
${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init GCC_PLUGINS_CFLAGS="${GCC_PLUGINS_CFLAGS}" ${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init GCC_PLUGINS_CFLAGS="${GCC_PLUGINS_CFLAGS}"
archive_builtin
#link vmlinux.o
info LD vmlinux.o
modpost_link vmlinux.o
# modpost vmlinux.o to check for section mismatches
${MAKE} -f "${srctree}/scripts/Makefile.modpost" vmlinux.o
kallsymso="" kallsymso=""
kallsyms_vmlinux="" kallsyms_vmlinux=""
if [ -n "${CONFIG_KALLSYMS}" ]; then if [ -n "${CONFIG_KALLSYMS}" ]; then
...@@ -246,10 +246,14 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then ...@@ -246,10 +246,14 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
# the right size, but due to the added section, some # the right size, but due to the added section, some
# addresses have shifted. # addresses have shifted.
# From here, we generate a correct .tmp_kallsyms2.o # From here, we generate a correct .tmp_kallsyms2.o
# 2a) We may use an extra pass as this has been necessary to # 3) That link may have expanded the kernel image enough that
# woraround some alignment related bugs. # more linker branch stubs / trampolines had to be added, which
# KALLSYMS_EXTRA_PASS=1 is used to trigger this. # introduces new names, which further expands kallsyms. Do another
# 3) The correct ${kallsymso} is linked into the final vmlinux. # pass if that is the case. In theory it's possible this results
# in even more stubs, but unlikely.
# KALLSYMS_EXTRA_PASS=1 may also used to debug or work around
# other bugs.
# 4) The correct ${kallsymso} is linked into the final vmlinux.
# #
# a) Verify that the System.map from vmlinux matches the map from # a) Verify that the System.map from vmlinux matches the map from
# ${kallsymso}. # ${kallsymso}.
...@@ -265,8 +269,11 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then ...@@ -265,8 +269,11 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
vmlinux_link .tmp_kallsyms1.o .tmp_vmlinux2 vmlinux_link .tmp_kallsyms1.o .tmp_vmlinux2
kallsyms .tmp_vmlinux2 .tmp_kallsyms2.o kallsyms .tmp_vmlinux2 .tmp_kallsyms2.o
# step 2a # step 3
if [ -n "${KALLSYMS_EXTRA_PASS}" ]; then size1=$(stat -c "%s" .tmp_kallsyms1.o)
size2=$(stat -c "%s" .tmp_kallsyms2.o)
if [ $size1 -ne $size2 ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then
kallsymso=.tmp_kallsyms3.o kallsymso=.tmp_kallsyms3.o
kallsyms_vmlinux=.tmp_vmlinux3 kallsyms_vmlinux=.tmp_vmlinux3
......
...@@ -609,6 +609,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, ...@@ -609,6 +609,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
{ {
unsigned int crc; unsigned int crc;
enum export export; enum export export;
bool is_crc = false;
if ((!is_vmlinux(mod->name) || mod->is_dot_o) && if ((!is_vmlinux(mod->name) || mod->is_dot_o) &&
strncmp(symname, "__ksymtab", 9) == 0) strncmp(symname, "__ksymtab", 9) == 0)
...@@ -618,6 +619,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info, ...@@ -618,6 +619,7 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
/* CRC'd symbol */ /* CRC'd symbol */
if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) { if (strncmp(symname, CRC_PFX, strlen(CRC_PFX)) == 0) {
is_crc = true;
crc = (unsigned int) sym->st_value; crc = (unsigned int) sym->st_value;
sym_update_crc(symname + strlen(CRC_PFX), mod, crc, sym_update_crc(symname + strlen(CRC_PFX), mod, crc,
export); export);
...@@ -663,6 +665,10 @@ static void handle_modversions(struct module *mod, struct elf_info *info, ...@@ -663,6 +665,10 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
else else
symname++; symname++;
#endif #endif
if (is_crc) {
const char *e = is_vmlinux(mod->name) ?"":".ko";
warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n", symname + strlen(CRC_PFX), mod->name, e);
}
mod->unres = alloc_symbol(symname, mod->unres = alloc_symbol(symname,
ELF_ST_BIND(sym->st_info) == STB_WEAK, ELF_ST_BIND(sym->st_info) == STB_WEAK,
mod->unres); mod->unres);
......
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
endif endif
......
...@@ -3,7 +3,7 @@ include ../scripts/Makefile.include ...@@ -3,7 +3,7 @@ include ../scripts/Makefile.include
bindir ?= /usr/bin bindir ?= /usr/bin
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
endif endif
......
...@@ -2,7 +2,7 @@ include ../../scripts/Makefile.include ...@@ -2,7 +2,7 @@ include ../../scripts/Makefile.include
include ../../scripts/utilities.mak # QUIET_CLEAN include ../../scripts/utilities.mak # QUIET_CLEAN
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
......
...@@ -7,7 +7,7 @@ BPF_EXTRAVERSION = 1 ...@@ -7,7 +7,7 @@ BPF_EXTRAVERSION = 1
MAKEFLAGS += --no-print-directory MAKEFLAGS += --no-print-directory
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
......
...@@ -50,7 +50,7 @@ ifndef VERBOSE ...@@ -50,7 +50,7 @@ ifndef VERBOSE
endif endif
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
......
...@@ -2,7 +2,7 @@ include ../../scripts/Makefile.include ...@@ -2,7 +2,7 @@ include ../../scripts/Makefile.include
include ../../scripts/utilities.mak # QUIET_CLEAN include ../../scripts/utilities.mak # QUIET_CLEAN
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
......
...@@ -86,7 +86,7 @@ ifndef VERBOSE ...@@ -86,7 +86,7 @@ ifndef VERBOSE
endif endif
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
......
...@@ -11,12 +11,12 @@ LD = ld ...@@ -11,12 +11,12 @@ LD = ld
AR = ar AR = ar
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
endif endif
SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/ SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/
LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(PWD)/) LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(CURDIR)/)
LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a
OBJTOOL := $(OUTPUT)objtool OBJTOOL := $(OUTPUT)objtool
......
...@@ -100,7 +100,7 @@ LC_NUMERIC=C ...@@ -100,7 +100,7 @@ LC_NUMERIC=C
export LC_COLLATE LC_NUMERIC export LC_COLLATE LC_NUMERIC
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
endif endif
......
...@@ -42,7 +42,7 @@ LC_NUMERIC=C ...@@ -42,7 +42,7 @@ LC_NUMERIC=C
export LC_COLLATE LC_NUMERIC export LC_COLLATE LC_NUMERIC
ifeq ($(srctree),) ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(shell pwd))) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree))) srctree := $(patsubst %/,%,$(dir $(srctree)))
#$(info Determined 'srctree' to be $(srctree)) #$(info Determined 'srctree' to be $(srctree))
endif endif
......
...@@ -108,9 +108,6 @@ MKDIR = mkdir ...@@ -108,9 +108,6 @@ MKDIR = mkdir
# Now we set up the build system # Now we set up the build system
# #
# set up PWD so that older versions of make will work with our build.
PWD = $(shell pwd)
GMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo $(OUTPUT)po/$$HLANG.gmo; done;} GMO_FILES = ${shell for HLANG in ${LANGUAGES}; do echo $(OUTPUT)po/$$HLANG.gmo; done;}
export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS
......
obj-m := obj-m :=
KDIR := /lib/modules/$(shell uname -r)/build KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
KMISC := /lib/modules/$(shell uname -r)/cpufrequtils/ KMISC := /lib/modules/$(shell uname -r)/cpufrequtils/
ifeq ("$(CONFIG_X86_TSC)", "y") ifeq ("$(CONFIG_X86_TSC)", "y")
...@@ -9,7 +8,7 @@ ifeq ("$(CONFIG_X86_TSC)", "y") ...@@ -9,7 +8,7 @@ ifeq ("$(CONFIG_X86_TSC)", "y")
endif endif
default: default:
$(MAKE) -C $(KDIR) M=$(PWD) $(MAKE) -C $(KDIR) M=$(CURDIR)
clean: clean:
- rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c - rm -rf *.o *.ko .tmp-versions .*.cmd .*.mod.* *.mod.c
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment