[PATCH v2] meson: Stop detecting -Wl,--version-script=

Michal Privoznik posted 1 patch 1 year, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/b226e2101034f41bf874f3a89e408dbf4781069f.1679392764.git.mprivozn@redhat.com
meson.build | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
[PATCH v2] meson: Stop detecting -Wl,--version-script=
Posted by Michal Privoznik 1 year, 1 month ago
With its version 16.0, the LLVM's linker turned on
--no-undefined-version by default [1]. This breaks how we detect
--version-script= detection, because at the compile time there's
no library built yet that we can use to make --version-script=
happy. Unfortunately, meson does not provide a way to detect this
either [2].

But there's not much sense in detecting the argument either. We
already special case some systems (windows, darwin) and do the
check for others, which are expected to support versioned
symbols, because of ELF. Worst case scenario - the error is
reported during compile time rather than configure time.

1: https://reviews.llvm.org/D135402
2: https://github.com/mesonbuild/meson/issues/3047

Resolves: https://bugs.gentoo.org/902211
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

v2 of:

https://listman.redhat.com/archives/libvir-list/2023-March/238923.html

diff to v1:
- Instead of fixing the detection, drop it completely.

 meson.build | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/meson.build b/meson.build
index c35823a79a..a0682e8d0b 100644
--- a/meson.build
+++ b/meson.build
@@ -534,12 +534,7 @@ elif host_machine.system() == 'darwin'
   # macOS libraries don't support symbol versioning
   version_script_flags = ''
 else
-  test_file = '@0@/src/libvirt_qemu.syms'.format(meson.project_source_root())
-  if cc.has_link_argument('-Wl,--version-script=@0@'.format(test_file))
-    version_script_flags = '-Wl,--version-script='
-  else
-    error('No supported version script link argument found.')
-  endif
+  version_script_flags = '-Wl,--version-script='
 endif
 
 libvirt_flat_namespace = []
-- 
2.39.2
Re: [PATCH v2] meson: Stop detecting -Wl,--version-script=
Posted by Daniel P. Berrangé 1 year, 1 month ago
On Tue, Mar 21, 2023 at 11:00:16AM +0100, Michal Privoznik wrote:
> With its version 16.0, the LLVM's linker turned on
> --no-undefined-version by default [1]. This breaks how we detect
> --version-script= detection, because at the compile time there's
> no library built yet that we can use to make --version-script=
> happy. Unfortunately, meson does not provide a way to detect this
> either [2].
> 
> But there's not much sense in detecting the argument either. We
> already special case some systems (windows, darwin) and do the
> check for others, which are expected to support versioned
> symbols, because of ELF. Worst case scenario - the error is
> reported during compile time rather than configure time.
> 
> 1: https://reviews.llvm.org/D135402
> 2: https://github.com/mesonbuild/meson/issues/3047
> 
> Resolves: https://bugs.gentoo.org/902211
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> 
> v2 of:
> 
> https://listman.redhat.com/archives/libvir-list/2023-March/238923.html
> 
> diff to v1:
> - Instead of fixing the detection, drop it completely.
> 
>  meson.build | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|