Skip to content

Commit 7f7f6f7

Browse files
committed
Makefile: remove redundant tool coverage variables
Now Kbuild provides reasonable defaults for objtool, sanitizers, and profilers. Remove redundant variables. Note: This commit changes the coverage for some objects: - include arch/mips/vdso/vdso-image.o into UBSAN, GCOV, KCOV - include arch/sparc/vdso/vdso-image-*.o into UBSAN - include arch/sparc/vdso/vma.o into UBSAN - include arch/x86/entry/vdso/extable.o into KASAN, KCSAN, UBSAN, GCOV, KCOV - include arch/x86/entry/vdso/vdso-image-*.o into KASAN, KCSAN, UBSAN, GCOV, KCOV - include arch/x86/entry/vdso/vdso32-setup.o into KASAN, KCSAN, UBSAN, GCOV, KCOV - include arch/x86/entry/vdso/vma.o into GCOV, KCOV - include arch/x86/um/vdso/vma.o into KASAN, GCOV, KCOV I believe these are positive effects because all of them are kernel space objects. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Tested-by: Roberto Sassu <roberto.sassu@huawei.com>
1 parent 9c2d132 commit 7f7f6f7

File tree

34 files changed

+0
-241
lines changed

34 files changed

+0
-241
lines changed

arch/arm/boot/bootp/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# This file is included by the global makefile so that you can add your own
66
# architecture-specific flags and dependencies.
77
#
8-
GCOV_PROFILE := n
98

109
ifdef PHYS_OFFSET
1110
add_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) )

arch/arm/boot/compressed/Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ ifeq ($(CONFIG_ARM_VIRT_EXT),y)
2222
OBJS += hyp-stub.o
2323
endif
2424

25-
GCOV_PROFILE := n
26-
KASAN_SANITIZE := n
27-
28-
# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
29-
KCOV_INSTRUMENT := n
30-
UBSAN_SANITIZE := n
31-
3225
#
3326
# Architecture dependencies
3427
#

arch/arm/vdso/Makefile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ else
3333
CFLAGS_vgettimeofday.o = -O2 -include $(c-gettimeofday-y)
3434
endif
3535

36-
# Disable gcov profiling for VDSO code
37-
GCOV_PROFILE := n
38-
UBSAN_SANITIZE := n
39-
40-
# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
41-
KCOV_INSTRUMENT := n
42-
43-
KASAN_SANITIZE := n
44-
4536
# Force dependency
4637
$(obj)/vdso.o : $(obj)/vdso.so
4738

arch/arm64/kernel/pi/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_SCS), $(KBUILD_CFLAGS))
1919
# disable LTO
2020
KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS))
2121

22-
GCOV_PROFILE := n
23-
KASAN_SANITIZE := n
24-
KCSAN_SANITIZE := n
25-
UBSAN_SANITIZE := n
26-
KCOV_INSTRUMENT := n
27-
2822
hostprogs := relacheck
2923

3024
quiet_cmd_piobjcopy = $(quiet_cmd_objcopy)

arch/arm64/kernel/vdso/Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,13 @@ CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) \
4040
$(RANDSTRUCT_CFLAGS) $(GCC_PLUGINS_CFLAGS) \
4141
$(CC_FLAGS_LTO) $(CC_FLAGS_CFI) \
4242
-Wmissing-prototypes -Wmissing-declarations
43-
KASAN_SANITIZE := n
44-
KCSAN_SANITIZE := n
45-
UBSAN_SANITIZE := n
46-
OBJECT_FILES_NON_STANDARD := y
47-
KCOV_INSTRUMENT := n
4843

4944
CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -fasynchronous-unwind-tables
5045

5146
ifneq ($(c-gettimeofday-y),)
5247
CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
5348
endif
5449

55-
# Disable gcov profiling for VDSO code
56-
GCOV_PROFILE := n
57-
5850
targets += vdso.lds
5951
CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
6052

arch/arm64/kvm/hyp/nvhe/Makefile

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,3 @@ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_CFI)
9797
# causes a build failure. Remove profile optimization flags.
9898
KBUILD_CFLAGS := $(filter-out -fprofile-sample-use=% -fprofile-use=%, $(KBUILD_CFLAGS))
9999
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
100-
101-
# KVM nVHE code is run at a different exception code with a different map, so
102-
# compiler instrumentation that inserts callbacks or checks into the code may
103-
# cause crashes. Just disable it.
104-
GCOV_PROFILE := n
105-
KASAN_SANITIZE := n
106-
KCSAN_SANITIZE := n
107-
UBSAN_SANITIZE := n
108-
KCOV_INSTRUMENT := n
109-
110-
# Skip objtool checking for this directory because nVHE code is compiled with
111-
# non-standard build rules.
112-
OBJECT_FILES_NON_STANDARD := y

arch/csky/kernel/vdso/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
2323
obj-y += vdso.o vdso-syms.o
2424
CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
2525

26-
# Disable gcov profiling for VDSO code
27-
GCOV_PROFILE := n
28-
KCOV_INSTRUMENT := n
29-
3026
# Force dependency
3127
$(obj)/vdso.o: $(obj)/vdso.so
3228

arch/loongarch/vdso/Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
# Objects to go into the VDSO.
33

4-
KASAN_SANITIZE := n
5-
UBSAN_SANITIZE := n
6-
KCOV_INSTRUMENT := n
7-
OBJECT_FILES_NON_STANDARD := y
8-
94
# Include the generic Makefile to check the built vdso.
105
include $(srctree)/lib/vdso/Makefile
116

@@ -39,8 +34,6 @@ ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
3934
$(filter -E%,$(KBUILD_CFLAGS)) -nostdlib -shared \
4035
--hash-style=sysv --build-id -T
4136

42-
GCOV_PROFILE := n
43-
4437
#
4538
# Shared build commands.
4639
#

arch/mips/boot/compressed/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
3434
-DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \
3535
-DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS)
3636

37-
# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
38-
KCOV_INSTRUMENT := n
39-
GCOV_PROFILE := n
40-
UBSAN_SANITIZE := n
41-
KCSAN_SANITIZE := n
42-
4337
# decompressor objects (linked with vmlinuz)
4438
vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/bswapsi.o
4539

arch/mips/vdso/Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
# Objects to go into the VDSO.
33

4-
# Sanitizer runtimes are unavailable and cannot be linked here.
5-
KCSAN_SANITIZE := n
6-
74
# Include the generic Makefile to check the built vdso.
85
include $(srctree)/lib/vdso/Makefile
96

@@ -60,10 +57,6 @@ ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
6057

6158
CFLAGS_REMOVE_vdso.o = $(CC_FLAGS_FTRACE)
6259

63-
GCOV_PROFILE := n
64-
UBSAN_SANITIZE := n
65-
KCOV_INSTRUMENT := n
66-
6760
# Check that we don't have PIC 'jalr t9' calls left
6861
quiet_cmd_vdso_mips_check = VDSOCHK $@
6962
cmd_vdso_mips_check = if $(OBJDUMP) --disassemble $@ | grep -E -h "jalr.*t9" > /dev/null; \

0 commit comments

Comments
 (0)