Mon Mar 9 05:10:19 2020 UTC ()
Restrict LOCKDEBUG support to archs with REALCRASH.
Fix build failure for other archs.


(rin)
diff -r1.43 -r1.44 src/usr.sbin/crash/Makefile

cvs diff -r1.43 -r1.44 src/usr.sbin/crash/Makefile (switch to unified diff)

--- src/usr.sbin/crash/Makefile 2020/03/09 01:54:31 1.43
+++ src/usr.sbin/crash/Makefile 2020/03/09 05:10:19 1.44
@@ -1,125 +1,125 @@ @@ -1,125 +1,125 @@
1# $NetBSD: Makefile,v 1.43 2020/03/09 01:54:31 christos Exp $ 1# $NetBSD: Makefile,v 1.44 2020/03/09 05:10:19 rin Exp $
2 2
3PROG= crash 3PROG= crash
4MAN= crash.8 4MAN= crash.8
5RUMPKERNEL= yes # XXX: Avoid -mcmodel=kernel 5RUMPKERNEL= yes # XXX: Avoid -mcmodel=kernel
6 6
7CWARNFLAGS.clang+= -Wno-format 7CWARNFLAGS.clang+= -Wno-format
8 8
9LDADD+= -lutil -lkvm -ledit -lterminfo 9LDADD+= -lutil -lkvm -ledit -lterminfo
10DPADD+= ${LIBUTIL} ${LIBKVM} ${LIBEDIT} ${LIBTERMINFO} 10DPADD+= ${LIBUTIL} ${LIBKVM} ${LIBEDIT} ${LIBTERMINFO}
11 11
12.include <bsd.own.mk> 12.include <bsd.own.mk>
13 13
14# some ddb kernel components need limited modifications. for now, 14# some ddb kernel components need limited modifications. for now,
15# punt if not noted as implemented here. 15# punt if not noted as implemented here.
16.if ${MACHINE} == "amd64" \ 16.if ${MACHINE} == "amd64" \
17 || ${MACHINE} == "hppa" \ 17 || ${MACHINE} == "hppa" \
18 || ${MACHINE} == "i386" \ 18 || ${MACHINE} == "i386" \
19 || ${MACHINE} == "sparc" \ 19 || ${MACHINE} == "sparc" \
20 || ${MACHINE} == "sparc64" \ 20 || ${MACHINE} == "sparc64" \
21 || ${MACHINE_CPU} == "arm" \ 21 || ${MACHINE_CPU} == "arm" \
22 || ${MACHINE_CPU} == "aarch64" \ 22 || ${MACHINE_CPU} == "aarch64" \
23 || ${MACHINE_ARCH} == "m68k" 23 || ${MACHINE_ARCH} == "m68k"
24SRCS+= db_trace.c 24SRCS+= db_trace.c
25.if ${MACHINE_ARCH} != "m68k" 25.if ${MACHINE_ARCH} != "m68k"
26SRCS+= db_machdep.c 26SRCS+= db_machdep.c
27.endif 27.endif
28REALCRASH=yes 28REALCRASH=yes
29.else 29.else
30REALCRASH=no 30REALCRASH=no
31.endif 31.endif
32 32
33CPPFLAGS +=-DLOCKDEBUG 
34CPPFLAGS.subr_lockdebug.c += -DCRASH -DDDB 
35SRCS += subr_lockdebug.c 
36 
37.if ${REALCRASH} != "no" # { 33.if ${REALCRASH} != "no" # {
38 34
39S= ${.CURDIR}/../../sys 35S= ${.CURDIR}/../../sys
40 36
41CPPFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing 37CPPFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${S} -fno-strict-aliasing
42CPPFLAGS+= -DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER 38CPPFLAGS+= -DDDB_VERBOSE_HELP -DDB_MAX_LINE=10000000 -D_KMEMUSER
43CPPFLAGS+= -UDB_MACHINE_COMMANDS 39CPPFLAGS+= -UDB_MACHINE_COMMANDS
44 40
45# ddb files from kernel 41# ddb files from kernel
46.PATH: $S/ddb 42.PATH: $S/ddb
47SRCS+= db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c 43SRCS+= db_command.c db_lwp.c db_proc.c db_xxx.c db_cpu.c
48SRCS+= db_autoconf.c 44SRCS+= db_autoconf.c
49SRCS+= db_access.c db_elf.c db_examine.c 45SRCS+= db_access.c db_elf.c db_examine.c
50SRCS+= db_expr.c db_lex.c db_output.c db_print.c 46SRCS+= db_expr.c db_lex.c db_output.c db_print.c
51SRCS+= db_sym.c db_variables.c db_write_cmd.c 47SRCS+= db_sym.c db_variables.c db_write_cmd.c
52 48
53.PATH: ${S}/arch/${MACHINE}/${MACHINE} 49.PATH: ${S}/arch/${MACHINE}/${MACHINE}
54.PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} 50.PATH: ${S}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
55SRCS+= db_disasm.c 51SRCS+= db_disasm.c
56 52
57.PATH: $S/kern 53.PATH: $S/kern
58SRCS+= kern_timeout.c 54SRCS+= kern_timeout.c
59CPPFLAGS.kern_timeout.c += -DCRASH -DDDB 55CPPFLAGS.kern_timeout.c += -DCRASH -DDDB
60 56
 57CPPFLAGS +=-DLOCKDEBUG
 58SRCS += subr_lockdebug.c
 59CPPFLAGS.subr_lockdebug.c += -DCRASH -DDDB
 60
