diff options
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r-- | scripts/Makefile.lib | 282 |
1 files changed, 177 insertions, 105 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 9aa8be535f..6b1f0ccbc0 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -1,3 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0 +# Backward compatibility +asflags-y += $(EXTRA_AFLAGS) +ccflags-y += $(EXTRA_CFLAGS) +cppflags-y += $(EXTRA_CPPFLAGS) +ldflags-y += $(EXTRA_LDFLAGS) +always-y += $(always) +hostprogs += $(hostprogs-y) $(hostprogs-m) + # Figure out what we need to build from the various variables # =========================================================================== @@ -11,19 +20,9 @@ obj-m := $(filter-out $(obj-y),$(obj-m)) lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m))) - -pbl-y += $(pbl-dtb-y) -obj-y += $(obj-dtb-y) -extra-y += $(patsubst %.dtb.o,%.dtb.S,$(obj-dtb-y)) -extra-y += $(patsubst %.dtb.o,%.dtb,$(obj-dtb-y)) -extra-y += $(patsubst %.dtb.o,%.dtb.S,$(pbl-dtb-y)) -extra-y += $(patsubst %.dtb.o,%.dtb,$(pbl-dtb-y)) -extra-y += $(patsubst %.dtb.o,%.dtb.S,$(lwl-dtb-y)) -extra-y += $(patsubst %.dtb.o,%.dtb,$(lwl-dtb-y)) - # Handle objects in subdirs # --------------------------------------------------------------------------- -# o if we encounter foo/ in $(obj-y), replace it by foo/built-in.o +# o if we encounter foo/ in $(obj-y), replace it by foo/built-in.a # and add the directory to the list of dirs to descend into: $(subdir-y) # o if we encounter foo/ in $(obj-m), remove it from $(obj-m) # and add the directory to the list of dirs to descend into: $(subdir-m) @@ -31,29 +30,29 @@ extra-y += $(patsubst %.dtb.o,%.dtb,$(lwl-dtb-y)) # lowlevel is present in the PBL if enabled # otherwise in barebox ifeq ($(CONFIG_PBL_IMAGE), y) -pbl-y += $(lwl-y) $(lwl-dtb-y) +pbl-y += $(lwl-y) else -obj-y += $(lwl-y) $(lwl-dtb-y) +obj-y += $(lwl-y) endif obj-y += $(obj-pbl-y) pbl-y += $(obj-pbl-y) -# add pbl- prefix to the target -pbl-y := $(shell echo $(pbl-y) | sed -e 's%\(\([^ \t]\+/\)*\)\([^ \t]*\.o\)%\2pbl-\3%g') +# pbl objects are suffixed with .pbl.o +pbl-y := $(patsubst %.o,%.pbl.o,$(pbl-y)) # add subdir from $(obj-y) too so we do not need to have the dir define in # both $(obj-y) and $(pbl-y) __pbl-y := $(filter-out $(pbl-y), $(filter %/, $(obj-y))) pbl-y += $(__pbl-y) -pbl-y := $(sort $(patsubst %/, %/built-in-pbl.o, $(pbl-y))) +pbl-y := $(sort $(patsubst %/, %/built-in.pbl.a, $(pbl-y))) __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) subdir-y += $(__subdir-y) __subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) subdir-m += $(__subdir-m) -obj-y := $(patsubst %/, %/built-in.o, $(obj-y)) +obj-y := $(patsubst %/, %/built-in.a, $(obj-y)) obj-m := $(filter-out %/, $(obj-m)) # Subdirectories we need to descend into @@ -74,37 +73,54 @@ multi-objs := $(multi-objs-y) $(multi-objs-m) # $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to # tell kbuild to descend -__subdir-obj-y := $(filter %/built-in-pbl.o, $(pbl-y)) -subdir-obj-y := $(filter %/built-in.o, $(obj-y)) +__subdir-obj-y := $(filter %/built-in.pbl.a, $(pbl-y)) +subdir-obj-y := $(filter %/built-in.a, $(obj-y)) subdir-obj-y += $(__subdir-obj-y) -# $(obj-dirs) is a list of directories that contain object files -obj-dirs := $(dir $(multi-objs) $(obj-y) $(pbl-y)) +obj-y += $(patsubst %,%.bbenv$(DEFAULT_COMPRESSION_SUFFIX).o,$(bbenv-y)) +extra-y += $(patsubst %,%.bbenv$(DEFAULT_COMPRESSION_SUFFIX),$(bbenv-y)) +extra-y += $(patsubst %,%.bbenv$(DEFAULT_COMPRESSION_SUFFIX).S,$(bbenv-y)) +extra-y += $(patsubst %,%.bbenv$(DEFAULT_COMPRESSION_SUFFIX).o,$(bbenv-y)) + +# Replace multi-part objects by their individual parts, +# including built-in.a from subdirectories +real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) +real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) + +always-y += $(always-m) -# Replace multi-part objects by their individual parts, look at local dir only -real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y) -real-objs-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) +# hostprogs-always-y += foo +# ... is a shorthand for +# hostprogs += foo +# always-y += foo +hostprogs += $(hostprogs-always-y) $(hostprogs-always-m) +always-y += $(hostprogs-always-y) $(hostprogs-always-m) + +# userprogs-always-y is likewise. +userprogs += $(userprogs-always-y) $(userprogs-always-m) +always-y += $(userprogs-always-y) $(userprogs-always-m) # Add subdir path extra-y := $(addprefix $(obj)/,$(extra-y)) -always := $(addprefix $(obj)/,$(always)) +always-y := $(addprefix $(obj)/,$(always-y)) targets := $(addprefix $(obj)/,$(targets)) obj-y := $(addprefix $(obj)/,$(obj-y)) obj-m := $(addprefix $(obj)/,$(obj-m)) lib-y := $(addprefix $(obj)/,$(lib-y)) pbl-y := $(addprefix $(obj)/,$(pbl-y)) subdir-obj-y := $(addprefix $(obj)/,$(subdir-obj-y)) -real-objs-y := $(addprefix $(obj)/,$(real-objs-y)) -real-objs-m := $(addprefix $(obj)/,$(real-objs-m)) +real-obj-y := $(addprefix $(obj)/,$(real-obj-y)) +real-obj-m := $(addprefix $(obj)/,$(real-obj-m)) single-used-m := $(addprefix $(obj)/,$(single-used-m)) multi-used-y := $(addprefix $(obj)/,$(multi-used-y)) multi-used-m := $(addprefix $(obj)/,$(multi-used-m)) multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y)) multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m)) subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) -obj-dirs := $(addprefix $(obj)/,$(obj-dirs)) -bbenv-y := $(addprefix $(obj)/,$(bbenv-y)) + +# target with $(obj)/ and its suffix stripped +target-stem = $(basename $(patsubst $(obj)/%,%,$@)) # These flags are needed for modversions and compiling, so we define them here # already @@ -118,9 +134,19 @@ basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))" modname_flags = $(if $(filter 1,$(words $(modname))),\ -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") -_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o) -_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) -_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) +_c_flags = $(KBUILD_CFLAGS) $(ccflags-y) $(CFLAGS_$(target-stem).o) +_a_flags = $(KBUILD_AFLAGS) $(asflags-y) $(AFLAGS_$(target-stem).o) +_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(target-stem).lds) + +# +# Enable address sanitizer flags for kernel except some files or directories +# we don't want to check (depends on variables KASAN_SANITIZE_obj.o, KASAN_SANITIZE) +# +ifeq ($(CONFIG_KASAN),y) +_c_flags += $(if $(part-of-pbl),, $(if $(patsubst n%,, \ + $(KASAN_SANITIZE_$(basetarget).o)$(KASAN_SANITIZE)y), \ + $(CFLAGS_KASAN), $(CFLAGS_KASAN_NOSANITIZE))) +endif ifeq ($(CONFIG_UBSAN),y) _CFLAGS_UBSAN = $(eval _CFLAGS_UBSAN := $(CFLAGS_UBSAN))$(_CFLAGS_UBSAN) @@ -130,10 +156,29 @@ _c_flags += $(if $(patsubst n%,, \ PBL_CPPFLAGS += $(call cc-option,-fno-sanitize=all) endif +ifeq ($(CONFIG_DEBUG_PBL),y) +PBL_CPPFLAGS += -DDEBUG +endif + +_stackp_flags-y := -fno-stack-protector +_stackp_flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong +_stackp_flags-$(CONFIG_STACKPROTECTOR_ALL) := -fstack-protector-all + +_stackp_flags_pbl-y := -fno-stack-protector +_stackp_flags_pbl-$(CONFIG_PBL_STACKPROTECTOR_STRONG) := -fstack-protector-strong +_stackp_flags_pbl-$(CONFIG_PBL_STACKPROTECTOR_ALL) := -fstack-protector-all + +_c_flags += $(if $(part-of-pbl),$(_stackp_flags_pbl-y),$(_stackp_flags-y)) + +ifeq ($(CONFIG_PBL_FULLY_PIC),y) +include scripts/Makefile.pic +PBL_CPPFLAGS += $(picflags-y) +endif + # If building barebox in a separate objtree expand all occurrences # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). -ifeq ($(KBUILD_SRC),) +ifndef building_out_of_srctree __c_flags = $(_c_flags) __a_flags = $(_a_flags) __cpp_flags = $(_cpp_flags) @@ -148,22 +193,39 @@ __a_flags = $(call flags,_a_flags) __cpp_flags = $(call flags,_cpp_flags) endif -c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ - $(__c_flags) $(modkern_cflags) \ +part-of-module = $(if $(filter $(basename $@).o, $(real-obj-m)),y) +part-of-pbl = $(if $(filter $(basename $@).o, $(pbl-y))$(filter $@, $(pbl-target)),y) +quiet_modtag = $(if $(part-of-pbl),[P],$(if $(part-of-module),[M], )) + +pbl_cppflags = $(if $(part-of-pbl), -D__PBL__ $(PBL_CPPFLAGS)) + +modkern_cflags = \ + $(if $(part-of-module), \ + $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \ + $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL) $(modfile_flags)) + +modkern_aflags = $(if $(part-of-module), \ + $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE), \ + $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL)) + +c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ + $(__c_flags) $(modkern_cflags) $(pbl_cppflags) \ -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) -a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ - $(__a_flags) $(modkern_aflags) +a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ + $(__a_flags) $(modkern_aflags) $(pbl_cppflags) cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) -ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) +ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) dtc_cpp_flags = -Wp,-MD,$(depfile).pre -nostdinc \ + -Wp,-MT,$(basename $(notdir $@)).o \ -I$(srctree)/arch/$(SRCARCH)/dts/include \ - -I$(srctree)/dts/include \ -I$(srctree)/include \ + -I$(srctree)/dts/include \ -I$(srctree)/dts/src/ \ + $(DTC_CPP_FLAGS_$(basetarget)$(suffix $@)) \ -undef -D__DTS__ ifdef CONFIG_BOOTM_FITIMAGE_PUBKEY @@ -185,31 +247,15 @@ $(foreach m, $(notdir $1), \ $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s))))))) endef -# LEX -# --------------------------------------------------------------------------- -quiet_cmd_flex = LEX $@ - cmd_flex = $(LEX) -o$@ -L $< - -$(obj)/%.lex.c: $(src)/%.l FORCE - $(call if_changed,flex) - -# YACC -# --------------------------------------------------------------------------- -quiet_cmd_bison = YACC $@ - cmd_bison = $(YACC) -o$@ -t -l $< - -$(obj)/%.tab.c: $(src)/%.y FORCE - $(call if_changed,bison) - -quiet_cmd_bison_h = YACC $@ - cmd_bison_h = $(YACC) -o/dev/null --defines=$@ -t -l $< - -$(obj)/%.tab.h: $(src)/%.y FORCE - $(call if_changed,bison_h) - # Shipped files # =========================================================================== +quiet_cmd_0size = 0SIZE $@ +cmd_0size = : > $@ + +quiet_cmd_delete = DELETE $@ + cmd_delete = rm -f $@ + quiet_cmd_shipped = SHIPPED $@ cmd_shipped = cat $< > $@ @@ -227,11 +273,22 @@ $(obj)/%:: $(src)/%_shipped # and add target to extra-y so that we know we have to # read in the saved command line +# Prelinking +# --------------------------------------------------------------------------- + +ifneq ($(CONFIG_RISCV),) +quiet_cmd_prelink__ = PRELINK $@ + cmd_prelink__ = $(objtree)/scripts/prelink-riscv $@ +endif + +quiet_cmd_prelink__ ?= + cmd_prelink__ ?= + # Linking # --------------------------------------------------------------------------- quiet_cmd_ld = LD $@ -cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \ +cmd_ld = $(LD) $(KBUILD_LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \ $(filter-out FORCE,$^) -o $@ # Objcopy @@ -240,6 +297,27 @@ cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \ quiet_cmd_objcopy = OBJCOPY $@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ +# Hashing +# --------------------------------------------------------------------------- +# POSIX printf (e.g. dash's) doesn't support \xHH, but octal sequences are fine + +quiet_cmd_sha256bin ?= SHA-BIN $@ + cmd_sha256bin = printf "$(shell sed 's/ .*$$//;s/../0x&\n/g;s/\n$$//' $< | \ + while read -r byte; do printf '\%o' $$byte; done)" > $@ + +quiet_cmd_sha256sum ?= SHA $@ + cmd_sha256sum ?= sha256sum $2 > $@ + +# Decompressor for barebox proper binary when using PBL +# --------------------------------------------------------------------------- + +suffix_y = comp_copy +suffix_$(CONFIG_IMAGE_COMPRESSION_GZIP) = gzip +suffix_$(CONFIG_IMAGE_COMPRESSION_LZO) = lzo +suffix_$(CONFIG_IMAGE_COMPRESSION_LZ4) = lz4 +suffix_$(CONFIG_IMAGE_COMPRESSION_XZKERN) = xzkern +suffix_$(CONFIG_IMAGE_COMPRESSION_NONE) = comp_copy + # Gzip # --------------------------------------------------------------------------- @@ -288,44 +366,56 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \ -Wno-unit_address_format \ -Wno-avoid_unnecessary_addr_size \ -Wno-alias_paths \ - -Wno-alias_paths \ -Wno-graph_child_address \ -Wno-simple_bus_reg \ -Wno-unique_unit_address \ - -Wno-pci_device_reg + -Wno-pci_device_reg \ + -Wno-interrupt_provider ifeq ($(CONFIG_OF_OVERLAY_LIVE), y) -DTC_FLAGS += -@ +DTC_FLAGS.dtb += -@ endif +DTC_FLAGS.dtbo += -Wno-avoid_default_addr_size -Wno-reg_format + # Generate an assembly file to wrap the output of the device tree compiler quiet_cmd_dt_S_dtb = DTB $@ cmd_dt_S_dtb = $(srctree)/scripts/gen-dtb-s $(subst -,_,$(*F)) $< $(CONFIG_IMD) > $@ -$(obj)/%.dtb.S: $(obj)/%.dtb $(srctree)/scripts/gen-dtb-s FORCE +$(obj)/%.dtb.S: $(obj)/%.dtb $(obj)/%.dtb.z $(srctree)/scripts/gen-dtb-s FORCE $(call if_changed,dt_S_dtb) +quiet_cmd_dt_S_dtbo = DTBO $@ +cmd_dt_S_dtbo = $(srctree)/scripts/gen-dtbo-s $(subst -,_,$(*F)) $< > $@ +$(obj)/%.dtbo.S: $(obj)/%.dtbo $(srctree)/scripts/gen-dtbo-s FORCE + $(call if_changed,dt_S_dtbo) + +$(obj)/%.dtb.z: $(obj)/%.dtb FORCE + $(call if_changed,$(suffix_y)) + +dts-frags = $(subst $(quote),,$(CONFIG_EXTERNAL_DTS_FRAGMENTS)) quiet_cmd_dtc = DTC $@ -cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ +cmd_dtc = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) \ + -D'$(subst -,_,$(*F))_dts=1' $(foreach f,$< $(2),-include '$(f)') /dev/null ; \ $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 \ - -i $(srctree)/arch/$(SRCARCH)/dts $(DTC_FLAGS) \ + -i $(srctree)/arch/$(SRCARCH)/dts $(DTC_FLAGS) $(DTC_FLAGS$(suffix $@)) \ -i $(srctree)/dts/src/$(SRCARCH) \ + -i $(srctree)/dts/src/arm/ti/omap \ -d $(depfile).dtc $(dtc-tmp) ; \ cat $(depfile).pre $(depfile).dtc > $(depfile) $(obj)/%.dtb: $(src)/%.dts FORCE + $(call if_changed_dep,dtc,$(dts-frags)) + +$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE $(call if_changed_dep,dtc) dtc-tmp = $(subst $(comma),_,$(dot-target).dts) -obj-y += $(patsubst %,%.bbenv$(DEFAULT_COMPRESSION_SUFFIX).o,$(bbenv-y)) -extra-y += $(patsubst %,%.bbenv$(DEFAULT_COMPRESSION_SUFFIX),$(bbenv-y)) -extra-y += $(patsubst %,%.bbenv$(DEFAULT_COMPRESSION_SUFFIX).S,$(bbenv-y)) -extra-y += $(patsubst %,%.bbenv$(DEFAULT_COMPRESSION_SUFFIX).o,$(bbenv-y)) - quiet_cmd_env_S = ENV.S $@ cmd_env_S = \ ( \ - echo '\#include <asm-generic/barebox.lds.h>'; \ + echo '\#include <asm/barebox.lds.h>'; \ + echo '.section .note.GNU-stack,"",%progbits'; \ echo '.section .bbenv.rodata.$(subst -,_,$(*F)),"a"'; \ echo '.balign STRUCT_ALIGNMENT'; \ echo '.global __bbenv_$(subst -,_,$(*F))_start'; \ @@ -339,6 +429,9 @@ cmd_env_S = \ $(obj)/%.bbenv$(DEFAULT_COMPRESSION_SUFFIX).S: $(src)/%.bbenv$(DEFAULT_COMPRESSION_SUFFIX) FORCE $(call if_changed,env_S) +quiet_cmd_envgen = ENVGEN $@ +cmd_envgen=$(srctree)/scripts/genenv $(objtree) $(objtree) $@ $2 + quiet_cmd_env = ENV $@ cmd_env=$(srctree)/scripts/genenv $(srctree) $(objtree) $@ $< @@ -394,34 +487,6 @@ cmd_lzo = (cat $(filter-out FORCE,$^) | \ %.lzo: % $(call if_changed,lzo) -# XZ -# --------------------------------------------------------------------------- -# Use xzkern to compress the kernel image and xzmisc to compress other things. -# -# xzkern uses a big LZMA2 dictionary since it doesn't increase memory usage -# of the kernel decompressor. A BCJ filter is used if it is available for -# the target architecture. xzkern also appends uncompressed size of the data -# using size_append. The .xz format has the size information available at -# the end of the file too, but it's in more complex format and it's good to -# avoid changing the part of the boot code that reads the uncompressed size. -# Note that the bytes added by size_append will make the xz tool think that -# the file is corrupt. This is expected. -# -# xzmisc doesn't use size_append, so it can be used to create normal .xz -# files. xzmisc uses smaller LZMA2 dictionary than xzkern, because a very -# big dictionary would increase the memory usage too much in the multi-call -# decompression mode. A BCJ filter isn't used either. -quiet_cmd_xzkern = XZKERN $@ -cmd_xzkern = (cat $(filter-out FORCE,$^) | \ - sh $(srctree)/scripts/xz_wrap.sh && \ - $(call size_append, $(filter-out FORCE,$^))) > $@ || \ - (rm -f $@ ; false) - -quiet_cmd_xzmisc = XZMISC $@ -cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ - xz --check=crc32 --lzma2=dict=1MiB) > $@ || \ - (rm -f $@ ; false) - # lz4 # --------------------------------------------------------------------------- @@ -471,7 +536,8 @@ quiet_cmd_check_file_size = CHKFILESIZE $2 quiet_cmd_imximage__S_dcd= DCD_S $@ cmd_imximage_S_dcd= \ ( \ - echo '\#include <asm-generic/barebox.lds.h>'; \ + echo '\#include <asm/barebox.lds.h>'; \ + echo '.section .note.GNU-stack,"",%progbits'; \ echo '.balign STRUCT_ALIGNMENT'; \ echo '.global $(subst -,_,$(*F))_start'; \ echo '$(subst -,_,$(*F))_start:'; \ @@ -486,6 +552,11 @@ overwrite-hab-env = $(shell set -e; \ test -n "$$$(1)"; \ echo -D$(1)=\\\"$(shell echo $$$(1))\\\") +overwrite-fit-env = $(shell set -e; \ + test -n "$(CONFIG_BOOTM_FITIMAGE_PUBKEY_ENV)"; \ + test -n "$$$(1)"; \ + echo -D$(1)=\\\"$(shell echo $$$(1))\\\") + imxcfg_cpp_flags = -Wp,-MD,$(depfile) -nostdinc -x assembler-with-cpp \ -I $(srctree)/include -I $(srctree)/arch/arm/mach-imx/include \ -include include/generated/autoconf.h \ @@ -494,7 +565,8 @@ imxcfg_cpp_flags = -Wp,-MD,$(depfile) -nostdinc -x assembler-with-cpp \ $(call overwrite-hab-env,CONFIG_HABV3_IMG_CRT_DER) \ $(call overwrite-hab-env,CONFIG_HABV4_TABLE_BIN) \ $(call overwrite-hab-env,CONFIG_HABV4_CSF_CRT_PEM) \ - $(call overwrite-hab-env,CONFIG_HABV4_IMG_CRT_PEM) + $(call overwrite-hab-env,CONFIG_HABV4_IMG_CRT_PEM) \ + $(call overwrite-fit-env,CONFIG_BOOTM_FITIMAGE_PUBKEY) \ dcd-tmp = $(subst $(comma),_,$(dot-target).dcd.tmp) @@ -542,7 +614,7 @@ quiet_cmd_b64dec = B64DEC $@ # target file. quiet_cmd_rsa_keys = RSAKEY $@ cmd_rsa_keys = \ - $(objtree)/scripts/rsatoc -o $@.tmp $(2) && \ + $(objtree)/scripts/rsatoc -o $@.tmp "$(2)" $(3) && \ if cmp -s $@.tmp $@; then \ rm $@.tmp; \ else \ |