summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2018-08-21 18:06:13 +0000
committeranton <anton@cvs.openbsd.org>2018-08-21 18:06:13 +0000
commit99c399cad12f62c274b3f060a6788f7df981dc20 (patch)
treed102b7ed811c03f0adde28e95e85903ffce3641d /sys/arch
parent5ab1acecaf16af3119453abea9ddd7ce87a287ce (diff)
Rework kcov kernel config. Instead of treating kcov as both an option and a
pseudo-device, get rid of the option. Enabling kcov now requires the following line to be added to the kernel config: pseudo-device kcov 1 This is how pseudo devices are enabled in general. A side-effect of this change is that dev/kcov.c will no longer be compiled by default. Prodded by deraadt@; ok mpi@ visa@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/conf/GENERIC5
-rw-r--r--sys/arch/amd64/conf/Makefile.amd6413
-rw-r--r--sys/arch/amd64/conf/files.amd648
-rw-r--r--sys/arch/i386/conf/GENERIC5
-rw-r--r--sys/arch/i386/conf/Makefile.i38611
-rw-r--r--sys/arch/i386/conf/files.i3868
6 files changed, 17 insertions, 33 deletions
diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC
index d3b593f71f4..dc1f1d4f6e9 100644
--- a/sys/arch/amd64/conf/GENERIC
+++ b/sys/arch/amd64/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.458 2018/08/19 11:42:33 anton Exp $
+# $OpenBSD: GENERIC,v 1.459 2018/08/21 18:06:12 anton Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -658,9 +658,6 @@ pseudo-device hotplug 1 # devices hot plugging
# mouse & keyboard multiplexor pseudo-devices
pseudo-device wsmux 2
-# kernel code coverage
-pseudo-device kcov 1
-
# Virtio devices
virtio* at pci? # Virtio PCI device
vioblk* at virtio? # Virtio block device
diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64
index e1ce1d7b410..bd1d63d12c5 100644
--- a/sys/arch/amd64/conf/Makefile.amd64
+++ b/sys/arch/amd64/conf/Makefile.amd64
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.amd64,v 1.100 2018/08/19 18:09:49 deraadt Exp $
+# $OpenBSD: Makefile.amd64,v 1.101 2018/08/21 18:06:12 anton Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -43,10 +43,6 @@ SORTR= cat
.else
CMACHFLAGS+= -mretpoline
.endif
-.if ${IDENT:M-DKCOV} && ${COMPILER_VERSION:Mclang}
-CMACHFLAGS+= -fno-ret-protector
-PROF= -fsanitize-coverage=trace-pc
-.endif
.if ${COMPILER_VERSION:Mclang}
NO_INTEGR_AS= -no-integrated-as
.endif
@@ -97,6 +93,11 @@ SYSTEM_LD_TAIL+=; umask 007; \
LINKFLAGS+= -S
.endif
+.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
+CMACHFLAGS+= -fno-ret-protector
+PROF= -fsanitize-coverage=trace-pc
+.endif
+
%LOAD
# cc's -MD puts the source and output paths in the dependency file;
@@ -139,7 +140,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-.if ${IDENT:M-DKCOV} && ${COMPILER_VERSION:Mclang}
+.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
kcov.o: $S/dev/kcov.c
${NORMAL_C} -fno-sanitize-coverage=trace-pc
.endif
diff --git a/sys/arch/amd64/conf/files.amd64 b/sys/arch/amd64/conf/files.amd64
index b876aa897f4..fe34441c442 100644
--- a/sys/arch/amd64/conf/files.amd64
+++ b/sys/arch/amd64/conf/files.amd64
@@ -1,4 +1,4 @@
-# $OpenBSD: files.amd64,v 1.99 2018/08/19 18:01:05 deraadt Exp $
+# $OpenBSD: files.amd64,v 1.100 2018/08/21 18:06:12 anton Exp $
maxpartitions 16
maxusers 2 16 128
@@ -245,12 +245,6 @@ file arch/amd64/amd64/vmm.c vmm needs-flag
file arch/amd64/amd64/vmm_support.S vmm
#
-# KCOV
-#
-pseudo-device kcov
-file dev/kcov.c kcov needs-flag
-
-#
# Machine-independent SD/MMC drivers
#
include "dev/sdmmc/files.sdmmc"
diff --git a/sys/arch/i386/conf/GENERIC b/sys/arch/i386/conf/GENERIC
index 494d6e00d21..f1cb367391a 100644
--- a/sys/arch/i386/conf/GENERIC
+++ b/sys/arch/i386/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.834 2018/08/19 11:42:33 anton Exp $
+# $OpenBSD: GENERIC,v 1.835 2018/08/21 18:06:12 anton Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -764,9 +764,6 @@ pseudo-device hotplug 1 # devices hot plugging
# mouse & keyboard multiplexor pseudo-devices
pseudo-device wsmux 2
-# kernel code coverage
-pseudo-device kcov 1
-
# Virtio devices
virtio* at pci? # Virtio PCI device
vioblk* at virtio? # Virtio block device
diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386
index 7ca4991f1f6..18b7a98e80d 100644
--- a/sys/arch/i386/conf/Makefile.i386
+++ b/sys/arch/i386/conf/Makefile.i386
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.i386,v 1.125 2018/08/19 11:42:33 anton Exp $
+# $OpenBSD: Makefile.i386,v 1.126 2018/08/21 18:06:12 anton Exp $
# For instructions on building kernels consult the config(8) and options(4)
# manual pages.
@@ -39,9 +39,6 @@ SORTR= cat
.else
CMACHFLAGS+= -mretpoline
.endif
-.if ${IDENT:M-DKCOV} && ${COMPILER_VERSION:Mclang}
-PROF= -fsanitize-coverage=trace-pc
-.endif
.if ${COMPILER_VERSION:Mclang}
NO_INTEGR_AS= -no-integrated-as
.endif
@@ -99,6 +96,10 @@ SYSTEM_LD_TAIL+=; umask 007; \
LINKFLAGS+= -S
.endif
+.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
+PROF= -fsanitize-coverage=trace-pc
+.endif
+
%LOAD
# cc's -MD puts the source and output paths in the dependency file;
@@ -141,7 +142,7 @@ vers.o: ${SYSTEM_DEP:Ngap.o}
sh $S/conf/newvers.sh
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
-.if ${IDENT:M-DKCOV} && ${COMPILER_VERSION:Mclang}
+.if ${SYSTEM_OBJ:Mkcov.o} && ${COMPILER_VERSION:Mclang}
kcov.o: $S/dev/kcov.c
${NORMAL_C} -fno-sanitize-coverage=trace-pc
.endif
diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386
index f70d8d3a6d2..ccc0b1206bc 100644
--- a/sys/arch/i386/conf/files.i386
+++ b/sys/arch/i386/conf/files.i386
@@ -1,4 +1,4 @@
-# $OpenBSD: files.i386,v 1.241 2018/08/19 18:01:05 deraadt Exp $
+# $OpenBSD: files.i386,v 1.242 2018/08/21 18:06:12 anton Exp $
#
# new style config file for i386 architecture
#
@@ -399,12 +399,6 @@ file arch/i386/i386/vmm.c vmm needs-flag
file arch/i386/i386/vmm_support.S vmm
#
-# KCOV
-#
-pseudo-device kcov
-file dev/kcov.c kcov needs-flag
-
-#
# IPMI
#
attach ipmi at mainbus