[libvirt PATCH 2/6] meson: Allow undefined symbols when sanitizers are enabled
Pavel Hrdina
phrdina at redhat.com
Mon May 3 11:18:42 UTC 2021
On Mon, May 03, 2021 at 12:01:42PM +0200, Tim Wiederhake wrote:
> 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 at redhat.com>
> ---
> meson.build | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/meson.build b/meson.build
> index bbdbe4afd8..56c1294e7f 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -497,6 +497,11 @@ libvirt_no_indirect = cc.get_supported_link_arguments([
> '-Wl,--no-copy-dt-needed-entries',
> ])
>
> +if get_option('b_sanitize') not in [ '', 'none' ]
> + # sanitizers may add additional symbols
> + libvirt_no_undefined = []
> +endif
Same as in the previous patch no need to check for empty string.
Overwriting libvirt_no_undefined = [] at a different place then it is
defined looks wrong to me. How about this:
libvirt_no_undefined = []
if get_option('b_sanitize') == 'none':
libvirt_no_undefined = cc.get_supported_link_arguments([
'-Wl,-z,defs',
])
endif
This makes it cleaner IMHO as the complete logic is at a single place
and also we will save one check for supported link arguments if we now
that we don't want to use it.
Pavel
> if host_machine.system() == 'windows'
> version_script_flags = '-Wl,'
> else
> --
> 2.26.3
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210503/39b0a603/attachment-0001.sig>
More information about the libvir-list
mailing list