| .. | .. |
|---|
| 7 | 7 | |
|---|
| 8 | 8 | OBJS = |
|---|
| 9 | 9 | |
|---|
| 10 | | -AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) |
|---|
| 11 | 10 | HEAD = head.o |
|---|
| 12 | 11 | OBJS += misc.o decompress.o |
|---|
| 13 | 12 | ifeq ($(CONFIG_DEBUG_UNCOMPRESS),y) |
|---|
| 14 | 13 | OBJS += debug.o |
|---|
| 14 | +AFLAGS_head.o += -DDEBUG |
|---|
| 15 | 15 | endif |
|---|
| 16 | 16 | FONTC = $(srctree)/lib/fonts/font_acorn_8x8.c |
|---|
| 17 | 17 | |
|---|
| .. | .. |
|---|
| 68 | 68 | ZBSSADDR := ALIGN(8) |
|---|
| 69 | 69 | endif |
|---|
| 70 | 70 | |
|---|
| 71 | +MALLOC_SIZE := 65536 |
|---|
| 72 | + |
|---|
| 73 | +AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) -DMALLOC_SIZE=$(MALLOC_SIZE) |
|---|
| 71 | 74 | CPPFLAGS_vmlinux.lds := -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)" |
|---|
| 75 | +CPPFLAGS_vmlinux.lds += -DTEXT_OFFSET="$(TEXT_OFFSET)" |
|---|
| 76 | +CPPFLAGS_vmlinux.lds += -DMALLOC_SIZE="$(MALLOC_SIZE)" |
|---|
| 72 | 77 | |
|---|
| 73 | 78 | compress-$(CONFIG_KERNEL_GZIP) = gzip |
|---|
| 74 | 79 | compress-$(CONFIG_KERNEL_LZO) = lzo |
|---|
| .. | .. |
|---|
| 76 | 81 | compress-$(CONFIG_KERNEL_XZ) = xzkern |
|---|
| 77 | 82 | compress-$(CONFIG_KERNEL_LZ4) = lz4 |
|---|
| 78 | 83 | |
|---|
| 79 | | -# Borrowed libfdt files for the ATAG compatibility mode |
|---|
| 80 | | - |
|---|
| 81 | | -libfdt := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c |
|---|
| 82 | | -libfdt_hdrs := fdt.h libfdt.h libfdt_internal.h |
|---|
| 83 | | - |
|---|
| 84 | | -libfdt_objs := $(addsuffix .o, $(basename $(libfdt))) |
|---|
| 85 | | - |
|---|
| 86 | | -$(addprefix $(obj)/,$(libfdt) $(libfdt_hdrs)): $(obj)/%: $(srctree)/scripts/dtc/libfdt/% |
|---|
| 87 | | - $(call cmd,shipped) |
|---|
| 88 | | - |
|---|
| 89 | | -$(addprefix $(obj)/,$(libfdt_objs) atags_to_fdt.o): \ |
|---|
| 90 | | - $(addprefix $(obj)/,$(libfdt_hdrs)) |
|---|
| 84 | +libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o |
|---|
| 91 | 85 | |
|---|
| 92 | 86 | ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y) |
|---|
| 93 | 87 | CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN} |
|---|
| .. | .. |
|---|
| 95 | 89 | OBJS += $(libfdt_objs) atags_to_fdt.o |
|---|
| 96 | 90 | endif |
|---|
| 97 | 91 | |
|---|
| 92 | +# -fstack-protector-strong triggers protection checks in this code, |
|---|
| 93 | +# but it is being used too early to link to meaningful stack_chk logic. |
|---|
| 94 | +$(foreach o, $(libfdt_objs) atags_to_fdt.o, \ |
|---|
| 95 | + $(eval CFLAGS_$(o) := -I $(srctree)/scripts/dtc/libfdt -fno-stack-protector)) |
|---|
| 96 | + |
|---|
| 97 | +# These were previously generated C files. When you are building the kernel |
|---|
| 98 | +# with O=, make sure to remove the stale files in the output tree. Otherwise, |
|---|
| 99 | +# the build system wrongly compiles the stale ones. |
|---|
| 100 | +ifdef building_out_of_srctree |
|---|
| 101 | +$(shell rm -f $(addprefix $(obj)/, fdt_rw.c fdt_ro.c fdt_wip.c fdt.c)) |
|---|
| 102 | +endif |
|---|
| 103 | + |
|---|
| 98 | 104 | targets := vmlinux vmlinux.lds piggy_data piggy.o \ |
|---|
| 99 | 105 | lib1funcs.o ashldi3.o bswapsdi2.o \ |
|---|
| 100 | 106 | head.o $(OBJS) |
|---|
| 101 | 107 | |
|---|
| 102 | | -clean-files += piggy_data lib1funcs.S ashldi3.S bswapsdi2.S \ |
|---|
| 103 | | - $(libfdt) $(libfdt_hdrs) hyp-stub.S |
|---|
| 108 | +clean-files += piggy_data lib1funcs.S ashldi3.S bswapsdi2.S hyp-stub.S |
|---|
| 104 | 109 | |
|---|
| 105 | 110 | KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING |
|---|
| 106 | 111 | |
|---|
| 107 | | -ifeq ($(CONFIG_FUNCTION_TRACER),y) |
|---|
| 108 | | -ORIG_CFLAGS := $(KBUILD_CFLAGS) |
|---|
| 109 | | -KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
|---|
| 110 | | -endif |
|---|
| 111 | | - |
|---|
| 112 | | -# -fstack-protector-strong triggers protection checks in this code, |
|---|
| 113 | | -# but it is being used too early to link to meaningful stack_chk logic. |
|---|
| 114 | | -nossp_flags := $(call cc-option, -fno-stack-protector) |
|---|
| 115 | | -CFLAGS_atags_to_fdt.o := $(nossp_flags) |
|---|
| 116 | | -CFLAGS_fdt.o := $(nossp_flags) |
|---|
| 117 | | -CFLAGS_fdt_ro.o := $(nossp_flags) |
|---|
| 118 | | -CFLAGS_fdt_rw.o := $(nossp_flags) |
|---|
| 119 | | -CFLAGS_fdt_wip.o := $(nossp_flags) |
|---|
| 120 | | - |
|---|
| 121 | | -ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin -I$(obj) |
|---|
| 112 | +ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin \ |
|---|
| 113 | + -I$(obj) $(DISABLE_ARM_SSP_PER_TASK_PLUGIN) |
|---|
| 114 | +ccflags-remove-$(CONFIG_FUNCTION_TRACER) += -pg |
|---|
| 122 | 115 | asflags-y := -DZIMAGE |
|---|
| 123 | 116 | |
|---|
| 124 | 117 | # Supply kernel BSS size to the decompressor via a linker symbol. |
|---|
| .. | .. |
|---|
| 137 | 130 | LDFLAGS_vmlinux += --no-undefined |
|---|
| 138 | 131 | # Delete all temporary local symbols |
|---|
| 139 | 132 | LDFLAGS_vmlinux += -X |
|---|
| 133 | +# Report orphan sections |
|---|
| 134 | +ifdef CONFIG_LD_ORPHAN_WARN |
|---|
| 135 | +LDFLAGS_vmlinux += --orphan-handling=warn |
|---|
| 136 | +endif |
|---|
| 140 | 137 | # Next argument is a linker script |
|---|
| 141 | 138 | LDFLAGS_vmlinux += -T |
|---|
| 142 | 139 | |
|---|
| .. | .. |
|---|
| 169 | 166 | bad_syms=$$($(NM) $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \ |
|---|
| 170 | 167 | [ -z "$$bad_syms" ] || \ |
|---|
| 171 | 168 | ( echo "following symbols must have non local/private scope:" >&2; \ |
|---|
| 172 | | - echo "$$bad_syms" >&2; rm -f $@; false ) |
|---|
| 169 | + echo "$$bad_syms" >&2; false ) |
|---|
| 173 | 170 | |
|---|
| 174 | 171 | check_for_multiple_zreladdr = \ |
|---|
| 175 | 172 | if [ $(words $(ZRELADDR)) -gt 1 -a "$(CONFIG_AUTO_ZRELADDR)" = "" ]; then \ |
|---|