mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
Many architectures which do generate build IDs are missing from this list. For example arm64, riscv, loongarch, mips. Now that errors from readelf and binaries without any build ID are handled gracefully, the allow-list is not necessary anymore, drop it. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Nicolas Schier <nsc@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: https://patch.msgid.link/20260331-kbuild-vdso-install-v2-4-606d0dc6beca@weissschuh.net Signed-off-by: Nicolas Schier <nsc@kernel.org>
46 lines
1.0 KiB
Makefile
46 lines
1.0 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0-only
|
|
# ==========================================================================
|
|
# Install unstripped copies of vDSO
|
|
# ==========================================================================
|
|
|
|
PHONY := __default
|
|
__default:
|
|
@:
|
|
|
|
include $(srctree)/scripts/Kbuild.include
|
|
|
|
install-dir := $(MODLIB)/vdso
|
|
|
|
define gen_install_rules
|
|
|
|
dest := $(install-dir)/$$(patsubst %.dbg,%,$$(notdir $(1)))
|
|
|
|
__default: $$(dest)
|
|
$$(dest): $(1) FORCE
|
|
$$(call cmd,install)
|
|
|
|
build-id-file := $$(shell $(READELF) -n $(1) 2>/dev/null | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
|
|
|
|
ifneq ($$(build-id-file),)
|
|
link := $(install-dir)/.build-id/$$(build-id-file).debug
|
|
|
|
__default: $$(link)
|
|
$$(link): $$(dest) FORCE
|
|
$$(call cmd,symlink)
|
|
endif
|
|
|
|
endef
|
|
|
|
$(foreach x, $(sort $(INSTALL_FILES)), $(eval $(call gen_install_rules,$(x))))
|
|
|
|
quiet_cmd_install = INSTALL $@
|
|
cmd_install = mkdir -p $(dir $@); cp $< $@
|
|
|
|
quiet_cmd_symlink = SYMLINK $@
|
|
cmd_symlink = mkdir -p $(dir $@); ln -sf --relative $< $@
|
|
|
|
PHONY += FORCE
|
|
FORCE:
|
|
|
|
.PHONY: $(PHONY)
|