Mon Mar 9 00:03:00 2020 UTC ()
Build RUMP with -fno-delete-null-pointer-checks on all compilers

no-delete-null-pointer-checks is required in Clang/LLVM at least for
NULL + 0 operations that trigger LLVM UBSan and could be miscompiled.


(kamil)
diff -r1.125 -r1.126 src/sys/rump/Makefile.rump

cvs diff -r1.125 -r1.126 src/sys/rump/Makefile.rump (switch to unified diff)

--- src/sys/rump/Makefile.rump 2020/02/20 22:52:10 1.125
+++ src/sys/rump/Makefile.rump 2020/03/09 00:03:00 1.126
@@ -1,260 +1,262 @@ @@ -1,260 +1,262 @@
1# $NetBSD: Makefile.rump,v 1.125 2020/02/20 22:52:10 joerg Exp $ 1# $NetBSD: Makefile.rump,v 1.126 2020/03/09 00:03:00 kamil Exp $
2# 2#
3 3
4.if !defined(_RUMP_MK) 4.if !defined(_RUMP_MK)
5_RUMP_MK= #defined 5_RUMP_MK= #defined
6 6
7WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet 7WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet
8NOLINT= # kernel code 8NOLINT= # kernel code
9 9
10.include <bsd.own.mk> 10.include <bsd.own.mk>
11 11
12# Use NetBSD kernel ABI by default on x86 archs. Performance-related 12# Use NetBSD kernel ABI by default on x86 archs. Performance-related
13# compile-time options may override this at a later date. 13# compile-time options may override this at a later date.
14.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") 14.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64")
15_RUMP_NATIVEABI= yes 15_RUMP_NATIVEABI= yes
16.else 16.else
17_RUMP_NATIVEABI= no 17_RUMP_NATIVEABI= no
18CPPFLAGS:= -I${RUMPTOP}/include ${CPPFLAGS} 18CPPFLAGS:= -I${RUMPTOP}/include ${CPPFLAGS}
19CPPFLAGS+= -D_RUMPKERNEL -I${RUMPTOP}/librump/rumpkern 19CPPFLAGS+= -D_RUMPKERNEL -I${RUMPTOP}/librump/rumpkern
20.endif 20.endif
21 21
22# We are compiling the kernel code with no-delete-null-pointer-checks, 22# We are compiling the kernel code with no-delete-null-pointer-checks,
23# and compiling without it, causes issues at least on sh3 by adding 23# and compiling without it, causes issues at least on sh3 by adding
24# aborts after kern_assert on NULL pointer checks. 24# aborts after kern_assert on NULL pointer checks.
25CFLAGS+= ${${ACTIVE_CC} == "gcc":? -fno-delete-null-pointer-checks :} 25# no-delete-null-pointer-checks is required in Clang/LLVM at least for
 26# NULL + 0 operations that trigger LLVM UBSan and could be miscompiled.
 27CFLAGS+= -fno-delete-null-pointer-checks
