summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-04-26 17:54:15 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-04-26 17:54:15 -0400
commit4ded7c6b1508f22189049539c94be2930f20364d (patch)
tree2765e804798fadf1541df46393bb6dcd59383571
parente061b6da5ee46a334169d4e6a52e49857ae22f55 (diff)
downloadbfs-4ded7c6b1508f22189049539c94be2930f20364d.tar.xz
config: Just use NOT to implement NOR
-rw-r--r--config/flags.mk7
-rw-r--r--config/prelude.mk16
2 files changed, 4 insertions, 19 deletions
diff --git a/config/flags.mk b/config/flags.mk
index ee13f06..837c30f 100644
--- a/config/flags.mk
+++ b/config/flags.mk
@@ -75,12 +75,13 @@ export TSAN_CFLAGS=${TSAN_CFLAGS,${_TSAN}}
export UBSAN_CFLAGS=${UBSAN_CFLAGS,${_UBSAN}}
SAN_CFLAGS,y := -fno-sanitize-recover=all
-NO_SAN := ${NOR,${_ASAN},${_LSAN},${_MSAN},${_TSAN},${_UBSAN}}
-SAN := ${NOT,${NO_SAN}}
+INSANE := ${NOT,${_ASAN}${_LSAN}${_MSAN}${_TSAN}${_UBSAN}}
+SAN := ${NOT,${INSANE}}
export SAN_CFLAGS=${SAN_CFLAGS,${SAN}}
# MSAN and TSAN both need all code to be instrumented
-NOLIBS ?= ${NOT,${NOR,${_MSAN},${_TSAN}}}
+YESLIBS := ${NOT,${_MSAN}${_TSAN}}
+NOLIBS ?= ${NOT,${YESLIBS}}
export XNOLIBS=${NOLIBS}
# gcov only intercepts fork()/exec() with -std=gnu*
diff --git a/config/prelude.mk b/config/prelude.mk
index 6b0b649..109e60c 100644
--- a/config/prelude.mk
+++ b/config/prelude.mk
@@ -70,24 +70,8 @@ TRUTHY,y := y
TRUTHY,1 := y
# Boolean operators are also implemented with nested expansion
-NOT,y :=
NOT, := y
-# Support up to 5 arguments
-AND,y := y
-AND,y,y := y
-AND,y,y,y := y
-AND,y,y,y,y := y
-AND,y,y,y,y,y := y
-
-# NOR can be defined without combinatorial explosion.
-# OR is just ${NOT,${NOR,...}}
-NOR, := y
-NOR,, := y
-NOR,,, := y
-NOR,,,, := y
-NOR,,,,, := y
-
# Normalize ${V} to either "y" or ""
IS_V := ${TRUTHY,${V}}