You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
configure: sanitizer builds (--enable-asan/tsan/ubsan) are built with LTO; --enable-debug is not #4861
--enable-asan, --enable-tsan and --enable-ubsan all build with -flto:
$ ./configure --enable-asan --without-tcmalloc
Sanitizer enabled : asan
Building with LTO : yes
$ grep '^GF_CFLAGS' libglusterfs/src/Makefile
GF_CFLAGS = ... -fsanitize=address -fno-omit-frame-pointer ... -flto
--enable-debug is exempted from LTO on purpose (0ed6489bd2, "configure: disable
LTO when building with debug", #1967). The sanitizer builds are diagnostic builds of
the same kind and were simply never covered: a sanitizer build stays out of LTO only
when --enable-debug happens to be given as well.
Why
The LTO gate keys only on BUILD_DEBUG:
configure.ac: AS_IF([ test "x$BUILD_DEBUG" = "xno" && test "x$enable_lto" != "xno" ], [ ... -flto ... ])
The sanitizer options set SANITIZER (asan/tsan/ubsan) but never BUILD_DEBUG, so
the gate still enables LTO for them.
Why it matters
A sanitizer build exists to be read, not shipped. LTO adds a whole-program
optimisation pass and a slow link step to a build that is already slow, and one more
variable to a report that should be read literally. Keeping the sanitizer knob and the
LTO knob orthogonal is the decision #1967 already took for --enable-debug.
Fix
Also require SANITIZER = none in the gate (one line; accompanying PR). Verified on
devel 2326b1da07 with gcc 16.2.1: with the fix --enable-asan, --enable-tsan and --enable-ubsan each report Building with LTO : no, while a plain ./configure is
unchanged (Building with LTO : yes).
Activity
build: don't enable LTO for sanitizer builds