Makefile: remove redundant tool coverage variables
authorMasahiro Yamada <masahiroy@kernel.org>
Mon, 6 May 2024 13:35:43 +0000 (22:35 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Tue, 14 May 2024 14:35:48 +0000 (23:35 +0900)
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>
34 files changed:
arch/arm/boot/bootp/Makefile
arch/arm/boot/compressed/Makefile
arch/arm/vdso/Makefile
arch/arm64/kernel/pi/Makefile
arch/arm64/kernel/vdso/Makefile
arch/arm64/kvm/hyp/nvhe/Makefile
arch/csky/kernel/vdso/Makefile
arch/loongarch/vdso/Makefile
arch/mips/boot/compressed/Makefile
arch/mips/vdso/Makefile
arch/parisc/boot/compressed/Makefile
arch/powerpc/kernel/vdso/Makefile
arch/powerpc/purgatory/Makefile
arch/riscv/boot/Makefile
arch/riscv/kernel/compat_vdso/Makefile
arch/riscv/kernel/pi/Makefile
arch/riscv/kernel/vdso/Makefile
arch/riscv/purgatory/Makefile
arch/s390/kernel/vdso32/Makefile
arch/s390/kernel/vdso64/Makefile
arch/s390/purgatory/Makefile
arch/sh/boot/compressed/Makefile
arch/sparc/vdso/Makefile
arch/x86/boot/Makefile
arch/x86/boot/compressed/Makefile
arch/x86/entry/vdso/Makefile
arch/x86/purgatory/Makefile
arch/x86/realmode/rm/Makefile
arch/x86/um/vdso/Makefile
drivers/firmware/efi/libstub/Makefile
drivers/misc/lkdtm/Makefile
init/Makefile
scripts/Makefile.vmlinux
scripts/mod/Makefile

index a2934e6fd89aa09af038be219a8f1e697eb15a1b..f3443f7d7b02fea180f0a6afa08c3b8cf3675e85 100644 (file)
@@ -5,7 +5,6 @@
 # This file is included by the global makefile so that you can add your own
 # architecture-specific flags and dependencies.
 #
-GCOV_PROFILE   := n
 
 ifdef PHYS_OFFSET
 add_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) )
index 726ecabcef0932dcc04f76d79ee806bb8f1d8ff1..6bca03c0c7f0e28e832187366d96b77ea0dfc614 100644 (file)
@@ -22,13 +22,6 @@ ifeq ($(CONFIG_ARM_VIRT_EXT),y)
 OBJS           += hyp-stub.o
 endif
 
-GCOV_PROFILE           := n
-KASAN_SANITIZE         := n
-
-# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
-KCOV_INSTRUMENT                := n
-UBSAN_SANITIZE         := n
-
 #
 # Architecture dependencies
 #
index d761bd2e2f407236bf00235fae95e2b226364d67..01067a2bc43b74cc3a4c071b4a0fbeb0933e9ff7 100644 (file)
@@ -33,15 +33,6 @@ else
 CFLAGS_vgettimeofday.o = -O2 -include $(c-gettimeofday-y)
 endif
 
-# Disable gcov profiling for VDSO code
-GCOV_PROFILE := n
-UBSAN_SANITIZE := n
-
-# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
-KCOV_INSTRUMENT := n
-
-KASAN_SANITIZE := n
-
 # Force dependency
 $(obj)/vdso.o : $(obj)/vdso.so
 
index 4393b41f0b7133daa0f9ba04be268fe7d2007a1b..4d11a8c29181640f5bf71c1766f8a9e5c3d715a8 100644 (file)
@@ -19,12 +19,6 @@ KBUILD_CFLAGS        := $(filter-out $(CC_FLAGS_SCS), $(KBUILD_CFLAGS))
 # disable LTO
 KBUILD_CFLAGS  := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS))
 
-GCOV_PROFILE   := n
-KASAN_SANITIZE := n
-KCSAN_SANITIZE := n
-UBSAN_SANITIZE := n
-KCOV_INSTRUMENT        := n
-
 hostprogs      := relacheck
 
 quiet_cmd_piobjcopy = $(quiet_cmd_objcopy)
