mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-22 20:30:58 +02:00
Pull Kbuild updates from Masahiro Yamada: - Support 'make compile_commands.json' to generate the compilation database more easily, avoiding stale entries - Support 'make clang-analyzer' and 'make clang-tidy' for static checks using clang-tidy - Preprocess scripts/modules.lds.S to allow CONFIG options in the module linker script - Drop cc-option tests from compiler flags supported by our minimal GCC/Clang versions - Use always 12-digits commit hash for CONFIG_LOCALVERSION_AUTO=y - Use sha1 build id for both BFD linker and LLD - Improve deb-pkg for reproducible builds and rootless builds - Remove stale, useless scripts/namespace.pl - Turn -Wreturn-type warning into error - Fix build error of deb-pkg when CONFIG_MODULES=n - Replace 'hostname' command with more portable 'uname -n' - Various Makefile cleanups * tag 'kbuild-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits) kbuild: Use uname for LINUX_COMPILE_HOST detection kbuild: Only add -fno-var-tracking-assignments for old GCC versions kbuild: remove leftover comment for filechk utility treewide: remove DISABLE_LTO kbuild: deb-pkg: clean up package name variables kbuild: deb-pkg: do not build linux-headers package if CONFIG_MODULES=n kbuild: enforce -Werror=return-type scripts: remove namespace.pl builddeb: Add support for all required debian/rules targets builddeb: Enable rootless builds builddeb: Pass -n to gzip for reproducible packages kbuild: split the build log of kallsyms kbuild: explicitly specify the build id style scripts/setlocalversion: make git describe output more reliable kbuild: remove cc-option test of -Werror=date-time kbuild: remove cc-option test of -fno-stack-check kbuild: remove cc-option test of -fno-strict-overflow kbuild: move CFLAGS_{KASAN,UBSAN,KCSAN} exports to relevant Makefiles kbuild: remove redundant CONFIG_KASAN check from scripts/Makefile.kasan kbuild: do not create built-in objects for external module builds ...
76 lines
2.2 KiB
Makefile
76 lines
2.2 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# List of files in the vdso
|
|
|
|
KCOV_INSTRUMENT := n
|
|
ARCH_REL_TYPE_ABS := R_390_COPY|R_390_GLOB_DAT|R_390_JMP_SLOT|R_390_RELATIVE
|
|
ARCH_REL_TYPE_ABS += R_390_GOT|R_390_PLT
|
|
|
|
include $(srctree)/lib/vdso/Makefile
|
|
obj-vdso64 = vdso_user_wrapper.o note.o getcpu.o
|
|
obj-cvdso64 = vdso64_generic.o
|
|
CFLAGS_REMOVE_vdso64_generic.o = -pg $(CC_FLAGS_FTRACE) $(CC_FLAGS_EXPOLINE)
|
|
|
|
# Build rules
|
|
|
|
targets := $(obj-vdso64) $(obj-cvdso64) vdso64.so vdso64.so.dbg
|
|
obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
|
|
obj-cvdso64 := $(addprefix $(obj)/, $(obj-cvdso64))
|
|
|
|
KBUILD_AFLAGS += -DBUILD_VDSO
|
|
KBUILD_CFLAGS += -DBUILD_VDSO -DDISABLE_BRANCH_PROFILING
|
|
|
|
KBUILD_AFLAGS_64 := $(filter-out -m64,$(KBUILD_AFLAGS))
|
|
KBUILD_AFLAGS_64 += -m64 -s
|
|
|
|
KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS))
|
|
KBUILD_CFLAGS_64 += -m64 -fPIC -shared -fno-common -fno-builtin
|
|
ldflags-y := -fPIC -shared -nostdlib -soname=linux-vdso64.so.1 \
|
|
--hash-style=both --build-id=sha1 -T
|
|
|
|
$(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64)
|
|
$(targets:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_64)
|
|
|
|
obj-y += vdso64_wrapper.o
|
|
targets += vdso64.lds
|
|
CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)
|
|
|
|
# Disable gcov profiling, ubsan and kasan for VDSO code
|
|
GCOV_PROFILE := n
|
|
UBSAN_SANITIZE := n
|
|
KASAN_SANITIZE := n
|
|
|
|
# Force dependency (incbin is bad)
|
|
$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so
|
|
|
|
# link rule for the .so file, .lds has to be first
|
|
$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) $(obj-cvdso64) FORCE
|
|
$(call if_changed,ld)
|
|
|
|
# strip rule for the .so file
|
|
$(obj)/%.so: OBJCOPYFLAGS := -S
|
|
$(obj)/%.so: $(obj)/%.so.dbg FORCE
|
|
$(call if_changed,objcopy)
|
|
|
|
# assembly rules for the .S files
|
|
$(obj-vdso64): %.o: %.S FORCE
|
|
$(call if_changed_dep,vdso64as)
|
|
|
|
$(obj-cvdso64): %.o: %.c FORCE
|
|
$(call if_changed_dep,vdso64cc)
|
|
|
|
# actual build commands
|
|
quiet_cmd_vdso64as = VDSO64A $@
|
|
cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
|
|
quiet_cmd_vdso64cc = VDSO64C $@
|
|
cmd_vdso64cc = $(CC) $(c_flags) -c -o $@ $<
|
|
|
|
# install commands for the unstripped file
|
|
quiet_cmd_vdso_install = INSTALL $@
|
|
cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
|
|
|
|
vdso64.so: $(obj)/vdso64.so.dbg
|
|
@mkdir -p $(MODLIB)/vdso
|
|
$(call cmd,vdso_install)
|
|
|
|
vdso_install: vdso64.so
|