Skip to content

Commit 17e07d1

Browse files
committed
va: Fix -Wl,--version-script check with LLD 17
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 <[email protected]>
1 parent 53e459d commit 17e07d1

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

conftest.syms

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
VERSION_1 {
2+
global:
3+
main;
4+
local:
5+
*;
6+
};

meson.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ dl_dep = cc.find_library('dl', required : false)
8787
WITH_DRM = not get_option('disable_drm') and (host_machine.system() != 'windows')
8888
libdrm_dep = dependency('libdrm', version : '>= 2.4.60', required : (host_machine.system() != 'windows'))
8989

90+
ld_supports_version_script = cc.links(
91+
'int main() { return 0; }',
92+
name : '-Wl,--version-script',
93+
args : ['-shared', '-Wl,--version-script,' + '@0@/@1@'.format(meson.current_source_dir(), 'conftest.syms')]
94+
)
95+
9096
WITH_X11 = false
9197
if get_option('with_x11') != 'no'
9298
x11_dep = dependency('x11', required : get_option('with_x11') == 'yes')

va/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ libva_sym_arg = '-Wl,-version-script,' + '@0@/@1@'.format(meson.current_source_d
6060

6161
libva_link_args = []
6262
libva_link_depends = []
63-
if cc.links('', name: '-Wl,--version-script', args: ['-shared', libva_sym_arg])
63+
if ld_supports_version_script
6464
libva_link_args = libva_sym_arg
6565
libva_link_depends = libva_sym
6666
endif

0 commit comments

Comments
 (0)