[master] 523f19297 build: Add -mno-omit-leaf-frame-pointer to sanitizer CFLAGS

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Aug 5 09:15:09 UTC 2022

commit 523f1929706101f0a62120adf755aab814598fb7
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Jul 15 12:32:04 2022 +0200

    build: Add -mno-omit-leaf-frame-pointer to sanitizer CFLAGS
    According to the GCC manual on -fno-omit-frame-pointer:
    > Note that -fno-omit-frame-pointer doesn't guarantee the frame pointer
    > is used in all functions.  Several targets always omit the frame
    > pointer in leaf functions.
    And what is says about -m[no-]omit-leaf-frame-pointer:
    > -momit-leaf-frame-pointer
    > -mno-omit-leaf-frame-pointer
    > Omit or keep the frame pointer in leaf functions.  The former behavior
    > is the default.
    So we should probably prevent both.

diff --git a/configure.ac b/configure.ac
index f3096aa34..b8175d4d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -316,7 +316,7 @@ if test "x$UBSAN_FLAGS$TSAN_FLAGS$ASAN_FLAGS$MSAN_FLAGS" != "x"; then
 		[Define to 1 if any sanitizer is enabled.])
-	SAN_CFLAGS="$SAN_FLAGS -fPIC -fPIE -fno-omit-frame-pointer"
+	SAN_CFLAGS="$SAN_FLAGS -fPIC -fPIE -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
 	CFLAGS="${CFLAGS} -Werror=unused-command-line-argument"

More information about the varnish-commit mailing list