Changeset View
Standalone View
sys/conf/kern.pre.mk
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
# The following should be removed no earlier than LLVM11 being imported into the | # The following should be removed no earlier than LLVM11 being imported into the | ||||
# tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the | # tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the | ||||
# default over to -fno-common, making this redundant. | # default over to -fno-common, making this redundant. | ||||
CFLAGS+= -fno-common | CFLAGS+= -fno-common | ||||
# XXX LOCORE means "don't declare C stuff" not "for locore.s". | # XXX LOCORE means "don't declare C stuff" not "for locore.s". | ||||
ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}} | ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}} | ||||
KASAN_ENABLED!= grep KASAN opt_global.h || true ; echo | |||||
emaste: I wonder if (as a later change) we should get config(8) to generate a Makefile.config.inc or… | |||||
Done Inline ActionsI don't quite follow the suggestion. You mean we would end up with a Makefile.KASAN.inc or so? markj: I don't quite follow the suggestion. You mean we would end up with a Makefile.KASAN.inc or so? | |||||
Not Done Inline ActionsHmmm, we've grown a lot of these grep commands. I wrote a generic version of this some time ago (7.x? 8.x?)e. I thought I'd committed it, but it appears that I didn't. Personally, I'd create a mk.$OPTION file in $S/conf. For all options that are enabled that have a mk.$OPTION have config write them into the makefile at %BEFORE_DEPEND. But I'll be the first to admit this is beyond the scope of this patch. imp: Hmmm, we've grown a lot of these grep commands. I wrote a generic version of this some time ago… | |||||
Done Inline ActionsI'll have to add another of these for KMSAN, so a better solution is indeed warranted. The approach of having mk.KASAN seems good. We'd need to audit all of the existing uses of "grep <OPTION> opt_foo.h" to make sure they're all amenable to this approach. markj: I'll have to add another of these for KMSAN, so a better solution is indeed warranted. The… | |||||
Not Done Inline ActionsSomething like Makefile.options.inc that contains KASAN_ENABLED=yes and such, rather than invoking grep n times emaste: Something like Makefile.options.inc that contains `KASAN_ENABLED=yes` and such, rather than… | |||||
.if !empty(KASAN_ENABLED) | |||||
SAN_CFLAGS+= -fsanitize=kernel-address \ | |||||
-mllvm -asan-stack=true \ | |||||
-mllvm -asan-instrument-dynamic-allocas=true \ | |||||
-mllvm -asan-globals=true \ | |||||
-mllvm -asan-use-after-scope=true \ | |||||
-mllvm -asan-instrumentation-with-call-threshold=0 | |||||
.endif | |||||
KCSAN_ENABLED!= grep KCSAN opt_global.h || true ; echo | KCSAN_ENABLED!= grep KCSAN opt_global.h || true ; echo | ||||
.if !empty(KCSAN_ENABLED) | .if !empty(KCSAN_ENABLED) | ||||
SAN_CFLAGS+= -fsanitize=thread | SAN_CFLAGS+= -fsanitize=thread | ||||
.endif | .endif | ||||
KUBSAN_ENABLED!= grep KUBSAN opt_global.h || true ; echo | KUBSAN_ENABLED!= grep KUBSAN opt_global.h || true ; echo | ||||
.if !empty(KUBSAN_ENABLED) | .if !empty(KUBSAN_ENABLED) | ||||
SAN_CFLAGS+= -fsanitize=undefined | SAN_CFLAGS+= -fsanitize=undefined | ||||
▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines |
I wonder if (as a later change) we should get config(8) to generate a Makefile.config.inc or such that we can include?