Skip to contentSkip to conversation

MIPS: disable kcov instrumentation in compressed dir

PATCH In review Denis Efremov 2 participants 2 messages Dec 10, 2019 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: disable kcov instrumentation in compressed dir

This patch fixes the compilation with CONFIG_KCOV enabled. Otherwise linking fails with:
ld: arch/mips/boot/compressed/piggy.o: in function `main':
dummy.c:(.text.startup+0x8): undefined reference to `__sanitizer_cov_...' make[1]: *** [arch/mips/boot/compressed/Makefile:101: vmlinuz] Error 1

---
 arch/mips/boot/compressed/Makefile | 3 +++
 1 file changed, 3 insertions(+)
arch/mips/boot/compressed/Makefile +3 -0
index 172801ed35b8..d859f079b771 100644
@@ -29,6 +29,9 @@ 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
+
 # decompressor objects (linked with vmlinuz)
 vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
 
Signature · 1 line
2.20.1
#1 lore raw

Hi Denis,

Quoted 10 lines · Denis Efremov

This patch fixes the compilation with CONFIG_KCOV enabled. Otherwise linking fails with:
ld: arch/mips/boot/compressed/piggy.o: in function `main':
dummy.c:(.text.startup+0x8): undefined reference to `__sanitizer_cov_...' make[1]: *** [arch/mips/boot/compressed/Makefile:101: vmlinuz] Error 1

---
 arch/mips/boot/compressed/Makefile | 3 +++
 1 file changed, 3 insertions(+)

This one's identical to this patch which was merged to mips-fixes yesterday:

    https://git.kernel.org/mips/c/3f0a2abff9aa

Thanks,
Paul

Quoted 17 lines
arch/mips/boot/compressed/Makefile +3 -0
index 172801ed35b8..d859f079b771 100644
@@ -29,6 +29,9 @@ 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
+
 # decompressor objects (linked with vmlinuz)
 vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
 
Signature · 1 line
2.20.1