diff --git a/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in b/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in index 4484573801bd2..c26008df2a073 100644 --- a/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in +++ b/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in @@ -51,7 +51,7 @@ config.substitutions.append(('%{link_flags}', '-nostdlib++ -L %{lib} -lc++ -lc++abi -lunwind' )) config.substitutions.append(('%{exec}', - '%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}" -- ' + f'%{{executor}} --execdir %T --env DYLD_LIBRARY_PATH="%{{cxx-runtime-root}}:%{{abi-runtime-root}}:%{{unwind-runtime-root}}"{config.extra_executor_env} -- ' )) config.stdlib = 'apple-libc++' diff --git a/libunwind/test/configs/cmake-bridge.cfg.in b/libunwind/test/configs/cmake-bridge.cfg.in index c5f34c87abb92..ef48e5eba27fb 100644 --- a/libunwind/test/configs/cmake-bridge.cfg.in +++ b/libunwind/test/configs/cmake-bridge.cfg.in @@ -28,6 +28,14 @@ if @LIBUNWIND_USES_ARM_EHABI@: if not @LIBUNWIND_ENABLE_THREADS@: config.available_features.add('libunwind-no-threads') +config.extra_executor_env = "" +if "Memory" in getattr(config, "use_sanitizer", ""): + # Avoid calling back into libunwind if we detect a MSan error + config.extra_executor_env += " --env MSAN_OPTIONS=fast_unwind_on_fatal=1" +if "Address" in getattr(config, "use_sanitizer", ""): + # Avoid calling back into libunwind if we detect an ASan error + config.extra_executor_env += " --env ASAN_OPTIONS=fast_unwind_on_fatal=1" + # Add substitutions for bootstrapping the test suite configuration import shlex config.substitutions.append(('%{cxx}', shlex.quote('@CMAKE_CXX_COMPILER@'))) diff --git a/libunwind/test/configs/ibm-libunwind-shared.cfg.in b/libunwind/test/configs/ibm-libunwind-shared.cfg.in index c38d278ad2c9c..d70534a9e3dd3 100644 --- a/libunwind/test/configs/ibm-libunwind-shared.cfg.in +++ b/libunwind/test/configs/ibm-libunwind-shared.cfg.in @@ -11,7 +11,7 @@ config.substitutions.append(('%{link_flags}', '-nostdlib++ -L %{lib} -lunwind -ldl -Wl,-bbigtoc' )) config.substitutions.append(('%{exec}', - '%{executor} --execdir %T --env LIBPATH=%{lib} -- ' + f'%{{executor}} --execdir %T --env LIBPATH=%{{lib}}{config.extra_executor_env} -- ' )) import os, site diff --git a/libunwind/test/configs/llvm-libunwind-merged.cfg.in b/libunwind/test/configs/llvm-libunwind-merged.cfg.in index 38b79840c9fe2..e15336ceb1eee 100644 --- a/libunwind/test/configs/llvm-libunwind-merged.cfg.in +++ b/libunwind/test/configs/llvm-libunwind-merged.cfg.in @@ -32,7 +32,7 @@ config.substitutions.append(('%{link_flags}', '-L %{{lib}} -Wl,-rpath,%{{lib}} -lc++ {}'.format(' '.join(link_flags)) )) config.substitutions.append(('%{exec}', - '%{executor} --execdir %T -- ' + f'%{{executor}} --execdir %T{config.extra_executor_env}-- ' )) import os, site diff --git a/libunwind/test/configs/llvm-libunwind-mingw.cfg.in b/libunwind/test/configs/llvm-libunwind-mingw.cfg.in index 33d061a3efc6f..900c2279d72b5 100644 --- a/libunwind/test/configs/llvm-libunwind-mingw.cfg.in +++ b/libunwind/test/configs/llvm-libunwind-mingw.cfg.in @@ -11,7 +11,7 @@ config.substitutions.append(('%{link_flags}', '-L %{lib} -lunwind' )) config.substitutions.append(('%{exec}', - '%{executor} --execdir %T --prepend_env PATH=%{lib} -- ' + f'%{{executor}} --execdir %T --prepend_env PATH=%{{lib}}{config.extra_executor_env} -- ' )) import os, site diff --git a/libunwind/test/configs/llvm-libunwind-shared.cfg.in b/libunwind/test/configs/llvm-libunwind-shared.cfg.in index 13896aeb13bc4..8c3891986ab7f 100644 --- a/libunwind/test/configs/llvm-libunwind-shared.cfg.in +++ b/libunwind/test/configs/llvm-libunwind-shared.cfg.in @@ -31,7 +31,7 @@ config.substitutions.append(('%{link_flags}', '-L %{{lib}} -Wl,-rpath,%{{lib}} -lunwind {}'.format(' '.join(link_flags)) )) config.substitutions.append(('%{exec}', - '%{executor} --execdir %T -- ' + f'%{{executor}} --execdir %T{config.extra_executor_env} -- ' )) import os, site diff --git a/libunwind/test/configs/llvm-libunwind-static.cfg.in b/libunwind/test/configs/llvm-libunwind-static.cfg.in index 50b64dc665a5a..a39eb34215157 100644 --- a/libunwind/test/configs/llvm-libunwind-static.cfg.in +++ b/libunwind/test/configs/llvm-libunwind-static.cfg.in @@ -34,7 +34,7 @@ config.substitutions.append(('%{link_flags}', '%{{lib}}/libunwind.a {}'.format(' '.join(link_flags)) )) config.substitutions.append(('%{exec}', - '%{executor} --execdir %T -- ' + f'%{{executor}} --execdir %T{config.extra_executor_env} -- ' )) import os, site