BUILD: makefile: enable backtrace by default on musl
authorWilly Tarreau <w@1wt.eu>
Thu, 17 Apr 2025 14:11:14 +0000 (16:11 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 27 May 2025 13:13:22 +0000 (15:13 +0200)
commitbb1eb4f117865b8cba66cacafb721c4f67d6c28e
tree22f24329cfecc054e9292b44be00d8d6f0ccd075
parent1dc76f39f39ffd649ece8e08a6a4bc9c68ae8b39
BUILD: makefile: enable backtrace by default on musl

The reason musl builds was not producing exploitable backtraces was
that the toolchain used appears to automatically omit the frame pointer
at -O2 but leaves it at -O0. This patch just makes sure to always append
-fno-omit-frame-pointer to the BACKTRACE cflags and enables the option
with musl where it now works. This will allow us to finally get
exploitable traces from docker images where core dumps are not always
available.

(cherry picked from commit f499fa3dcd24b5a17ed97842f5e867bd37739754)
[wt: this should be progressively backported to 3.0 or maybe even 2.8
 since a few users have already reported hard-to-debug issues in Docker]
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit d510825598bd5bf28d0c95b8ad5cc2873b4300c8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
Makefile