commit 3b31153513b73ffa38a970e8ce62a59f376060c4
parent 93152f6c191d43beb7aa967448b7b90416bb0f78
Author: Mike Hommey <mh+mozilla@glandium.org>
Date: Thu, 8 Jan 2026 00:36:52 +0000
Bug 2008684 - Add the exception message when libclang is inadequate. r=firefox-build-system-reviewers,sergesanspaille
The typical message would be:
DEBUG: /path/to/.mozbuild/clang/lib/libclang.so: undefined symbol: clang_getAddressSpace
But in some cases, it can be something like:
DEBUG: libLLVM.so.21.1: cannot enable executable stack as shared object requires: Invalid argument
which is actually more useful for debugging purposes than the generic
error saying libclang is too old.
Differential Revision: https://phabricator.services.mozilla.com/D277969
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/build/moz.configure/bindgen.configure b/build/moz.configure/bindgen.configure
@@ -284,6 +284,7 @@ def bindgen_config_paths(clang, libclang, build_project):
@depends(bindgen_config_paths.libclang, when=bindgen_config_paths)
@checking("that libclang is new enough", lambda s: "yes" if s else "no")
+@imports(_from="__builtin__", _import="Exception")
@imports(_from="ctypes", _import="CDLL")
@imports(_from="textwrap", _import="dedent")
def min_libclang_version(libclang):
@@ -293,7 +294,8 @@ def min_libclang_version(libclang):
# Just accessing it should throw if not found.
fun = lib.clang_getAddressSpace
return True
- except:
+ except Exception as e:
+ log.debug(e)
die(
dedent(
"""\