From 4c1a0c400f4a57bb51d663fcc3aa90014dd47df3 Mon Sep 17 00:00:00 2001 From: Olexa Bilaniuk Date: Sun, 21 Feb 2021 07:04:55 -0500 Subject: [CUDA] Bugfix: Forward sanitizer_*_args() methods to host compiler. Enables -Db_sanitize=undefined and company. Also serves as a testcase for NVCC comma-shielding: Because the test- case declares `b_sanitize=address,undefined`, the host GCC compiler needs `-fsanitize=address,undefined`, but this stands a danger of being split by NVCC when wrapped with `-Xcompiler=args,args`. Special, already-existing comma-shielding codepaths activate to prevent this splitting. Closes #8394. --- mesonbuild/compilers/cuda.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mesonbuild/compilers/cuda.py') diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index 4efe0c6..bbe6e95 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -625,6 +625,12 @@ class CudaCompiler(Compiler): # return self._to_host_flags(self.host_compiler.get_optimization_args(optimization_level)) return cuda_optimization_args[optimization_level] + def sanitizer_compile_args(self, value: str) -> T.List[str]: + return self._to_host_flags(self.host_compiler.sanitizer_compile_args(value)) + + def sanitizer_link_args(self, value: str) -> T.List[str]: + return self._to_host_flags(self.host_compiler.sanitizer_link_args(value)) + def get_debug_args(self, is_debug: bool) -> T.List[str]: return cuda_debug_args[is_debug] -- cgit v1.1