index 53e86d3bc159a6d13790e27c7ade0efcd8c5c796..d63930c82839784f1ec7210ed92ade738806cdc5 100644 (file)
@@ -40,11 +40,6 @@ CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) \
                                $(RANDSTRUCT_CFLAGS) $(GCC_PLUGINS_CFLAGS) \
                                $(CC_FLAGS_LTO) $(CC_FLAGS_CFI) \
                                -Wmissing-prototypes -Wmissing-declarations
-KASAN_SANITIZE                 := n
-KCSAN_SANITIZE                 := n
-UBSAN_SANITIZE                 := n
-OBJECT_FILES_NON_STANDARD      := y
-KCOV_INSTRUMENT                        := n
 
 CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -fasynchronous-unwind-tables
 
@@ -52,9 +47,6 @@ ifneq ($(c-gettimeofday-y),)
   CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
 endif
 
-# Disable gcov profiling for VDSO code
-GCOV_PROFILE := n
-
 targets += vdso.lds
 CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
 
index 2250253a6429c88a2733bdf6382c0e0deb2ba32c..50fa0ffb6b7e2704929012bfa06d341d775e9ba2 100644 (file)
@@ -97,16 +97,3 @@ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_CFI)
 # causes a build failure. Remove profile optimization flags.
 KBUILD_CFLAGS := $(filter-out -fprofile-sample-use=% -fprofile-use=%, $(KBUILD_CFLAGS))
 KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
-
-# KVM nVHE code is run at a different exception code with a different map, so
-# compiler instrumentation that inserts callbacks or checks into the code may
-# cause crashes. Just disable it.
-GCOV_PROFILE   := n
-KASAN_SANITIZE := n
-KCSAN_SANITIZE := n
-UBSAN_SANITIZE := n
-KCOV_INSTRUMENT        := n
-
-# Skip objtool checking for this directory because nVHE code is compiled with
-# non-standard build rules.
-OBJECT_FILES_NON_STANDARD := y
index e79a725f50758265950808f8467d3244742a37a0..bc2261f5a8d4393d96c6b459730b0e37ce20ad4e 100644 (file)
@@ -23,10 +23,6 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
 obj-y += vdso.o vdso-syms.o
 CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
 
-# Disable gcov profiling for VDSO code
-GCOV_PROFILE := n
-KCOV_INSTRUMENT := n
-
 # Force dependency
 $(obj)/vdso.o: $(obj)/vdso.so
 
index cdfc4c793e2c32b031424f67375697e8e4632b77..d724d46b07c84210f2bb51173c48257807c80160 100644 (file)
@@ -1,11 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 # Objects to go into the VDSO.
 
-KASAN_SANITIZE := n
-UBSAN_SANITIZE := n
-KCOV_INSTRUMENT := n
-OBJECT_FILES_NON_STANDARD := y
-
 # Include the generic Makefile to check the built vdso.
 include $(srctree)/lib/vdso/Makefile
 
@@ -39,8 +34,6 @@ ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
        $(filter -E%,$(KBUILD_CFLAGS)) -nostdlib -shared \
        --hash-style=sysv --build-id -T
 
-GCOV_PROFILE := n
-
 #
 # Shared build commands.
 #
index 6cc28173bee894070131908a4aea5dfaa18d4067..e0b8ec9a9516281933b6cc5b175e82f4013c2f54 100644 (file)
@@ -34,12 +34,6 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
        -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \
        -DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS)
 
-# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
-KCOV_INSTRUMENT                := n
-GCOV_PROFILE := n
-UBSAN_SANITIZE := n
-KCSAN_SANITIZE                 := n
-
 # decompressor objects (linked with vmlinuz)
 vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o $(obj)/bswapsi.o
 
index 40b839e9180606c6502021bd63eb389b47beebb6..b289b2c1b2946057c29cde8ee456b311fa25d448 100644 (file)
@@ -1,9 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 # Objects to go into the VDSO.
 
-# Sanitizer runtimes are unavailable and cannot be linked here.
- KCSAN_SANITIZE                        := n
-
 # Include the generic Makefile to check the built vdso.
 include $(srctree)/lib/vdso/Makefile
 
@@ -60,10 +57,6 @@ ldflags-y := -Bsymbolic --no-undefined -soname=linux-vdso.so.1 \
 
 CFLAGS_REMOVE_vdso.o = $(CC_FLAGS_FTRACE)
 
