From 7fc10583c6feb813182be41e1087dac94528a986 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Thu, 28 Jul 2022 23:15:48 -0400 Subject: [PATCH] Disable -Wl,-z,defs in ASAN build (#21381) Shared libraries built with address sanitizer have some unresolved symbols created by the instrumentation. These will be provided by the executable. This is by design but trips an unresolved symbol diagnostic. Disable these strictures when ASAN is enabled. --- build/config/compiler/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 0d7e48403bd3c0..c23d35bd8b496b 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -262,7 +262,7 @@ config("strict_warnings") { ] } - if (current_os == "linux" || current_os == "android") { + if (!is_asan && (current_os == "linux" || current_os == "android")) { ldflags += [ "-Wl,-z,defs" ] } }