From 8e04bffbcfd5dc846e15c5e6471f96693ee698fe Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 6 Aug 2022 04:20:54 +0200 Subject: [PATCH] Automatically use execinfo for crash handler on *BSD and musl-based Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RĂ©mi Verschelde --- platform/linuxbsd/detect.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py index dfde0d249c2..86ae1f2d9c8 100644 --- a/platform/linuxbsd/detect.py +++ b/platform/linuxbsd/detect.py @@ -363,8 +363,10 @@ def configure(env: "Environment"): 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"])