26 28
27# Define baseline cpu for mips ports, required for 29# Define baseline cpu for mips ports, required for
28# rumpcomp_sync_icache() hypercall. 30# rumpcomp_sync_icache() hypercall.
29.if !empty(MACHINE_ARCH:Mmips*) 31.if !empty(MACHINE_ARCH:Mmips*)
30.if !empty(MACHINE_ARCH:Mmips64*) 32.if !empty(MACHINE_ARCH:Mmips64*)
31CPPFLAGS+= -DMIPS64=1 33CPPFLAGS+= -DMIPS64=1
32.else 34.else
33CPPFLAGS+= -DMIPS1=1 35CPPFLAGS+= -DMIPS1=1
34.endif 36.endif
35.endif 37.endif
36 38
37# which NetBSD compat to build 39# which NetBSD compat to build
38RUMP_NBCOMPAT?=default 40RUMP_NBCOMPAT?=default
39.if ${RUMP_NBCOMPAT} == "all" || ${RUMP_NBCOMPAT} == "default" 41.if ${RUMP_NBCOMPAT} == "all" || ${RUMP_NBCOMPAT} == "default"
40RUMP_NBCOMPAT= 50 60 70 80 42RUMP_NBCOMPAT= 50 60 70 80
41.endif 43.endif
42.if ${RUMP_NBCOMPAT} == "none" 44.if ${RUMP_NBCOMPAT} == "none"
43RUMP_NBCOMPAT= 45RUMP_NBCOMPAT=
44.endif 46.endif
45RUMP_NBCOMPAT:= ${RUMP_NBCOMPAT:S/,/ /g} 47RUMP_NBCOMPAT:= ${RUMP_NBCOMPAT:S/,/ /g}
46CPPFLAGS+= ${RUMP_NBCOMPAT:C/[1-9]0/-DCOMPAT_&/g} 48CPPFLAGS+= ${RUMP_NBCOMPAT:C/[1-9]0/-DCOMPAT_&/g}
47 49
48CPPFLAGS+= -nostdinc 50CPPFLAGS+= -nostdinc
49CFLAGS+= -ffreestanding -fno-strict-aliasing 51CFLAGS+= -ffreestanding -fno-strict-aliasing
50 52
51CWARNFLAGS+= -Wno-format-zero-length -Wno-pointer-sign 53CWARNFLAGS+= -Wno-format-zero-length -Wno-pointer-sign
52 54
53CPPFLAGS+= -imacros ${RUMPTOP}/include/opt/opt_rumpkernel.h 55CPPFLAGS+= -imacros ${RUMPTOP}/include/opt/opt_rumpkernel.h
54.ifdef BUILDRUMP_IMACROS 56.ifdef BUILDRUMP_IMACROS
55CPPFLAGS+= -imacros ${BUILDRUMP_IMACROS} 57CPPFLAGS+= -imacros ${BUILDRUMP_IMACROS}
56.endif 58.endif
57 59
58CPPFLAGS+= -I${.CURDIR} -I. 60CPPFLAGS+= -I${.CURDIR} -I.
59CPPFLAGS+= -I${RUMPTOP}/../../common/include 61CPPFLAGS+= -I${RUMPTOP}/../../common/include
60CPPFLAGS+= -I${RUMPTOP}/include 62CPPFLAGS+= -I${RUMPTOP}/include
61CPPFLAGS+= -I${RUMPTOP}/include/opt 63CPPFLAGS+= -I${RUMPTOP}/include/opt
62 64
63SHLIB_MAJOR?= 0 65SHLIB_MAJOR?= 0
64SHLIB_MINOR?= 0 66SHLIB_MINOR?= 0
65 67
66.ifdef NEED_ISYSTEM 68.ifdef NEED_ISYSTEM
67CPPFLAGS+= -isystem ${RUMPTOP}/../arch 69CPPFLAGS+= -isystem ${RUMPTOP}/../arch
68CPPFLAGS+= -isystem ${RUMPTOP}/.. 70CPPFLAGS+= -isystem ${RUMPTOP}/..
69.else 71.else
70CPPFLAGS+= -I${RUMPTOP}/../arch 72CPPFLAGS+= -I${RUMPTOP}/../arch
71CPPFLAGS+= -I${RUMPTOP}/.. 73CPPFLAGS+= -I${RUMPTOP}/..
72.endif 74.endif
73 75
74RUMP_LDSCRIPT?= GNU 76RUMP_LDSCRIPT?= GNU
75.if ${RUMP_LDSCRIPT} != "no" 77.if ${RUMP_LDSCRIPT} != "no"
76# my ld or yours? 78# my ld or yours?
77.if ${RUMP_LDSCRIPT} == "sun" 79.if ${RUMP_LDSCRIPT} == "sun"
78LDFLAGS+= -Wl,-M ${RUMPTOP}/ldscript_sun.rump 80LDFLAGS+= -Wl,-M ${RUMPTOP}/ldscript_sun.rump
79SRCS+= linksyms_sun.c 81SRCS+= linksyms_sun.c
80.PATH: ${RUMPTOP} 82.PATH: ${RUMPTOP}
81.elif ${RUMP_LDSCRIPT} == "GNU" 83.elif ${RUMP_LDSCRIPT} == "GNU"
82LDFLAGS+= -Wl,-T,${RUMPTOP}/ldscript.rump 84LDFLAGS+= -Wl,-T,${RUMPTOP}/ldscript.rump
83.elif ${RUMP_LDSCRIPT} == "ctor" 85.elif ${RUMP_LDSCRIPT} == "ctor"
84CPPFLAGS+= -DRUMP_USE_CTOR 86CPPFLAGS+= -DRUMP_USE_CTOR
85.else 87.else
86.error Unknown ldscript ${RUMP_LDSCRIPT} 88.error Unknown ldscript ${RUMP_LDSCRIPT}
87.endif 89.endif
88.endif 90.endif
89 91
90.if defined(RUMP_CURLWP) 92.if defined(RUMP_CURLWP)
91.if ${RUMP_CURLWP} == "hypercall" 93.if ${RUMP_CURLWP} == "hypercall"
92CPPFLAGS+= -DRUMP_CURLWP=RUMP_CURLWP_HYPERCALL 94CPPFLAGS+= -DRUMP_CURLWP=RUMP_CURLWP_HYPERCALL
93.elif ${RUMP_CURLWP} == "__thread" 95.elif ${RUMP_CURLWP} == "__thread"
94CPPFLAGS+= -DRUMP_CURLWP=RUMP_CURLWP___THREAD 96CPPFLAGS+= -DRUMP_CURLWP=RUMP_CURLWP___THREAD
95.elif ${RUMP_CURLWP} == "register" 97.elif ${RUMP_CURLWP} == "register"
96CPPFLAGS+= -DRUMP_CURLWP=RUMP_CURLWP_REGISTER 98CPPFLAGS+= -DRUMP_CURLWP=RUMP_CURLWP_REGISTER
97.else 99.else
98.error Unsupported curlwp scheme: ${RUMP_CURLWP} 100.error Unsupported curlwp scheme: ${RUMP_CURLWP}
99.endif 101.endif
100.endif 102.endif
101 103
102RUMP_DIAGNOSTIC?=yes 104RUMP_DIAGNOSTIC?=yes
103.if ${RUMP_DIAGNOSTIC} == "yes" 105.if ${RUMP_DIAGNOSTIC} == "yes"
104CPPFLAGS+= -DDIAGNOSTIC 106CPPFLAGS+= -DDIAGNOSTIC
105.endif 107.endif
106 108
107.ifdef RUMP_DEBUG 109.ifdef RUMP_DEBUG
108CPPFLAGS+= -DDEBUG 110CPPFLAGS+= -DDEBUG
109.endif 111.endif
110 112
111.ifdef RUMP_LOCKDEBUG 113.ifdef RUMP_LOCKDEBUG
112CPPFLAGS+= -DLOCKDEBUG 114CPPFLAGS+= -DLOCKDEBUG
113.endif 115.endif
114 116
115RUMP_KTRACE?=yes 117RUMP_KTRACE?=yes
116.if ${RUMP_KTRACE} == "yes" 118.if ${RUMP_KTRACE} == "yes"
117CPPFLAGS+= -DKTRACE 119CPPFLAGS+= -DKTRACE
118.endif 120.endif
119 121
120# kernel libs should not get linked against libc 122# kernel libs should not get linked against libc
121# XXX: actually, we would like to enable this but cannot, since it 123# XXX: actually, we would like to enable this but cannot, since it
122# also leaves out libgcc, it causes problems on some platforms. 124# also leaves out libgcc, it causes problems on some platforms.
123# revisit some day. 125# revisit some day.
124#LDFLAGS+= -nodefaultlibs 126#LDFLAGS+= -nodefaultlibs
125 127
126# make sure __NetBSD__ gets defined (for builds on non-NetBSD) 128# make sure __NetBSD__ gets defined (for builds on non-NetBSD)
127# also, give those builds a way to undef the local compiler's macros 129# also, give those builds a way to undef the local compiler's macros
128CPPFLAGS+= ${RUMPKERN_UNDEF} 130CPPFLAGS+= ${RUMPKERN_UNDEF}
129 131
130RUMPKERNEL= This is NetBSD and I am the rump. Good evening. 132RUMPKERNEL= This is NetBSD and I am the rump. Good evening.
131 133
132# workaround: evbppc is not a well-defined arch 134# workaround: evbppc is not a well-defined arch
133.if (${MACHINE} == "evbppc") 135.if (${MACHINE} == "evbppc")
134CPPFLAGS+= -DPPC_OEA 136CPPFLAGS+= -DPPC_OEA
135.endif 137.endif
136 138
137# If any of these files change, we need a full rebuild 139# If any of these files change, we need a full rebuild
138DPSRCS+= ${RUMPTOP}/Makefile.rump 140DPSRCS+= ${RUMPTOP}/Makefile.rump
139 141
140# 142#
141# Support for component-specific hypercalls 143# Support for component-specific hypercalls
142# 144#
143 145
144# no easy way to get WARNS out of bsd.sys.mk 146# no easy way to get WARNS out of bsd.sys.mk
145RUMPCOMP_USER_WARNFLAGS= -Wall -Wextra -Wno-unused-parameter 147RUMPCOMP_USER_WARNFLAGS= -Wall -Wextra -Wno-unused-parameter
146RUMPCOMP_USER_WARNFLAGS+= -Wstrict-prototypes -Wmissing-prototypes 148RUMPCOMP_USER_WARNFLAGS+= -Wstrict-prototypes -Wmissing-prototypes
147 149
148.ifdef RUMPCOMP_USER_SRCS && !defined(RUMPKERN_ONLY) 150.ifdef RUMPCOMP_USER_SRCS && !defined(RUMPKERN_ONLY)
149.if empty(DESTDIR) 151.if empty(DESTDIR)
150DESTDIR=/ 152DESTDIR=/
151.endif 153.endif
152BUILDRUMP_CPPFLAGS ?= -isysroot ${DESTDIR} 154BUILDRUMP_CPPFLAGS ?= -isysroot ${DESTDIR}
153RUMPCOMP_USER_WERROR = ${${_NOWERROR} == "no" :?-Werror:} 155RUMPCOMP_USER_WERROR = ${${_NOWERROR} == "no" :?-Werror:}
154.for rcusrc in ${RUMPCOMP_USER_SRCS:R} 156.for rcusrc in ${RUMPCOMP_USER_SRCS:R}
155${rcusrc}.d: ${rcusrc}.c 157${rcusrc}.d: ${rcusrc}.c
156 ${_MKTARGET_CREATE} 158 ${_MKTARGET_CREATE}
157 ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${CPUFLAGS} ${REPROFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${.ALLSRC:O:u:M*${rcusrc}.c} 159 ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${CPUFLAGS} ${REPROFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${.ALLSRC:O:u:M*${rcusrc}.c}
158 160
159${rcusrc}.o: ${rcusrc}.c 161${rcusrc}.o: ${rcusrc}.c
160 ${_MKTARGET_COMPILE} 162 ${_MKTARGET_COMPILE}
161 ${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${CPUFLAGS} ${REPROFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c} 163 ${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${CPUFLAGS} ${REPROFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
162 164
163${rcusrc}.pico: ${rcusrc}.c 165${rcusrc}.pico: ${rcusrc}.c
164 ${_MKTARGET_COMPILE} 166 ${_MKTARGET_COMPILE}
165 ${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${CPUFLAGS} ${REPROFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c} 167 ${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${CPUFLAGS} ${REPROFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
166 168
167${rcusrc}.po: ${rcusrc}.c 169${rcusrc}.po: ${rcusrc}.c
168 ${_MKTARGET_COMPILE} 170 ${_MKTARGET_COMPILE}
169 ${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${CPUFLAGS} ${REPROFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c} 171 ${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${CPUFLAGS} ${REPROFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
170 172
171RUMPOBJ_NORENAME+=${rcusrc}.o ${rcusrc}.pico ${rcusrc}.po 173RUMPOBJ_NORENAME+=${rcusrc}.o ${rcusrc}.pico ${rcusrc}.po
172SRCS+=${rcusrc}.c 174SRCS+=${rcusrc}.c
173.endfor 175.endfor
174.endif 176.endif
175 177
176# 178#
177# Rename library symbols before use. If a symbol does not already belong 179# Rename library symbols before use. If a symbol does not already belong
178# to a rump namespace ("rump" or "RUMP"), prefix it with "rumpns". This 180# to a rump namespace ("rump" or "RUMP"), prefix it with "rumpns". This
179# avoids accidentally linking any kernel symbol against host platform 181# avoids accidentally linking any kernel symbol against host platform
180# libraries. The only non-renamed symbols are linkset delimiters and 182# libraries. The only non-renamed symbols are linkset delimiters and
181# the GOT, which are more a property of the compiler than the kernel. 183# the GOT, which are more a property of the compiler than the kernel.
182# 184#
183# Some toolchains generate unresolved symbols which are supposed to be 185# Some toolchains generate unresolved symbols which are supposed to be
184# satisfied by the toolchain itself when the program is linked. 186# satisfied by the toolchain itself when the program is linked.
185# Unfortunately, we do not know which of the symbols are generated by 187# Unfortunately, we do not know which of the symbols are generated by
186# the toolchain. Worse, they vary from platform to platform and 188# the toolchain. Worse, they vary from platform to platform and
187# toolchain to toolchain. The good news, however, is that this will 189# toolchain to toolchain. The good news, however, is that this will
188# be detected by a compile-time failure, so we can fairly easily manage 190# be detected by a compile-time failure, so we can fairly easily manage
189# a quirktable here. 191# a quirktable here.
190# 192#
191# We also allow calling ourselves externally with e.g.: 193# We also allow calling ourselves externally with e.g.:
192# make -f /sys/rump/Makefile.rump RUMP_SYMREN=ffs.kobj 194# make -f /sys/rump/Makefile.rump RUMP_SYMREN=ffs.kobj
193# 195#
194.if ${MACHINE_CPU} == "mips" 196.if ${MACHINE_CPU} == "mips"
195_SYMQUIRK='|_gp_disp' 197_SYMQUIRK='|_gp_disp'
196.elif ${MACHINE_CPU} == "hppa" 198.elif ${MACHINE_CPU} == "hppa"
197_SYMQUIRK='|\$$\$$' 199_SYMQUIRK='|\$$\$$'
198.elif ${MACHINE_ARCH} == "powerpc64" 200.elif ${MACHINE_ARCH} == "powerpc64"
199_SYMQUIRK="|PF_funcs" 201_SYMQUIRK="|PF_funcs"
200.endif 202.endif
201 203
202# 204#
203# Prefix quirks. At least one toolchain generates global 205# Prefix quirks. At least one toolchain generates global
204# symbols with prefixes which really need to remain as prefixes 206# symbols with prefixes which really need to remain as prefixes
205# (i.e. the '.' on the front of some ppc64 globals). The 207# (i.e. the '.' on the front of some ppc64 globals). The
206# way to know if you have the problem is if you get later 208# way to know if you have the problem is if you get later
207# complaints about symbols like 'rumpns_XrumpBLAH' or 'XrumpBLAH'; 209# complaints about symbols like 'rumpns_XrumpBLAH' or 'XrumpBLAH';
208# the 'X' part was added by the toolchain and will need to 210# the 'X' part was added by the toolchain and will need to
209# be mentioned here. 211# be mentioned here.
210#  212#
211.if ${MACHINE_ARCH} == "powerpc64" 213.if ${MACHINE_ARCH} == "powerpc64"
212_PQ="\.?" 214_PQ="\.?"
213.else 215.else
214_PQ= 216_PQ=
215.endif 217.endif
216 218
217rump_symren: __archivebuild 219rump_symren: __archivebuild
218.if !defined(RUMP_SYMREN) 220.if !defined(RUMP_SYMREN)
219 @echo "Must supply RUMP_SYMREN for target rump_symren" 221 @echo "Must supply RUMP_SYMREN for target rump_symren"
220 @false 222 @false
221.endif 223.endif
222 224
223# if we are called from lib build (RUMP_SYMREN is not specified), 225# if we are called from lib build (RUMP_SYMREN is not specified),
224# build the arrrrchive. otherwise just rename symbols. 226# build the arrrrchive. otherwise just rename symbols.
225__archivebuild: .USE 227__archivebuild: .USE
226.if defined(RUMP_SYMREN) && defined(RUMPTOP) 228.if defined(RUMP_SYMREN) && defined(RUMPTOP)
227 @echo "ERROR: RUMP_SYMREN can only be used standalone" 229 @echo "ERROR: RUMP_SYMREN can only be used standalone"
228 @false 230 @false
229.endif 231.endif
230.if defined(RUMP_SYMREN) 232.if defined(RUMP_SYMREN)
231 ${_MKMSG} " symbol rename " ${RUMP_SYMREN} 233 ${_MKMSG} " symbol rename " ${RUMP_SYMREN}
232.else 234.else
233 ${_MKTARGET_BUILD} 235 ${_MKTARGET_BUILD}
234 rm -f ${.TARGET} 236 rm -f ${.TARGET}
235.endif 237.endif
236 for renameobj in ${RUMP_SYMREN:U${.ALLSRC:C/(${RUMPOBJ_NORENAME:ts|})//g}}; do \ 238 for renameobj in ${RUMP_SYMREN:U${.ALLSRC:C/(${RUMPOBJ_NORENAME:ts|})//g}}; do \
237 ${NM} -go $${renameobj} | ${TOOL_AWK} ' \ 239 ${NM} -go $${renameobj} | ${TOOL_AWK} ' \
238 $$NF!~/^'${_PQ}'(rump|RUMP|__|_GLOBAL_OFFSET_TABLE|\.TOC\.'${_SYMQUIRK}'${RUMP_SYM_NORENAME:D|${RUMP_SYM_NORENAME}})/ \ 240 $$NF!~/^'${_PQ}'(rump|RUMP|__|_GLOBAL_OFFSET_TABLE|\.TOC\.'${_SYMQUIRK}'${RUMP_SYM_NORENAME:D|${RUMP_SYM_NORENAME}})/ \
239 {s=$$NF;sub(/^'${_PQ}'/, "&rumpns_", s); print $$NF, s}'\ 241 {s=$$NF;sub(/^'${_PQ}'/, "&rumpns_", s); print $$NF, s}'\
240 | sort | uniq > renametab.$${renameobj}; \ 242 | sort | uniq > renametab.$${renameobj}; \
241 ${OBJCOPY} --preserve-dates --redefine-syms \ 243 ${OBJCOPY} --preserve-dates --redefine-syms \
242 renametab.$${renameobj} $${renameobj}; \ 244 renametab.$${renameobj} $${renameobj}; \
243 rm -f renametab.$${renameobj}; \ 245 rm -f renametab.$${renameobj}; \
244 done 246 done
245.if !defined(RUMP_SYMREN) 247.if !defined(RUMP_SYMREN)
246 ${AR} ${_ARFL} ${.TARGET} \ 248 ${AR} ${_ARFL} ${.TARGET} \
247 `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}` 249 `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
248.endif 250.endif
249 251
250COMMENT?= (no description) 252COMMENT?= (no description)
251rumpdescribe: .PHONY 253rumpdescribe: .PHONY
252 @printf '%-24s %s\n' '${LIB}' '${COMMENT}' 254 @printf '%-24s %s\n' '${LIB}' '${COMMENT}'
253 255
254_BSD_IOCONF_MK_USER_=1 256_BSD_IOCONF_MK_USER_=1
255.include <bsd.ioconf.mk> 257.include <bsd.ioconf.mk>
256 258
257.-include "${NETBSDSRCDIR}/sys/arch/${MACHINE_CPU}/include/Makefile.inc" 259.-include "${NETBSDSRCDIR}/sys/arch/${MACHINE_CPU}/include/Makefile.inc"
258.-include "${NETBSDSRCDIR}/sys/arch/${MACHINE}/include/Makefile.inc" 260.-include "${NETBSDSRCDIR}/sys/arch/${MACHINE}/include/Makefile.inc"
259 261
260.endif # _RUMP_MK 262.endif # _RUMP_MK