Skip to content

Commit 287fd3c

Browse files
committed
media-libs/libva: backport proposed upstream patch
Backport proposed upstream patch from intel/libva#732 Fixes Gentoo bug: 919505 ( https://bugs.gentoo.org/919505 ) Signed-off-by: Nicholas Vinson <nvinson234@gmail.com>
1 parent 6486bf8 commit 287fd3c

2 files changed

Lines changed: 66 additions & 1 deletion

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From 17e07d17ba723a6b5822390afacdd3ccd976ecd2 Mon Sep 17 00:00:00 2001
2+
From: Violet Purcell <vimproved@inventati.org>
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 <vimproved@inventati.org>
12+
---
13+
conftest.syms | 6 ++++++
14+
meson.build | 6 ++++++
15+
va/meson.build | 2 +-
16+
3 files changed, 13 insertions(+), 1 deletion(-)
17+
create mode 100644 conftest.syms
18+
19+
diff --git a/conftest.syms b/conftest.syms
20+
new file mode 100644
21+
index 000000000..7d8590ff3
22+
--- /dev/null
23+
+++ b/conftest.syms
24+
@@ -0,0 +1,6 @@
25+
+VERSION_1 {
26+
+ global:
27+
+ main;
28+
+ local:
29+
+ *;
30+
+};
31+
diff --git a/meson.build b/meson.build
32+
index 6acf90676..b37a85119 100644
33+
--- a/meson.build
34+
+++ b/meson.build
35+
@@ -87,6 +87,12 @@ dl_dep = cc.find_library('dl', required : false)
36+
WITH_DRM = not get_option('disable_drm') and (host_machine.system() != 'windows')
37+
libdrm_dep = dependency('libdrm', version : '>= 2.4.60', required : (host_machine.system() != 'windows'))
38+
39+
+ld_supports_version_script = cc.links(
40+
+ 'int main() { return 0; }',
41+
+ name : '-Wl,--version-script',
42+
+ args : ['-shared', '-Wl,--version-script,' + '@0@/@1@'.format(meson.current_source_dir(), 'conftest.syms')]
43+
+)
44+
+
45+
WITH_X11 = false
46+
if get_option('with_x11') != 'no'
47+
x11_dep = dependency('x11', required : get_option('with_x11') == 'yes')
48+
diff --git a/va/meson.build b/va/meson.build
49+
index 372ae89ff..33c6cc8d3 100644
50+
--- a/va/meson.build
51+
+++ b/va/meson.build
52+
@@ -60,7 +60,7 @@ libva_sym_arg = '-Wl,-version-script,' + '@0@/@1@'.format(meson.current_source_d
53+
54+
libva_link_args = []
55+
libva_link_depends = []
56+
-if cc.links('', name: '-Wl,--version-script', args: ['-shared', libva_sym_arg])
57+
+if ld_supports_version_script
58+
libva_link_args = libva_sym_arg
59+
libva_link_depends = libva_sym
60+
endif
61+

media-libs/libva/libva-2.20.0.ebuild

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 1999-2023 Gentoo Authors
1+
# Copyright 1999-2024 Gentoo Authors
22
# Distributed under the terms of the GNU General Public License v2
33

44
EAPI=8
@@ -48,6 +48,10 @@ MULTILIB_WRAPPED_HEADERS=(
4848
/usr/include/va/va_dricommon.h
4949
)
5050

51+
PATCHES=(
52+
"${FILESDIR}/clang-17-version-script-check-fix.patch"
53+
)
54+
5155
multilib_src_configure() {
5256
local emesonargs=(
5357
-Ddriverdir="${EPREFIX}/usr/$(get_libdir)/va/drivers"

0 commit comments

Comments
 (0)