Makefile (14c3ec67236b2d90c553d2575950369aa6fa43c5) Makefile (945302df3de156fc367d3b537cec76d4aea0b0d1)
1# SPDX-License-Identifier: GPL-2.0
2# This file was copied from arm64/kernel/pi/Makefile.
3
4KBUILD_CFLAGS := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) -fpie \
5 -Os -DDISABLE_BRANCH_PROFILING $(DISABLE_STACKLEAK_PLUGIN) \
6 $(call cc-option,-mbranch-protection=none) \
7 -I$(srctree)/scripts/dtc/libfdt -fno-stack-protector \
8 -include $(srctree)/include/linux/hidden.h \
9 -D__DISABLE_EXPORTS -ffreestanding \
10 -fno-asynchronous-unwind-tables -fno-unwind-tables \
11 $(call cc-option,-fno-addrsig)
12
13# Disable LTO
14KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS))
15
16KBUILD_CFLAGS += -mcmodel=medany
17
18CFLAGS_cmdline_early.o += -D__NO_FORTIFY
19CFLAGS_lib-fdt_ro.o += -D__NO_FORTIFY
1# SPDX-License-Identifier: GPL-2.0
2# This file was copied from arm64/kernel/pi/Makefile.
3
4KBUILD_CFLAGS := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) -fpie \
5 -Os -DDISABLE_BRANCH_PROFILING $(DISABLE_STACKLEAK_PLUGIN) \
6 $(call cc-option,-mbranch-protection=none) \
7 -I$(srctree)/scripts/dtc/libfdt -fno-stack-protector \
8 -include $(srctree)/include/linux/hidden.h \
9 -D__DISABLE_EXPORTS -ffreestanding \
10 -fno-asynchronous-unwind-tables -fno-unwind-tables \
11 $(call cc-option,-fno-addrsig)
12
13# Disable LTO
14KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS))
15
16KBUILD_CFLAGS += -mcmodel=medany
17
18CFLAGS_cmdline_early.o += -D__NO_FORTIFY
19CFLAGS_lib-fdt_ro.o += -D__NO_FORTIFY
20CFLAGS_fdt_early.o += -D__NO_FORTIFY
20
21$(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \
22 --remove-section=.note.gnu.property \
23 --prefix-alloc-sections=.init.pi
24$(obj)/%.pi.o: $(obj)/%.o FORCE
25 $(call if_changed,objcopy)
26
27$(obj)/lib-%.o: $(srctree)/lib/%.c FORCE
28 $(call if_changed_rule,cc_o_c)
29
30$(obj)/string.o: $(srctree)/lib/string.c FORCE
31 $(call if_changed_rule,cc_o_c)
32
33$(obj)/ctype.o: $(srctree)/lib/ctype.c FORCE
34 $(call if_changed_rule,cc_o_c)
35
21
22$(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \
23 --remove-section=.note.gnu.property \
24 --prefix-alloc-sections=.init.pi
25$(obj)/%.pi.o: $(obj)/%.o FORCE
26 $(call if_changed,objcopy)
27
28$(obj)/lib-%.o: $(srctree)/lib/%.c FORCE
29 $(call if_changed_rule,cc_o_c)
30
31$(obj)/string.o: $(srctree)/lib/string.c FORCE
32 $(call if_changed_rule,cc_o_c)
33
34$(obj)/ctype.o: $(srctree)/lib/ctype.c FORCE
35 $(call if_changed_rule,cc_o_c)
36
36obj-y := cmdline_early.pi.o fdt_early.pi.o string.pi.o ctype.pi.o lib-fdt.pi.o lib-fdt_ro.pi.o
37obj-y := cmdline_early.pi.o fdt_early.pi.o string.pi.o ctype.pi.o lib-fdt.pi.o lib-fdt_ro.pi.o archrandom_early.pi.o
37extra-y := $(patsubst %.pi.o,%.o,$(obj-y))
38extra-y := $(patsubst %.pi.o,%.o,$(obj-y))