-GCOV_PROFILE := n
-UBSAN_SANITIZE := n
-KCOV_INSTRUMENT := n
-
 # Check that we don't have PIC 'jalr t9' calls left
 quiet_cmd_vdso_mips_check = VDSOCHK $@
       cmd_vdso_mips_check = if $(OBJDUMP) --disassemble $@ | grep -E -h "jalr.*t9" > /dev/null; \
index a294a1b58ee7ede0ebfbc9d5329a1665be645691..92227fa813dc3480545ac3704cd4af0ab2580e5f 100644 (file)
@@ -5,10 +5,6 @@
 # create a compressed self-extracting vmlinux image from the original vmlinux
 #
 
-KCOV_INSTRUMENT := n
-GCOV_PROFILE := n
-UBSAN_SANITIZE := n
-
 OBJECTS := head.o real2.o firmware.o misc.o piggy.o
 targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
index 7d66b6e079938cd103dd058293f6b6f2d63fd176..1425b6edc66b24fd8b26bdd9f2d03ec0e8439a29 100644 (file)
@@ -47,12 +47,6 @@ obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
 targets += $(obj-vdso64) vdso64.so.dbg vgettimeofday-64.o
 obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
 
-GCOV_PROFILE := n
-KCOV_INSTRUMENT := n
-UBSAN_SANITIZE := n
-KASAN_SANITIZE := n
-KCSAN_SANITIZE := n
-
 ccflags-y := -fno-common -fno-builtin
 ldflags-y := -Wl,--hash-style=both -nostdlib -shared -z noexecstack $(CLANG_FLAGS)
 ldflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD),-fuse-ld=lld)
@@ -114,5 +108,3 @@ quiet_cmd_vdso64ld_and_check = VDSO64L $@
       cmd_vdso64ld_and_check = $(VDSOCC) $(ldflags-y) $(LD64FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^); $(cmd_vdso_check)
 quiet_cmd_vdso64as = VDSO64A $@
       cmd_vdso64as = $(VDSOCC) $(a_flags) $(AS64FLAGS) -c -o $@ $<
-
-OBJECT_FILES_NON_STANDARD := y
index 78473d69cd2b6752e5cac6d02e7f0cc8affb829a..e9890085953e420a33a0fed7fedf81d8811a9ab3 100644 (file)
@@ -1,8 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 
-KASAN_SANITIZE := n
-KCSAN_SANITIZE := n
-
 targets += trampoline_$(BITS).o purgatory.ro
 
 # When profile-guided optimization is enabled, llvm emits two different
index 8e7fc0edf21d3ecef979f217446bf815c6cd4917..869c0345b908455ea34bcf7a3e5d92cdb208c63d 100644 (file)
@@ -14,8 +14,6 @@
 # Based on the ia64 and arm64 boot/Makefile.
 #
 
-KCOV_INSTRUMENT := n
-
 OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
 OBJCOPYFLAGS_loader.bin :=-O binary
 OBJCOPYFLAGS_xipImage :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
index 362208dfa7eec0c87e8dc89031f4aacb53fd506f..24e37d1ef7ec0f137d24ab83a9f2462a693d54e3 100644 (file)
@@ -34,12 +34,6 @@ obj-compat_vdso := $(addprefix $(obj)/, $(obj-compat_vdso))
 obj-y += compat_vdso.o
 CPPFLAGS_compat_vdso.lds += -P -C -DCOMPAT_VDSO -U$(ARCH)
 
-# Disable profiling and instrumentation for VDSO code
-GCOV_PROFILE := n
-KCOV_INSTRUMENT := n
-KASAN_SANITIZE := n
-UBSAN_SANITIZE := n
-
 # Force dependency
 $(obj)/compat_vdso.o: $(obj)/compat_vdso.so
 
index b75f150b923d68c189e5017a9ddf0f171d099687..50bc5ef7dd2fe53e0144eb7b20916b30c50601c3 100644 (file)
@@ -17,12 +17,6 @@ KBUILD_CFLAGS        += -mcmodel=medany
 CFLAGS_cmdline_early.o += -D__NO_FORTIFY
 CFLAGS_lib-fdt_ro.o += -D__NO_FORTIFY
 