61CPPFLAGS+= -I${S}/arch 61CPPFLAGS+= -I${S}/arch
62 62
63. if ${MACHINE} == "amd64" \ 63. if ${MACHINE} == "amd64" \
64 || ${MACHINE} == "i386" 64 || ${MACHINE} == "i386"
65MACHINE_FAMILY = x86 65MACHINE_FAMILY = x86
66. elif ${MACHINE} == "sparc64" 66. elif ${MACHINE} == "sparc64"
67MACHINE_FAMILY = sparc 67MACHINE_FAMILY = sparc
68. else 68. else
69MACHINE_FAMILY = ${MACHINE_CPU} 69MACHINE_FAMILY = ${MACHINE_CPU}
70. endif 70. endif
71 71
72.if ${MACHINE_CPU} == "arm" 72.if ${MACHINE_CPU} == "arm"
73.PATH: ${S}/arch/arm/arm32 73.PATH: ${S}/arch/arm/arm32
74SRCS+=disassem.c cpufunc_asm.S 74SRCS+=disassem.c cpufunc_asm.S
75.endif 75.endif
76.if ${MACHINE_CPU} == "aarch64" 76.if ${MACHINE_CPU} == "aarch64"
77SRCS+=disasm.c 77SRCS+=disasm.c
78.endif 78.endif
79 79
80.PATH: ${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY} 80.PATH: ${S}/arch/${MACHINE_FAMILY}/${MACHINE_FAMILY}
81 81
82# crash main source 82# crash main source
83SRCS+= crash.c 83SRCS+= crash.c
84 84
85# arch.c 85# arch.c
86.PATH: ${.CURDIR}/arch 86.PATH: ${.CURDIR}/arch
87. if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c)) 87. if (exists(${.CURDIR}/arch/${MACHINE_FAMILY}.c))
88SRCS+= ${MACHINE_FAMILY}.c 88SRCS+= ${MACHINE_FAMILY}.c
89. else 89. else
90SRCS+= generic.c 90SRCS+= generic.c
91. endif 91. endif
92 92
93COPTS.db_output.c += -Wno-format-nonliteral 93COPTS.db_output.c += -Wno-format-nonliteral
94 94
95.if ${MKREPRO} == "yes" 95.if ${MKREPRO} == "yes"
96. if ${MKREPRO_TIMESTAMP:U0} != 0 96. if ${MKREPRO_TIMESTAMP:U0} != 0
97NVFLAGS+=-r ${MKREPRO_TIMESTAMP} 97NVFLAGS+=-r ${MKREPRO_TIMESTAMP}
98. else 98. else
99NVFLAGS+=-R 99NVFLAGS+=-R
100. endif 100. endif
101.endif 101.endif
102 102
103# vers.c 103# vers.c
104SRCS+= vers.c 104SRCS+= vers.c
105vers.c: ${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS} 105vers.c: ${S}/conf/newvers.sh ${_NETBSD_VERSION_DEPENDS}
106 ${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH 106 ${HOST_SH} ${S}/conf/newvers.sh ${NVFLAGS} -n -m ${MACHINE} -i CRASH
107CLEANFILES+= vers.c version 107CLEANFILES+= vers.c version
108 108
109.else # } { 109.else # } {
110 110
111SRCS+= unsupported.c 111SRCS+= unsupported.c
112 112
113.endif # } 113.endif # }
114 114
115.if ${MACHINE} == "sparc" \ 115.if ${MACHINE} == "sparc" \
116 || ${MACHINE} == "sparc64" 116 || ${MACHINE} == "sparc64"
117COPTS.kern_timeout.c += -Wno-stack-protector 117COPTS.kern_timeout.c += -Wno-stack-protector
118.endif 118.endif
119 119
120.include "../../compat/exec.mk" 120.include "../../compat/exec.mk"
121 121
122COPTS.db_command.c+= ${GCC_NO_CAST_FUNCTION_TYPE} 122COPTS.db_command.c+= ${GCC_NO_CAST_FUNCTION_TYPE}
123 123
124.include <bsd.prog.mk> 124.include <bsd.prog.mk>
125.include <bsd.klinks.mk> 125.include <bsd.klinks.mk>