forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/arch/arm/boot/compressed/Makefile
....@@ -7,11 +7,11 @@
77
88 OBJS =
99
10
-AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
1110 HEAD = head.o
1211 OBJS += misc.o decompress.o
1312 ifeq ($(CONFIG_DEBUG_UNCOMPRESS),y)
1413 OBJS += debug.o
14
+AFLAGS_head.o += -DDEBUG
1515 endif
1616 FONTC = $(srctree)/lib/fonts/font_acorn_8x8.c
1717
....@@ -68,7 +68,12 @@
6868 ZBSSADDR := ALIGN(8)
6969 endif
7070
71
+MALLOC_SIZE := 65536
72
+
73
+AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) -DMALLOC_SIZE=$(MALLOC_SIZE)
7174 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)"
7277
7378 compress-$(CONFIG_KERNEL_GZIP) = gzip
7479 compress-$(CONFIG_KERNEL_LZO) = lzo
....@@ -76,18 +81,7 @@
7681 compress-$(CONFIG_KERNEL_XZ) = xzkern
7782 compress-$(CONFIG_KERNEL_LZ4) = lz4
7883
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
9185
9286 ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
9387 CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
....@@ -95,30 +89,29 @@
9589 OBJS += $(libfdt_objs) atags_to_fdt.o
9690 endif
9791
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
+
98104 targets := vmlinux vmlinux.lds piggy_data piggy.o \
99105 lib1funcs.o ashldi3.o bswapsdi2.o \
100106 head.o $(OBJS)
101107
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
104109
105110 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
106111
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
122115 asflags-y := -DZIMAGE
123116
124117 # Supply kernel BSS size to the decompressor via a linker symbol.
....@@ -137,6 +130,10 @@
137130 LDFLAGS_vmlinux += --no-undefined
138131 # Delete all temporary local symbols
139132 LDFLAGS_vmlinux += -X
133
+# Report orphan sections
134
+ifdef CONFIG_LD_ORPHAN_WARN
135
+LDFLAGS_vmlinux += --orphan-handling=warn
136
+endif
140137 # Next argument is a linker script
141138 LDFLAGS_vmlinux += -T
142139
....@@ -169,7 +166,7 @@
169166 bad_syms=$$($(NM) $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \
170167 [ -z "$$bad_syms" ] || \
171168 ( echo "following symbols must have non local/private scope:" >&2; \
172
- echo "$$bad_syms" >&2; rm -f $@; false )
169
+ echo "$$bad_syms" >&2; false )
173170
174171 check_for_multiple_zreladdr = \
175172 if [ $(words $(ZRELADDR)) -gt 1 -a "$(CONFIG_AUTO_ZRELADDR)" = "" ]; then \