From 4ded7c6b1508f22189049539c94be2930f20364d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 26 Apr 2024 17:54:15 -0400 Subject: config: Just use NOT to implement NOR --- config/flags.mk | 7 ++++--- config/prelude.mk | 16 ---------------- 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}} -- cgit v1.2.3