-GCOV_PROFILE   := n
-KASAN_SANITIZE := n
-KCSAN_SANITIZE := n
-UBSAN_SANITIZE := n
-KCOV_INSTRUMENT        := n
-
 $(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \
                               --remove-section=.note.gnu.property \
                               --prefix-alloc-sections=.init.pi
index 25f0ee629971f708825d3ba11c93755b290371ef..f7ef8ad9b550d056458f519f8f3e3101e5ef4a4f 100644 (file)
@@ -39,12 +39,6 @@ endif
 CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS)
 CFLAGS_REMOVE_hwprobe.o = $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS)
 
-# Disable profiling and instrumentation for VDSO code
-GCOV_PROFILE := n
-KCOV_INSTRUMENT := n
-KASAN_SANITIZE := n
-UBSAN_SANITIZE := n
-
 # Force dependency
 $(obj)/vdso.o: $(obj)/vdso.so
 
index 280b0eb352b8b1025b29711451f828fd50ce7631..f11945ee24903123cb119076228881d12618c5bf 100644 (file)
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-OBJECT_FILES_NON_STANDARD := y
 
 purgatory-y := purgatory.o sha256.o entry.o string.o ctype.o memcpy.o memset.o
 purgatory-y += strcmp.o strlen.o strncmp.o
@@ -47,13 +46,6 @@ LDFLAGS_purgatory.ro := -r $(PURGATORY_LDFLAGS)
 LDFLAGS_purgatory.chk := $(PURGATORY_LDFLAGS)
 targets += purgatory.ro purgatory.chk
 
-# Sanitizer, etc. runtimes are unavailable and cannot be linked here.
-GCOV_PROFILE   := n
-KASAN_SANITIZE := n
-UBSAN_SANITIZE := n
-KCSAN_SANITIZE := n
-KCOV_INSTRUMENT := n
-
 # These are adjustments to the compiler flags used for objects that
 # make up the standalone purgatory.ro
 
index c263b91adfb1535d12e816f0f4d790417969e430..df928fee26b51ed65d78596784bf5db0c6d3f754 100644 (file)
@@ -1,8 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 # List of files in the vdso
 
-KCOV_INSTRUMENT := n
-
 # Include the generic Makefile to check the built vdso.
 include $(srctree)/lib/vdso/Makefile
 obj-vdso32 = vdso_user_wrapper-32.o note-32.o
@@ -32,12 +30,6 @@ obj-y += vdso32_wrapper.o
 targets += vdso32.lds
 CPPFLAGS_vdso32.lds += -P -C -U$(ARCH)
 
-# Disable gcov profiling, ubsan and kasan for VDSO code
-GCOV_PROFILE := n
-UBSAN_SANITIZE := n
-KASAN_SANITIZE := n
-KCSAN_SANITIZE := n
-
 # Force dependency (incbin is bad)
 $(obj)/vdso32_wrapper.o : $(obj)/vdso32.so
 
index 9566bed7d5b28ab6f290862ce8b6ced66f582892..6da1b9ad8ab0c7a43d676d50588001e09db2f3c9 100644 (file)
@@ -1,8 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 # List of files in the vdso
 
-KCOV_INSTRUMENT := n
-
 # Include the generic Makefile to check the built vdso.
 include $(srctree)/lib/vdso/Makefile
 obj-vdso64 = vdso_user_wrapper.o note.o
@@ -37,12 +35,6 @@ 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
-KCSAN_SANITIZE := n
-
 # Force dependency (incbin is bad)
 $(obj)/vdso64_wrapper.o : $(obj)/vdso64.so
 
index 4e930f56687899f2cc18e38b07adc7fbd98e0d25..24eccaa293371b0dc693f8b6d854f0c8ff70708c 100644 (file)
@@ -1,7 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 
-OBJECT_FILES_NON_STANDARD := y
-
 purgatory-y := head.o purgatory.o string.o sha256.o mem.o
 
 targets += $(purgatory-y) purgatory.lds purgatory purgatory.chk purgatory.ro
@@ -15,12 +13,6 @@ CFLAGS_sha256.o := -D__DISABLE_EXPORTS -D__NO_FORTIFY
 $(obj)/mem.o: $(srctree)/arch/s390/lib/mem.S FORCE
        $(call if_changed_rule,as_o_S)
 
