Centos-kernel-stream-9/arch/arm/boot/Makefile

106 lines
2.6 KiB
Makefile
Raw Normal View History

#
# arch/arm/boot/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies.
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1995-2002 Russell King
#
OBJCOPYFLAGS :=-O binary -R .comment -S
ifneq ($(MACHINE),)
include $(MACHINE)/Makefile.boot
endif
# Note: the following conditions must always be true:
# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
# PARAMS_PHYS must be within 4MB of ZRELADDR
# INITRD_PHYS must be in RAM
ZRELADDR := $(zreladdr-y)
PARAMS_PHYS := $(params_phys-y)
INITRD_PHYS := $(initrd_phys-y)
export ZRELADDR INITRD_PHYS PARAMS_PHYS
targets := Image zImage xipImage bootpImage uImage
ifeq ($(CONFIG_XIP_KERNEL),y)
kbuild: use $(src) instead of $(srctree)/$(src) for source directory JIRA: https://issues.redhat.com/browse/RHEL-107194 commit b1992c3772e69a6fd0e3fc81cd4d2820c8b6eca0 Author: Masahiro Yamada <masahiroy@kernel.org> Date: Sat Apr 27 23:55:02 2024 +0900 kbuild: use $(src) instead of $(srctree)/$(src) for source directory Kbuild conventionally uses $(obj)/ for generated files, and $(src)/ for checked-in source files. It is merely a convention without any functional difference. In fact, $(obj) and $(src) are exactly the same, as defined in scripts/Makefile.build: src := $(obj) When the kernel is built in a separate output directory, $(src) does not accurately reflect the source directory location. While Kbuild resolves this discrepancy by specifying VPATH=$(srctree) to search for source files, it does not cover all cases. For example, when adding a header search path for local headers, -I$(srctree)/$(src) is typically passed to the compiler. This introduces inconsistency between upstream and downstream Makefiles because $(src) is used instead of $(srctree)/$(src) for the latter. To address this inconsistency, this commit changes the semantics of $(src) so that it always points to the directory in the source tree. Going forward, the variables used in Makefiles will have the following meanings: $(obj) - directory in the object tree $(src) - directory in the source tree (changed by this commit) $(objtree) - the top of the kernel object tree $(srctree) - the top of the kernel source tree Consequently, $(srctree)/$(src) in upstream Makefiles need to be replaced with $(src). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu> Conflicts: There is a extensive list of fixes/conflicts due the amount of files originally changed by this commit, plus the difference of rhel-9 code against upstream. All conflicts/differences are listed below: - Context difference at Documentation/Makefile since RHEL 9 does not have the change "docs: allow to pass extra DOCS_CSS themes via make" and later changes. - Conflict at Documentation/devicetree/bindings/Makefile, patch find_cmd instead of find_all_cmd since RHEL-9 doesn't have "dt-bindings: Consider DT_SCHEMA_FILES when finding all json-schema", "dt-bindings: kbuild: Split targets out to separate rules" and later changes. - Conflict at Documentation/kbuild/makefiles.rst due different identation since RHEL-9 doesn't have the change "docs/kbuild/makefiles: clean up indentation and whitespace" - Patched additional $(srctree)/$(src) references at: * arch/arm/mach-davinci/Makefile * arch/arm/mach-omap2/Makefile * arch/arm/mach-spear/Makefile * arch/arm/plat-pxa/Makefile * arch/arm/plat-versatile/Makefile * arch/ia64/kernel/Makefile * arch/nds32/boot/Makefile * arch/nds32/kernel/vdso/Makefile * drivers/net/ethernet/hisilicon/hns3/hns3pf/Makefile * drivers/net/ethernet/hisilicon/hns3/hns3vf/Makefile * drivers/staging/rtl8188eu/Makefile * drivers/staging/unisys/visorhba/Makefile * drivers/staging/unisys/visornic/Makefile * scripts/gcc-plugins/Makefile Since RHEL-9 does not have later upstream changes that dropped/made those references uneeded. - Conflict at arch/arm/mach-s3c/Makefile since RHEL-9 doesn't have "ARM: s3c: remove s3c24xx specific hacks" and related changes. Also, extra locations needed patching because of not having the changes "ARM: s3c: remove all s3c24xx support" and "ARM: s3c: fix include path". Due lacking the last change also arch/arm/mach-s3c/Makefile.s3c64xx needs additional two places patched as well. - Conflict at arch/arm/plat-orion/Makefile since RHEL-9 doesn't have the commit "ARM: orion: fix include path" and its previous related changes. - Dropped changes for arch/loongarch since it doesn't exist on rhel-9 - Dropped changes to arch/parisc/kernel/{vdso32,vdso64}/Makefile since RHEL 9 does not have the change "parisc: Add vDSO support" and later updates to it. - Dropped change to arch/riscv/kernel/compat_vdso/Makefile since RHEL 9 does not have the change "riscv: compat: vdso: Add COMPAT_VDSO base code implementation" - Dropped change to arch/riscv/kvm/Makefile since there is no KVM support/commits in RHEL 9 for riscv. - Apply change for arch/riscv/kernel/vdso/Makefile in a different place since RHEL-9 does not have the change "riscv: explicitly use symbol offsets for VDSO" which changed the location of the $(srctree)/$(src) reference - Dropped change to certs/Makefile related to check-blacklist-hashes.awk since that script was only added with commit "certs: Check that builtin blacklist hashes are valid" which is not backported/available in RHEL 9 code right now. - Dropped change to drivers/md/dm-vdo/Makefile since dm-vdo was never backported to RHEL-9 main. - Dropped change to drivers/net/ethernet/fungible/funeth/Makefile since fungible ethernet driver/devices code is not available/backported to RHEL-9. - Fixed conflict at drivers/net/ethernet/hisilicon/hns3/Makefile since RHEL-9 does not have the change "net: hns3: refactor hns3 makefile to support hns3_common module" - Fixed conflict at drivers/net/wireless/intel/iwlwifi/mvm/Makefile due already backported commit "wifi: iwlwifi: mvm: implement link grading" - Dropped change to init/Makefile since we are not backporting "kbuild: build init/built-in.a just once" that introduced the section patched. - Dropped change to rust/Makefile since there is no rust support backported to RHEL-9. - Fixed conflict at scripts/dtc/Makefile since RHEL-9 does not have the change "dt-bindings: kbuild: Use DTB files for validation" - Dropped change to security/tomoyo/Makefile since it's not needed, it's just reverting the change "tomoyo: fix broken dependency on *.conf.default" which was never applied to RHEL-9. However, we also bring a different change/patch location since RHEL-9 does not have the change "tomoyo: Omit use of bin2c". - Dropped change to usr/include/Makefile since "kbuild: move headers_check.pl to usr/include/" is not being backported to RHEL-9. - Misc/minor context differences at other places. Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2025-08-14 22:50:14 +00:00
cmd_deflate_xip_data = $(CONFIG_SHELL) -c '$(src)/deflate_xip_data.sh $< $@'
ifeq ($(CONFIG_XIP_DEFLATED_DATA),y)
quiet_cmd_mkxip = XIPZ $@
cmd_mkxip = $(cmd_objcopy) && $(cmd_deflate_xip_data)
else
quiet_cmd_mkxip = $(quiet_cmd_objcopy)
cmd_mkxip = $(cmd_objcopy)
endif
$(obj)/xipImage: vmlinux FORCE
$(call if_changed,mkxip)
ARM: 8576/1: avoid duplicating "Kernel: arch/arm/boot/*Image is ready" Commit 3939f3345050 ("ARM: 8418/1: add boot image dependencies to not generate invalid images") fixed bad image generation for the parallel building, but as its side effect, Kbuild now descends into arch/arm/boot/ again and again, duplicating the log messages. It looks clumsy, so let's display the same message only once. This commit moves the log rules from arch/arm/boot/Makefile to arch/arm/Makefile. I did not delete them completely because *Image are the final targets that users are interested in. Without this commit, the log of incremental build is like follows: $ make ARCH=arm UIMAGE_LOADADDR=0x80208000 uImage CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh CHK include/generated/compile.h Kernel: arch/arm/boot/Image is ready Kernel: arch/arm/boot/Image is ready Kernel: arch/arm/boot/zImage is ready Kernel: arch/arm/boot/Image is ready Kernel: arch/arm/boot/zImage is ready Image arch/arm/boot/uImage is ready With this commit, it will look like follows: $ make ARCH=arm UIMAGE_LOADADDR=0x80208000 uImage CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh CHK include/generated/compile.h Kernel: arch/arm/boot/Image is ready Kernel: arch/arm/boot/zImage is ready Kernel: arch/arm/boot/uImage is ready Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2016-05-30 02:01:23 +00:00
@$(kecho) ' Physical Address of xipImage: $(CONFIG_XIP_PHYS_ADDR)'
$(obj)/Image $(obj)/zImage: FORCE
@echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
@echo 'Only the xipImage target is available in this case'
@false
else
$(obj)/xipImage: FORCE
@echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
@false
$(obj)/Image: vmlinux FORCE
$(call if_changed,objcopy)
$(obj)/compressed/vmlinux: $(obj)/Image FORCE
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy)
endif
ifneq ($(LOADADDR),)
UIMAGE_LOADADDR=$(LOADADDR)
else
ifeq ($(CONFIG_ZBOOT_ROM),y)
UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
else
UIMAGE_LOADADDR=$(ZRELADDR)
endif
endif
check_for_multiple_loadaddr = \
if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \
echo 'This is incompatible with uImages'; \
echo 'Specify LOADADDR on the commandline to build an uImage'; \
false; \
fi
$(obj)/uImage: $(obj)/zImage FORCE
@$(check_for_multiple_loadaddr)
$(call if_changed,uimage)
$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
$(Q)$(MAKE) $(build)=$(obj)/bootp $@
$(obj)/bootpImage: $(obj)/bootp/bootp FORCE
$(call if_changed,objcopy)
PHONY += initrd
initrd:
@test "$(INITRD_PHYS)" != "" || \
(echo This machine does not support INITRD; exit -1)
@test "$(INITRD)" != "" || \
(echo You must specify INITRD; exit -1)
subdir- := bootp compressed dts