Skip to content

Commit 8c5a38b

Browse files
committed
media-libs/libva: fix link with LLD 17
Upstream-PR: intel/libva#732 Signed-off-by: Violet Purcell <[email protected]>
1 parent 86ff5ce commit 8c5a38b

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From https://github.com/intel/libva/commit/17e07d17ba723a6b5822390afacdd3ccd976ecd2 Mon Sep 17 00:00:00 2001
2+
From: Violet Purcell <[email protected]>
3+
Date: Sun, 1 Oct 2023 16:34:19 -0400
4+
Subject: [PATCH] va: Fix -Wl,--version-script check with LLD 17
5+
6+
LLD 17 uses --no-undefined-version by default, so the check currently
7+
fails due to vaCreateSurface being undefined. This commit replaces that
8+
check with a generic check in the top level meson.build, using the
9+
conftest.syms file.
10+
11+
Signed-off-by: Violet Purcell <[email protected]>
12+
--- /dev/null
13+
+++ b/conftest.syms
14+
@@ -0,0 +1,6 @@
15+
+VERSION_1 {
16+
+ global:
17+
+ main;
18+
+ local:
19+
+ *;
20+
+};
21+
--- a/meson.build
22+
+++ b/meson.build
23+
@@ -87,6 +87,12 @@ dl_dep = cc.find_library('dl', required : false)
24+
WITH_DRM = not get_option('disable_drm') and (host_machine.system() != 'windows')
25+
libdrm_dep = dependency('libdrm', version : '>= 2.4.60', required : (host_machine.system() != 'windows'))
26+
27+
+ld_supports_version_script = cc.links(
28+
+ 'int main() { return 0; }',
29+
+ name : '-Wl,--version-script',
30+
+ args : ['-shared', '-Wl,--version-script,' + '@0@/@1@'.format(meson.current_source_dir(), 'conftest.syms')]
31+
+)
32+
+
33+
WITH_X11 = false
34+
if get_option('with_x11') != 'no'
35+
x11_dep = dependency('x11', required : get_option('with_x11') == 'yes')
36+
--- a/va/meson.build
37+
+++ b/va/meson.build
38+
@@ -60,7 +60,7 @@ libva_sym_arg = '-Wl,-version-script,' + '@0@/@1@'.format(meson.current_source_d
39+
40+
libva_link_args = []
41+
libva_link_depends = []
42+
-if cc.links('', name: '-Wl,--version-script', args: ['-shared', libva_sym_arg])
43+
+if ld_supports_version_script
44+
libva_link_args = libva_sym_arg
45+
libva_link_depends = libva_sym
46+
endif

media-libs/libva/libva-2.20.0.ebuild

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ MULTILIB_WRAPPED_HEADERS=(
4545
/usr/include/va/va_dricommon.h
4646
)
4747

48+
PATCHES=(
49+
"${FILESDIR}/libva-2.20.0-no-undefined-version.patch"
50+
)
51+
4852
multilib_src_configure() {
4953
local emesonargs=(
5054
-Ddriverdir="${EPREFIX}/usr/$(get_libdir)/va/drivers"

0 commit comments

Comments
 (0)