Skip to content

Commit

Permalink
va: Fix -Wl,--version-script check with LLD 17
Browse files Browse the repository at this point in the history
LLD 17 uses --no-undefined-version by default, so the check currently
fails due to vaCreateSurface being undefined. This commit replaces that
check with a generic check in the top level meson.build, using the
conftest.syms file.

Signed-off-by: Violet Purcell <vimproved@inventati.org>
  • Loading branch information
vimproved committed Oct 1, 2023
1 parent 53e459d commit 17e07d1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions conftest.syms
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
VERSION_1 {
global:
main;
local:
*;
};
6 changes: 6 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ dl_dep = cc.find_library('dl', required : false)
WITH_DRM = not get_option('disable_drm') and (host_machine.system() != 'windows')
libdrm_dep = dependency('libdrm', version : '>= 2.4.60', required : (host_machine.system() != 'windows'))

ld_supports_version_script = cc.links(
'int main() { return 0; }',
name : '-Wl,--version-script',
args : ['-shared', '-Wl,--version-script,' + '@0@/@1@'.format(meson.current_source_dir(), 'conftest.syms')]
)

WITH_X11 = false
if get_option('with_x11') != 'no'
x11_dep = dependency('x11', required : get_option('with_x11') == 'yes')
Expand Down
2 changes: 1 addition & 1 deletion va/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ libva_sym_arg = '-Wl,-version-script,' + '@0@/@1@'.format(meson.current_source_d

libva_link_args = []
libva_link_depends = []
if cc.links('', name: '-Wl,--version-script', args: ['-shared', libva_sym_arg])
if ld_supports_version_script
libva_link_args = libva_sym_arg
libva_link_depends = libva_sym
endif
Expand Down

0 comments on commit 17e07d1

Please sign in to comment.