|
| 1 | +Upstream URL: https://github.com/intel/libva/pull/732 |
| 2 | +From 17e07d17ba723a6b5822390afacdd3ccd976ecd2 Mon Sep 17 00:00:00 2001 |
| 3 | +From: Violet Purcell < [email protected]> |
| 4 | +Date: Sun, 1 Oct 2023 16:34:19 -0400 |
| 5 | +Subject: [PATCH] va: Fix -Wl,--version-script check with LLD 17 |
| 6 | + |
| 7 | +LLD 17 uses --no-undefined-version by default, so the check currently |
| 8 | +fails due to vaCreateSurface being undefined. This commit replaces that |
| 9 | +check with a generic check in the top level meson.build, using the |
| 10 | +conftest.syms file. |
| 11 | + |
| 12 | +Signed-off-by: Violet Purcell < [email protected]> |
| 13 | +--- |
| 14 | + conftest.syms | 6 ++++++ |
| 15 | + meson.build | 6 ++++++ |
| 16 | + va/meson.build | 2 +- |
| 17 | + 3 files changed, 13 insertions(+), 1 deletion(-) |
| 18 | + create mode 100644 conftest.syms |
| 19 | + |
| 20 | +diff --git a/conftest.syms b/conftest.syms |
| 21 | +new file mode 100644 |
| 22 | +index 000000000..7d8590ff3 |
| 23 | +--- /dev/null |
| 24 | ++++ b/conftest.syms |
| 25 | +@@ -0,0 +1,6 @@ |
| 26 | ++VERSION_1 { |
| 27 | ++ global: |
| 28 | ++ main; |
| 29 | ++ local: |
| 30 | ++ *; |
| 31 | ++}; |
| 32 | +diff --git a/meson.build b/meson.build |
| 33 | +index 6acf90676..b37a85119 100644 |
| 34 | +--- a/meson.build |
| 35 | ++++ b/meson.build |
| 36 | +@@ -87,6 +87,12 @@ dl_dep = cc.find_library('dl', required : false) |
| 37 | + WITH_DRM = not get_option('disable_drm') and (host_machine.system() != 'windows') |
| 38 | + libdrm_dep = dependency('libdrm', version : '>= 2.4.60', required : (host_machine.system() != 'windows')) |
| 39 | + |
| 40 | ++ld_supports_version_script = cc.links( |
| 41 | ++ 'int main() { return 0; }', |
| 42 | ++ name : '-Wl,--version-script', |
| 43 | ++ args : ['-shared', '-Wl,--version-script,' + '@0@/@1@'.format(meson.current_source_dir(), 'conftest.syms')] |
| 44 | ++) |
| 45 | ++ |
| 46 | + WITH_X11 = false |
| 47 | + if get_option('with_x11') != 'no' |
| 48 | + x11_dep = dependency('x11', required : get_option('with_x11') == 'yes') |
| 49 | +diff --git a/va/meson.build b/va/meson.build |
| 50 | +index 372ae89ff..33c6cc8d3 100644 |
| 51 | +--- a/va/meson.build |
| 52 | ++++ b/va/meson.build |
| 53 | +@@ -60,7 +60,7 @@ libva_sym_arg = '-Wl,-version-script,' + '@0@/@1@'.format(meson.current_source_d |
| 54 | + |
| 55 | + libva_link_args = [] |
| 56 | + libva_link_depends = [] |
| 57 | +-if cc.links('', name: '-Wl,--version-script', args: ['-shared', libva_sym_arg]) |
| 58 | ++if ld_supports_version_script |
| 59 | + libva_link_args = libva_sym_arg |
| 60 | + libva_link_depends = libva_sym |
| 61 | + endif |
| 62 | + |
0 commit comments