-KCOV_INSTRUMENT := n
-GCOV_PROFILE := n
-UBSAN_SANITIZE := n
-KASAN_SANITIZE := n
-KCSAN_SANITIZE := n
-
 KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
 KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
 KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
index 6c6c791a1d0630e24f7a8c0f0dfa527681508f89..3a46b871463d5584e8d3c280672c75dab3f16ed0 100644 (file)
@@ -11,9 +11,6 @@ OBJECTS := head_32.o misc.o cache.o piggy.o \
 targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
            vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo $(OBJECTS)
 
-GCOV_PROFILE := n
-UBSAN_SANITIZE := n
-
 #
 # IMAGE_OFFSET is the load offset of the compression loader
 #
index 0fe134abbcf175cec94f1161c2c7cb3d65062808..243dbfc4609d804fc221c3591eebe891107ffdab 100644 (file)
@@ -2,7 +2,6 @@
 #
 # Building vDSO images for sparc.
 #
-UBSAN_SANITIZE := n
 
 # files to link into the vdso
 vobjs-y := vdso-note.o vclock_gettime.o
@@ -106,4 +105,3 @@ quiet_cmd_vdso = VDSO    $@
                sh $(src)/checkundef.sh '$(OBJDUMP)' '$@'
 
 VDSO_LDFLAGS = -shared --hash-style=both --build-id=sha1 -Bsymbolic
-GCOV_PROFILE := n
index 29cda98c65f8ba1d44f075b5ed18b8c5b642f95e..1cf24ff6acac024aaed08118711991779d5bd867 100644 (file)
@@ -9,19 +9,6 @@
 # Changed by many, many contributors over the years.
 #
 
-# Sanitizer runtimes are unavailable and cannot be linked for early boot code.
-KASAN_SANITIZE                 := n
-KCSAN_SANITIZE                 := n
-KMSAN_SANITIZE                 := n
-OBJECT_FILES_NON_STANDARD      := y
-
-# Kernel does not boot with kcov instrumentation here.
-# One of the problems observed was insertion of __sanitizer_cov_trace_pc()
-# callback into middle of per-cpu data enabling code. Thus the callback observed
-# inconsistent state and crashed. We are interested mostly in syscall coverage,
-# so boot code is not interesting anyway.
-KCOV_INSTRUMENT                := n
-
 # If you want to preset the SVGA mode, uncomment the next line and
 # set SVGA_MODE to whatever number you want.
 # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
@@ -69,8 +56,6 @@ KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP
 KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
 KBUILD_CFLAGS  += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
 KBUILD_CFLAGS  += -fno-asynchronous-unwind-tables
-GCOV_PROFILE := n
-UBSAN_SANITIZE := n
 
 $(obj)/bzImage: asflags-y  := $(SVGA_MODE)
 
index e9522c6893bee0ea678f146b2067ea20a712bff2..243ee86cb1b1efe45de61fedc9747fe699bd7cac 100644 (file)
 #      (see scripts/Makefile.lib size_append)
 #      compressed vmlinux.bin.all + u32 size of vmlinux.bin.all
 
-# Sanitizer runtimes are unavailable and cannot be linked for early boot code.
-KASAN_SANITIZE                 := n
-KCSAN_SANITIZE                 := n
-KMSAN_SANITIZE                 := n
-OBJECT_FILES_NON_STANDARD      := y
-
-# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
-KCOV_INSTRUMENT                := n
-
 targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
        vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4 vmlinux.bin.zst
 
@@ -59,8 +50,6 @@ KBUILD_CFLAGS += -include $(srctree)/include/linux/hidden.h
 CFLAGS_sev.o += -I$(objtree)/arch/x86/lib/
 
 KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
-GCOV_PROFILE := n
-UBSAN_SANITIZE :=n
 
 KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
 KBUILD_LDFLAGS += $(call ld-option,--no-ld-generated-unwind-info)
index c003452dba8c5509510dec5bd567ce1061ee966e..215a1b202a9180785a4d8d8c1d8d8e469145e5e5 100644 (file)
@@ -6,20 +6,6 @@
 # Include the generic Makefile to check the built vDSO:
 include $(srctree)/lib/vdso/Makefile
 
