diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2025-02-13 10:02:00 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2025-02-13 10:02:00 -0500 |
commit | 03f2e4dc12812e883b11cf0109166a6eed8059dd (patch) | |
tree | c52887880e26f354ccea7f3758eb29a3b2044495 | |
parent | 000d4a2f9adef54d4bc8ce84435d91ec9dda54c5 (diff) | |
download | bfs-03f2e4dc12812e883b11cf0109166a6eed8059dd.tar.xz |
configure: Add separate --enable-lto knob
-rw-r--r-- | build/flags.mk | 8 | ||||
-rwxr-xr-x | configure | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/build/flags.mk b/build/flags.mk index 9f552a8..462f74b 100644 --- a/build/flags.mk +++ b/build/flags.mk @@ -30,6 +30,9 @@ _GCOV := ${TRUTHY,${GCOV}} _LINT := ${TRUTHY,${LINT}} _RELEASE := ${TRUTHY,${RELEASE}} +LTO ?= ${RELEASE} +_LTO := ${TRUTHY,${LTO}} + ASAN_CFLAGS,y := -fsanitize=address LSAN_CFLAGS,y := -fsanitize=leak MSAN_CFLAGS,y := -fsanitize=memory -fsanitize-memory-track-origins @@ -62,11 +65,14 @@ _CPPFLAGS += ${LINT_CPPFLAGS,${_LINT}} _CFLAGS += ${LINT_CFLAGS,${_LINT}} RELEASE_CPPFLAGS,y := -DNDEBUG -RELEASE_CFLAGS,y := -O3 -flto=auto +RELEASE_CFLAGS,y := -O3 _CPPFLAGS += ${RELEASE_CPPFLAGS,${_RELEASE}} _CFLAGS += ${RELEASE_CFLAGS,${_RELEASE}} +LTO_CFLAGS,y := -flto=auto +_CFLAGS += ${LTO_CFLAGS,${_LTO}} + # Configurable flags CFLAGS ?= -g -Wall @@ -164,7 +164,7 @@ for arg; do --enable-*|--disable-*) case "$name" in - release|asan|lsan|msan|tsan|ubsan|lint|gcov) + release|lto|asan|lsan|msan|tsan|ubsan|lint|gcov) set -- "$@" "$NAME=$yn" ;; *) @@ -197,7 +197,7 @@ for arg; do ;; # Warn about MAKE variables that have documented configure flags - RELEASE=*|ASAN=*|LSAN=*|MSAN=*|TSAN=*|UBSAN=*|LINT=*|GCOV=*) + RELEASE=*|LTO=*|ASAN=*|LSAN=*|MSAN=*|TSAN=*|UBSAN=*|LINT=*|GCOV=*) name=$(printf '%s' "$NAME" | tr 'A-Z_' 'a-z-') warn '"%s" is deprecated; use --enable-%s' "$arg" "$name" set -- "$@" "$arg" |