Automatically use execinfo for crash handler on *BSD and musl-based Linux

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
(cherry picked from commit 8e04bffbcf)
This commit is contained in:
Hugo Locurcio 2022-08-06 04:20:54 +02:00 committed by Rémi Verschelde
parent 10073768cf
commit fc4d35432e
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -400,8 +400,10 @@ def configure(env):
if platform.system() == "Linux":
env.Append(LIBS=["dl"])
if platform.system().find("BSD") >= 0:
env["execinfo"] = True
if not env["execinfo"] and platform.libc_ver()[0] != "glibc":
# The default crash handler depends on glibc, so if the host uses
# a different libc (BSD libc, musl), fall back to libexecinfo.
print("Note: Using `execinfo=yes` for the crash handler as required on platforms where glibc is missing.")
if env["execinfo"]:
env.Append(LIBS=["execinfo"])