kern.pre.mk 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. # Part of a unified Makefile for building kernels. This part contains all
  2. # of the definitions that need to be before %BEFORE_DEPEND.
  3. # Allow user to configure things that only effect src tree builds.
  4. # Note: This is duplicated from src.sys.mk to ensure that we include
  5. # /etc/src.conf when building the kernel. Kernels can be built without
  6. # the rest of /usr/src, but they still always process SRCCONF even though
  7. # the normal mechanisms to prevent that (compiling out of tree) won't
  8. # work. To ensure they do work, we have to duplicate thee few lines here.
  9. SRCCONF?= /etc/src.conf
  10. .if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_)
  11. .include "${SRCCONF}"
  12. _srcconf_included_:
  13. .endif
  14. .include <bsd.own.mk>
  15. .include <bsd.compiler.mk>
  16. .include "kern.opts.mk"
  17. # The kernel build always occurs in the object directory which is .CURDIR.
  18. .if ${.MAKE.MODE:Unormal:Mmeta}
  19. .MAKE.MODE+= curdirOk=yes
  20. .endif
  21. # The kernel build always expects .OBJDIR=.CURDIR.
  22. .OBJDIR: ${.CURDIR}
  23. .if defined(NO_OBJWALK) || ${MK_AUTO_OBJ} == "yes"
  24. NO_OBJWALK= t
  25. NO_MODULES_OBJ= t
  26. .endif
  27. .if !defined(NO_OBJWALK)
  28. _obj= obj
  29. .endif
  30. # Can be overridden by makeoptions or /etc/make.conf
  31. KERNEL_KO?= kernel
  32. KERNEL?= kernel
  33. KODIR?= /boot/${KERNEL}
  34. LDSCRIPT_NAME?= ldscript.$M
  35. LDSCRIPT?= $S/conf/${LDSCRIPT_NAME}
  36. M= ${MACHINE}
  37. AWK?= awk
  38. CP?= cp
  39. ELFDUMP?= elfdump
  40. NM?= nm
  41. OBJCOPY?= objcopy
  42. SIZE?= size
  43. .if defined(DEBUG)
  44. CTFFLAGS+= -g
  45. .endif
  46. .if ${MACHINE_CPUARCH} == "amd64" && ${COMPILER_TYPE} != "clang"
  47. _COPTFLAGS_EXTRA=-frename-registers
  48. .else
  49. _COPTFLAGS_EXTRA=
  50. .endif
  51. COPTFLAGS?=-O2 -pipe ${_COPTFLAGS_EXTRA}
  52. .if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing)
  53. COPTFLAGS+= -fno-strict-aliasing
  54. .endif
  55. .if !defined(NO_CPU_COPTFLAGS)
  56. COPTFLAGS+= ${_CPUCFLAGS}
  57. .endif
  58. NOSTDINC= -nostdinc
  59. INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S -I$S/contrib/ck/include
  60. CFLAGS= ${COPTFLAGS} ${DEBUG}
  61. CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
  62. CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100
  63. CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000
  64. CFLAGS.gcc+= -fms-extensions -finline-limit=${INLINE_LIMIT}
  65. CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH}
  66. CFLAGS.gcc+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH}
  67. CFLAGS.gcc+= -fms-extensions
  68. .if defined(CFLAGS_ARCH_PARAMS)
  69. CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS}
  70. .endif
  71. WERROR?= -Werror
  72. # The following should be removed no earlier than LLVM11 being imported into the
  73. # tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the
  74. # default over to -fno-common, making this redundant.
  75. CFLAGS+= -fno-common
  76. # XXX LOCORE means "don't declare C stuff" not "for locore.s".
  77. ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}}
  78. COMPAT_FREEBSD32_ENABLED!= grep COMPAT_FREEBSD32 opt_global.h || true ; echo
  79. KASAN_ENABLED!= grep KASAN opt_global.h || true ; echo
  80. .if !empty(KASAN_ENABLED)
  81. SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kasan \
  82. -fsanitize=kernel-address \
  83. -mllvm -asan-stack=true \
  84. -mllvm -asan-instrument-dynamic-allocas=true \
  85. -mllvm -asan-globals=true \
  86. -mllvm -asan-use-after-scope=true \
  87. -mllvm -asan-instrumentation-with-call-threshold=0 \
  88. -mllvm -asan-instrument-byval=false
  89. .if ${MACHINE_CPUARCH} == "aarch64"
  90. # KASAN/ARM64 TODO: -asan-mapping-offset is calculated from:
  91. # (VM_KERNEL_MIN_ADDRESS >> KASAN_SHADOW_SCALE_SHIFT) + $offset = KASAN_MIN_ADDRESS
  92. #
  93. # This is different than amd64, where we have a different
  94. # KASAN_MIN_ADDRESS, and this offset value should eventually be
  95. # upstreamed similar to: https://reviews.llvm.org/D98285
  96. #
  97. SAN_CFLAGS+= -mllvm -asan-mapping-offset=0xdfff208000000000
  98. .elif ${MACHINE_CPUARCH} == "amd64" && \
  99. ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 180000
  100. # Work around https://github.com/llvm/llvm-project/issues/87923, which leads to
  101. # an assertion failure compiling dtrace.c with asan enabled.
  102. SAN_CFLAGS+= -mllvm -asan-use-stack-safety=0
  103. .endif
  104. .endif
  105. KCSAN_ENABLED!= grep KCSAN opt_global.h || true ; echo
  106. .if !empty(KCSAN_ENABLED)
  107. SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kcsan \
  108. -fsanitize=thread
  109. .endif
  110. KMSAN_ENABLED!= grep KMSAN opt_global.h || true ; echo
  111. .if !empty(KMSAN_ENABLED)
  112. # Disable -fno-sanitize-memory-param-retval until interceptors have been
  113. # updated to work properly with it.
  114. SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kmsan \
  115. -fsanitize=kernel-memory
  116. .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 160000
  117. SAN_CFLAGS+= -fno-sanitize-memory-param-retval
  118. .endif
  119. .endif
  120. KUBSAN_ENABLED!= grep KUBSAN opt_global.h || true ; echo
  121. .if !empty(KUBSAN_ENABLED)
  122. SAN_CFLAGS+= -fsanitize=undefined
  123. .endif
  124. COVERAGE_ENABLED!= grep COVERAGE opt_global.h || true ; echo
  125. .if !empty(COVERAGE_ENABLED)
  126. .if ${COMPILER_TYPE} == "clang" || \
  127. (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100)
  128. SAN_CFLAGS+= -fsanitize-coverage=trace-pc,trace-cmp
  129. .else
  130. SAN_CFLAGS+= -fsanitize-coverage=trace-pc
  131. .endif
  132. .endif
  133. CFLAGS+= ${SAN_CFLAGS}
  134. GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo
  135. .if !empty(GCOV_ENABLED)
  136. .if ${COMPILER_TYPE} == "gcc"
  137. GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage
  138. .endif
  139. .endif
  140. CFLAGS+= ${GCOV_CFLAGS}
  141. # Put configuration-specific C flags last so that they can override
  142. # the others.
  143. CFLAGS+= ${CONF_CFLAGS}
  144. .if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id}
  145. LDFLAGS+= --build-id=sha1
  146. .endif
  147. .if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
  148. ${MACHINE_CPUARCH} == "i386" || ${MACHINE} == "powerpc") && \
  149. defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == "" && \
  150. !make(install)
  151. .error amd64/arm64/i386/ppc* kernel requires linker ifunc support
  152. .endif
  153. .if ${MACHINE_CPUARCH} == "amd64"
  154. LDFLAGS+= -z max-page-size=2097152
  155. .if ${LINKER_TYPE} != "lld"
  156. LDFLAGS+= -z common-page-size=4096
  157. .else
  158. .if defined(LINKER_FEATURES) && !${LINKER_FEATURES:Mifunc-noplt}
  159. .warning "Linker ${LD} does not support -z ifunc-noplt -> ifunc calls are unoptimized."
  160. .else
  161. LDFLAGS+= -z notext -z ifunc-noplt
  162. .endif
  163. .endif
  164. .endif # ${MACHINE_CPUARCH} == "amd64"
  165. .if ${MACHINE_CPUARCH} == "riscv"
  166. # Hack: Work around undefined weak symbols being out of range when linking with
  167. # LLD (address is a PC-relative calculation, and BFD works around this by
  168. # rewriting the instructions to generate an absolute address of 0); -fPIE
  169. # avoids this since it uses the GOT for all extern symbols, which is overly
  170. # inefficient for us. Drop once undefined weak symbols work with medany.
  171. .if ${LINKER_TYPE} == "lld"
  172. CFLAGS+= -fPIE
  173. .endif
  174. .endif
  175. NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC}
  176. NORMAL_S= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}
  177. NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${.IMPSRC}
  178. NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \
  179. ${CC} -c ${CFLAGS} ${WERROR} ${.PREFIX}.c
  180. NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC}
  181. NORMAL_FWO= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} -o ${.TARGET} \
  182. $S/kern/firmw.S -DFIRMW_FILE=\""${.ALLSRC:M*.fw}"\" \
  183. -DFIRMW_SYMBOL="${.ALLSRC:M*.fw:C/[-.\/]/_/g}"
  184. # for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS)
  185. ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} \
  186. -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} \
  187. -Wno-missing-prototypes -U__BMI__ -DZSTD_NO_INTRINSICS ${.IMPSRC}
  188. # https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1]
  189. # "Note that [GCC] autovectorization still does not do a good job on the
  190. # optimized version, so it's turned off via attribute and flag. I found
  191. # that neither attribute nor command-line flag were entirely successful in
  192. # turning off vectorization, which is why there were both."
  193. .if ${COMPILER_TYPE} == "gcc"
  194. ZSTD_DECOMPRESS_BLOCK_FLAGS= -fno-tree-vectorize
  195. .endif
  196. ZINCDIR=$S/contrib/openzfs/include
  197. # Common for dtrace / zfs
  198. CDDL_CFLAGS= \
  199. -DFREEBSD_NAMECACHE \
  200. -D_SYS_VMEM_H_ \
  201. -D__KERNEL \
  202. -D__KERNEL__ \
  203. -nostdinc \
  204. -include $S/modules/zfs/static_ccompile.h \
  205. -I${ZINCDIR} \
  206. -I${ZINCDIR}/os/freebsd \
  207. -I${ZINCDIR}/os/freebsd/spl \
  208. -I${ZINCDIR}/os/freebsd/zfs \
  209. -I$S/modules/zfs \
  210. -I$S/contrib/openzfs/module/zstd/include \
  211. ${CFLAGS} \
  212. -Wno-cast-qual \
  213. -Wno-duplicate-decl-specifier \
  214. -Wno-missing-braces \
  215. -Wno-missing-prototypes \
  216. -Wno-parentheses \
  217. -Wno-pointer-arith \
  218. -Wno-strict-prototypes \
  219. -Wno-switch \
  220. -Wno-undef \
  221. -Wno-uninitialized \
  222. -Wno-unknown-pragmas \
  223. -Wno-unused \
  224. -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \
  225. -I$S/cddl/contrib/opensolaris/uts/common \
  226. -I$S -I$S/cddl/compat/opensolaris
  227. CDDL_C= ${CC} -c ${CDDL_CFLAGS} ${WERROR} ${.IMPSRC}
  228. # Special flags for managing the compat compiles for ZFS
  229. ZFS_CFLAGS+= -I$S/contrib/openzfs/module/icp/include \
  230. ${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY \
  231. -DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP
  232. .if ${MACHINE_ARCH} == "amd64"
  233. ZFS_CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \
  234. -DHAVE_AVX -DHAVE_AVX2 -DHAVE_AVX512F -DHAVE_AVX512VL -DHAVE_AVX512BW
  235. .endif
  236. .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
  237. ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm"
  238. ZFS_CFLAGS+= -DBITS_PER_LONG=32
  239. .else
  240. ZFS_CFLAGS+= -DBITS_PER_LONG=64
  241. .endif
  242. ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS}
  243. ZFS_C= ${CC} -c ${ZFS_CFLAGS} ${WERROR} ${.IMPSRC}
  244. ZFS_RPC_C= ${CC} -c ${ZFS_CFLAGS} -DHAVE_RPC_TYPES ${WERROR} ${.IMPSRC}
  245. ZFS_S= ${CC} -c ${ZFS_ASM_CFLAGS} ${WERROR} ${.IMPSRC}
  246. # ATH driver
  247. ATH_CFLAGS= -I${SRCTOP}/sys/dev/ath ${NO_WUNUSED_BUT_SET_VARIABLE}
  248. ATH_C= ${CC} -c ${CFLAGS} ${WERROR} ${ATH_CFLAGS} ${.IMPSRC}
  249. # Special flags for managing the compat compiles for DTrace
  250. DTRACE_CFLAGS= -DBUILDING_DTRACE ${CDDL_CFLAGS} -I$S/cddl/dev/dtrace -I$S/cddl/dev/dtrace/${MACHINE_CPUARCH}
  251. .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
  252. DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/intel -I$S/cddl/dev/dtrace/x86
  253. .endif
  254. DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/util -I$S -DDIS_MEM -DSMP -I$S/cddl/compat/opensolaris
  255. DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/common
  256. DTRACE_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${DTRACE_CFLAGS}
  257. DTRACE_C= ${CC} -c ${DTRACE_CFLAGS} ${WERROR} ${.IMPSRC}
  258. DTRACE_S= ${CC} -c ${DTRACE_ASM_CFLAGS} ${WERROR} ${.IMPSRC}
  259. # zlib code supports systems that are quite old, but will fix this issue once C2x gets radified.
  260. # see https://github.com/madler/zlib/issues/633 for details
  261. ZLIB_CFLAGS= -Wno-cast-qual ${NO_WDEPRECATED_NON_PROTOTYPE} ${NO_WSTRICT_PROTOTYPES}
  262. ZLIB_C= ${CC} -c ${CFLAGS} ${WERROR} ${ZLIB_CFLAGS} ${.IMPSRC}
  263. # Special flags for managing the compat compiles for DTrace/FBT
  264. FBT_CFLAGS= -DBUILDING_DTRACE -nostdinc -I$S/cddl/dev/fbt/${MACHINE_CPUARCH} -I$S/cddl/dev/fbt ${CDDL_CFLAGS} -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common
  265. .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
  266. FBT_CFLAGS+= -I$S/cddl/dev/fbt/x86
  267. .endif
  268. FBT_C= ${CC} -c ${FBT_CFLAGS} ${WERROR} ${.IMPSRC}
  269. .if ${MK_CTF} != "no"
  270. NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
  271. .elif ${MAKE_VERSION} >= 5201111300
  272. NORMAL_CTFCONVERT=
  273. .else
  274. NORMAL_CTFCONVERT= @:
  275. .endif
  276. # Linux Kernel Programming Interface C-flags
  277. LINUXKPI_INCLUDES= -I$S/compat/linuxkpi/common/include \
  278. -I$S/compat/linuxkpi/dummy/include
  279. LINUXKPI_C= ${NORMAL_C} ${LINUXKPI_INCLUDES}
  280. # Infiniband C flags. Correct include paths and omit errors that linux
  281. # does not honor.
  282. OFEDINCLUDES= -I$S/ofed/include -I$S/ofed/include/uapi ${LINUXKPI_INCLUDES}
  283. OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith
  284. OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_MEM \
  285. ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR}
  286. OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR}
  287. OFED_C= ${OFED_C_NOIMP} ${.IMPSRC}
  288. # mlxfw C flags.
  289. MLXFW_C= ${OFED_C_NOIMP} \
  290. -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \
  291. -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \
  292. ${.IMPSRC}
  293. # BNXT Driver
  294. BNXT_CFLAGS= -I$S/dev/bnxt/bnxt_en ${OFEDCFLAGS}
  295. BNXT_C_NOIMP= ${CC} -c -o ${.TARGET} ${BNXT_CFLAGS} ${WERROR}
  296. BNXT_C= ${BNXT_C_NOIMP} ${.IMPSRC}
  297. GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/}
  298. SYSTEM_CFILES= config.c env.c hints.c vnode_if.c
  299. SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
  300. SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
  301. SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
  302. SYSTEM_OBJS+= force-dynamic-hack.pico
  303. KEYMAP=kbdcontrol -P ${SRCTOP}/share/vt/keymaps -P ${SRCTOP}/share/syscons/keymaps
  304. KEYMAP_FIX=sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /'
  305. MD_ROOT_SIZE_CONFIGURED!= grep MD_ROOT_SIZE opt_md.h || true ; echo
  306. .if ${MFS_IMAGE:Uno} != "no"
  307. .if empty(MD_ROOT_SIZE_CONFIGURED)
  308. SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o
  309. .endif
  310. .endif
  311. SYSTEM_LD_BASECMD= \
  312. ${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \
  313. --no-warn-mismatch --warn-common --export-dynamic \
  314. --dynamic-linker /red/herring -X
  315. SYSTEM_LD= @${SYSTEM_LD_BASECMD} -o ${.TARGET} ${SYSTEM_OBJS} vers.o
  316. SYSTEM_LD_TAIL= @${SIZE} ${.TARGET} ; chmod 755 ${.TARGET}
  317. SYSTEM_DEP+= ${LDSCRIPT}
  318. # Calculate path for .m files early, if needed.
  319. .if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \
  320. (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH))
  321. __MPATH!=find ${S:tA}/ -name \*_if.m
  322. .endif
  323. # MKMODULESENV is set here so that port makefiles can augment
  324. # them.
  325. MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
  326. MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH}
  327. MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH}
  328. MKMODULESENV+= MODULES_EXTRA="${MODULES_EXTRA}" WITHOUT_MODULES="${WITHOUT_MODULES}"
  329. MKMODULESENV+= ARCH_FLAGS="${ARCH_FLAGS}"
  330. .if (${KERN_IDENT} == LINT)
  331. MKMODULESENV+= ALL_MODULES=LINT
  332. .endif
  333. .if defined(MODULES_OVERRIDE)
  334. MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}"
  335. .endif
  336. .if defined(DEBUG)
  337. MKMODULESENV+= DEBUG_FLAGS="${DEBUG}"
  338. .endif
  339. .if !defined(NO_MODULES)
  340. MKMODULESENV+= __MPATH="${__MPATH}"
  341. .endif
  342. # Detect kernel config options that force stack frames to be turned on.
  343. DDB_ENABLED!= grep DDB opt_ddb.h || true ; echo
  344. DTRACE_ENABLED!=grep KDTRACE_FRAME opt_kdtrace.h || true ; echo
  345. HWPMC_ENABLED!= grep HWPMC opt_hwpmc_hooks.h || true ; echo