From d19992202543ebb810609c074f754b5ec48c0fd7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 11 Nov 2020 01:06:00 +0100 Subject: Don't add Wl,--no-undefined when using sanitizers This causes linker errors at runtime. --- extras/autowaf.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extras/autowaf.py b/extras/autowaf.py index 01d6503..e528fdd 100644 --- a/extras/autowaf.py +++ b/extras/autowaf.py @@ -572,7 +572,14 @@ def configure(conf): conf.env.append_value('LINKFLAGS', '/nologo') elif Options.options.strict: if conf.env.DEST_OS != "darwin": - conf.env.append_value('LINKFLAGS', ['-Wl,--no-undefined']) + sanitizing = False + for f in conf.env.LINKFLAGS: + if f.startswith('-fsanitize'): + sanitizing = True + break; + + if not sanitizing: + conf.env.append_value('LINKFLAGS', ['-Wl,--no-undefined']) # Add less universal flags after checking they work extra_flags = ['-Wlogical-op', -- cgit v1.2.1