-# Sanitizer runtimes are unavailable and cannot be linked here.
-KASAN_SANITIZE                 := n
-KMSAN_SANITIZE_vclock_gettime.o := n
-KMSAN_SANITIZE_vdso32/vclock_gettime.o := n
-KMSAN_SANITIZE_vgetcpu.o       := n
-KMSAN_SANITIZE_vdso32/vgetcpu.o        := n
-
-UBSAN_SANITIZE                 := n
-KCSAN_SANITIZE                 := n
-OBJECT_FILES_NON_STANDARD      := y
-
-# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
-KCOV_INSTRUMENT                := n
-
 # Files to link into the vDSO:
 vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o
 vobjs32-y := vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o
@@ -28,23 +14,12 @@ vobjs-$(CONFIG_X86_SGX)     += vsgx.o
 
 # Files to link into the kernel:
 obj-y                                          += vma.o extable.o
-KASAN_SANITIZE_vma.o                           := y
-UBSAN_SANITIZE_vma.o                           := y
-KCSAN_SANITIZE_vma.o                           := y
-
-OBJECT_FILES_NON_STANDARD_vma.o                        := n
-OBJECT_FILES_NON_STANDARD_extable.o            := n
 
 # vDSO images to build:
 obj-$(CONFIG_X86_64)                           += vdso-image-64.o
 obj-$(CONFIG_X86_X32_ABI)                      += vdso-image-x32.o
 obj-$(CONFIG_COMPAT_32)                                += vdso-image-32.o vdso32-setup.o
 
-OBJECT_FILES_NON_STANDARD_vdso-image-32.o      := n
-OBJECT_FILES_NON_STANDARD_vdso-image-x32.o     := n
-OBJECT_FILES_NON_STANDARD_vdso-image-64.o      := n
-OBJECT_FILES_NON_STANDARD_vdso32-setup.o       := n
-
 vobjs := $(addprefix $(obj)/, $(vobjs-y))
 vobjs32 := $(addprefix $(obj)/, $(vobjs32-y))
 
@@ -180,7 +155,6 @@ quiet_cmd_vdso = VDSO    $@
 
 VDSO_LDFLAGS = -shared --hash-style=both --build-id=sha1 \
        $(call ld-option, --eh-frame-hdr) -Bsymbolic -z noexecstack
-GCOV_PROFILE := n
 
 quiet_cmd_vdso_and_check = VDSO    $@
       cmd_vdso_and_check = $(cmd_vdso); $(cmd_vdso_check)
index bc31863c5ee6389419cc24250f56d4b89e8ec0e4..0a16f1373cf5f7c7ea0ace7aa495f3ec7372fe3e 100644 (file)
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-OBJECT_FILES_NON_STANDARD := y
 
 purgatory-y := purgatory.o stack.o setup-x86_$(BITS).o sha256.o entry64.o string.o
 
@@ -30,14 +29,6 @@ LDFLAGS_purgatory.ro := -r $(PURGATORY_LDFLAGS)
 LDFLAGS_purgatory.chk := $(PURGATORY_LDFLAGS)
 targets += purgatory.ro purgatory.chk
 
-# Sanitizer, etc. runtimes are unavailable and cannot be linked here.
-GCOV_PROFILE   := n
-KASAN_SANITIZE := n
-UBSAN_SANITIZE := n
-KCSAN_SANITIZE := n
-KMSAN_SANITIZE := n
-KCOV_INSTRUMENT := n
-
 # These are adjustments to the compiler flags used for objects that
 # make up the standalone purgatory.ro
 
index f614009d3e4e2eb944862bacb260b0da088f5c0a..a0fb39abc5c8698946d1c8b30dc562271063d76f 100644 (file)
@@ -7,15 +7,6 @@
 #
 #
 
-# Sanitizer runtimes are unavailable and cannot be linked here.
-KASAN_SANITIZE                 := n
-KCSAN_SANITIZE                 := n
-KMSAN_SANITIZE                 := n
-OBJECT_FILES_NON_STANDARD      := y
-
-# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
-KCOV_INSTRUMENT                := n
-
 always-y := realmode.bin realmode.relocs
 
 wakeup-objs    := wakeup_asm.o wakemain.o video-mode.o
@@ -76,5 +67,3 @@ KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
                   -I$(srctree)/arch/x86/boot
 KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
 KBUILD_CFLAGS  += -fno-asynchronous-unwind-tables
