1# SPDX-License-Identifier: GPL-2.0 2# Copyright 2022 Google LLC 3 4KBUILD_CFLAGS := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) -fpie \ 5 -Os -DDISABLE_BRANCH_PROFILING $(DISABLE_STACKLEAK_PLUGIN) \ 6 $(DISABLE_LATENT_ENTROPY_PLUGIN) \ 7 $(call cc-option,-mbranch-protection=none) \ 8 -I$(srctree)/scripts/dtc/libfdt -fno-stack-protector \ 9 -include $(srctree)/include/linux/hidden.h \ 10 -D__DISABLE_EXPORTS -ffreestanding -D__NO_FORTIFY \ 11 -fno-asynchronous-unwind-tables -fno-unwind-tables \ 12 $(call cc-option,-fno-addrsig) 13 14# remove SCS flags from all objects in this directory 15KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_SCS), $(KBUILD_CFLAGS)) 16# disable LTO 17KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS)) 18 19GCOV_PROFILE := n 20KASAN_SANITIZE := n 21KCSAN_SANITIZE := n 22UBSAN_SANITIZE := n 23KCOV_INSTRUMENT := n 24 25$(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \ 26 --remove-section=.note.gnu.property \ 27 --prefix-alloc-sections=.init 28$(obj)/%.pi.o: $(obj)/%.o FORCE 29 $(call if_changed,objcopy) 30 31$(obj)/lib-%.o: $(srctree)/lib/%.c FORCE 32 $(call if_changed_rule,cc_o_c) 33 34obj-y := kaslr_early.pi.o lib-fdt.pi.o lib-fdt_ro.pi.o 35extra-y := $(patsubst %.pi.o,%.o,$(obj-y)) 36