]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: Allow undefined symbols when sanitizers are enabled
authorTim Wiederhake <twiederh@redhat.com>
Thu, 6 May 2021 15:08:33 +0000 (17:08 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 14 Jun 2021 10:05:41 +0000 (12:05 +0200)
When enabling sanitizers, clang adds some function symbols when
instrumenting the code. The exact names of those functions are an
implementation detail and should therefore not be added to any
syms file. This patch prevents build failures due to those symbols
not present in the syms file when building with sanitizers enabled.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
meson.build

index 5849975a729dd17282f5ea1f5e97cf80f1fcb583..eba6d9f7652de333cb9bd10fa9127dacc658d9f4 100644 (file)
@@ -491,9 +491,12 @@ libvirt_nodelete = cc.get_supported_link_arguments([
   '-Wl,-z,nodelete',
 ])
 
-libvirt_no_undefined = cc.get_supported_link_arguments([
-  '-Wl,-z,defs',
-])
+libvirt_no_undefined = []
+if get_option('b_sanitize') == 'none'
+  libvirt_no_undefined += cc.get_supported_link_arguments([
+    '-Wl,-z,defs',
+  ])
+endif
 
 libvirt_no_indirect = cc.get_supported_link_arguments([
   '-Wl,--no-copy-dt-needed-entries',