-GCOV_PROFILE := n
-UBSAN_SANITIZE := n
index 2303fa59971ceb773bb22a7063d865e36464b884..6a77ea6434ffde178d07b4466ec18ca83718baae 100644 (file)
@@ -3,12 +3,6 @@
 # Building vDSO images for x86.
 #
 
-# do not instrument on vdso because KASAN is not compatible with user mode
-KASAN_SANITIZE                 := n
-
-# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
-KCOV_INSTRUMENT                := n
-
 VDSO64-y               := y
 
 vdso-install-$(VDSO64-y)       += vdso.so
@@ -66,4 +60,3 @@ quiet_cmd_vdso = VDSO    $@
                 sh $(src)/checkundef.sh '$(NM)' '$@'
 
 VDSO_LDFLAGS = -fPIC -shared -Wl,--hash-style=sysv -z noexecstack
-GCOV_PROFILE := n
index 31eb1e287ce161a60da72da1b4ca30c683dec051..06f0428a723cb8f6be287a81600cd49b40fb3341 100644 (file)
@@ -56,17 +56,6 @@ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_CFI), $(KBUILD_CFLAGS))
 # disable LTO
 KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS))
 
-GCOV_PROFILE                   := n
-# Sanitizer runtimes are unavailable and cannot be linked here.
-KASAN_SANITIZE                 := n
-KCSAN_SANITIZE                 := n
-KMSAN_SANITIZE                 := n
-UBSAN_SANITIZE                 := n
-OBJECT_FILES_NON_STANDARD      := y
-
-# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
-KCOV_INSTRUMENT                        := n
-
 lib-y                          := efi-stub-helper.o gop.o secureboot.o tpm.o \
                                   file.o mem.o random.o randomalloc.o pci.o \
                                   skip_spaces.o lib-cmdline.o lib-ctype.o \
index 95ef971b5e1cb4ce836fa0d2286ee2d81e28d8ce..33fe61152a158607f2174860f557553fc1038a20 100644 (file)
@@ -15,10 +15,6 @@ lkdtm-$(CONFIG_PPC_64S_HASH_MMU)     += powerpc.o
 
 KASAN_SANITIZE_stackleak.o     := n
 
-KASAN_SANITIZE_rodata.o                        := n
-KCSAN_SANITIZE_rodata.o                        := n
-KCOV_INSTRUMENT_rodata.o               := n
-OBJECT_FILES_NON_STANDARD_rodata.o     := y
 CFLAGS_REMOVE_rodata.o                 += $(CC_FLAGS_LTO) $(RETHUNK_CFLAGS)
 
 OBJCOPYFLAGS :=
index 3c48d97538c10e8d8d493d0d6cac63ccc4dba8c5..ab71cedc5fd6562f832e94b757cad43da9cc9cf9 100644 (file)
@@ -59,6 +59,3 @@ include/generated/utsversion.h: FORCE
 
 $(obj)/version-timestamp.o: include/generated/utsversion.h
 CFLAGS_version-timestamp.o := -include include/generated/utsversion.h
-KASAN_SANITIZE_version-timestamp.o := n
-KCSAN_SANITIZE_version-timestamp.o := n
-GCOV_PROFILE_version-timestamp.o := n
index c9f3e03124d7f59939eca7aa8a1145e658f4abca..49946cb968440c6fecd63b8076e1a46a87d80aee 100644 (file)
@@ -18,9 +18,6 @@ quiet_cmd_cc_o_c = CC      $@
        $(call if_changed_dep,cc_o_c)
 
 ifdef CONFIG_MODULES
-KASAN_SANITIZE_.vmlinux.export.o := n
-KCSAN_SANITIZE_.vmlinux.export.o := n
-GCOV_PROFILE_.vmlinux.export.o := n
 targets += .vmlinux.export.o
 vmlinux: .vmlinux.export.o
 endif
index 3c54125eb373340745cd6e1784b5522b80679d15..c729bc936bae14535798503b94e25b3f09188f56 100644 (file)
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-OBJECT_FILES_NON_STANDARD := y
 CFLAGS_REMOVE_empty.o += $(CC_FLAGS_LTO)
 
 hostprogs-always-y     += modpost mk_elfconfig