summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build3
-rw-r--r--test/py/meson.build6
2 files changed, 9 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 63e45465..e3052260 100644
--- a/meson.build
+++ b/meson.build
@@ -112,6 +112,8 @@ common_arguments = [
c_arguments = []
cpp_arguments = []
+cxx_stdlib = 'libstdc++'
+
if cc.get_id() == 'clang'
if cc.version().version_compare('<9')
error('clang version is too old, libcamera requires 9.0 or newer')
@@ -137,6 +139,7 @@ if cc.get_id() == 'clang'
cpp_arguments += [
'-stdlib=libc++',
]
+ cxx_stdlib = 'libc++'
endif
cpp_arguments += [
diff --git a/test/py/meson.build b/test/py/meson.build
index 481bb481..b922e857 100644
--- a/test/py/meson.build
+++ b/test/py/meson.build
@@ -24,6 +24,12 @@ py_env.append('PYTHONPATH', pypathdir)
if asan_enabled
py_env.append('LD_PRELOAD', asan_runtime)
+ # Preload the C++ standard library to work around a bug in ASan when
+ # dynamically loading C++ .so modules.
+ stdlib = run_command(cxx, '-print-file-name=' + cxx_stdlib + '.so',
+ check : true).stdout().strip()
+ py_env.append('LD_PRELOAD', stdlib)
+
# Disable leak detection as the Python interpreter is full of leaks.
py_env.append('ASAN_OPTIONS', 'detect_leaks=0')
endif