forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
media-libs/libva: backport proposed upstream patch
Backport proposed upstream patch from intel/libva#732 Bug: https://bugs.gentoo.org/919505 Signed-off-by: Nicholas Vinson <[email protected]>
- Loading branch information
Showing
2 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
media-libs/libva/files/clang-17-version-script-check-fix.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Upstream URL: https://github.com/intel/libva/pull/732 | ||
From 17e07d17ba723a6b5822390afacdd3ccd976ecd2 Mon Sep 17 00:00:00 2001 | ||
From: Violet Purcell <[email protected]> | ||
Date: Sun, 1 Oct 2023 16:34:19 -0400 | ||
Subject: [PATCH] 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]> | ||
--- | ||
conftest.syms | 6 ++++++ | ||
meson.build | 6 ++++++ | ||
va/meson.build | 2 +- | ||
3 files changed, 13 insertions(+), 1 deletion(-) | ||
create mode 100644 conftest.syms | ||
|
||
diff --git a/conftest.syms b/conftest.syms | ||
new file mode 100644 | ||
index 000000000..7d8590ff3 | ||
--- /dev/null | ||
+++ b/conftest.syms | ||
@@ -0,0 +1,6 @@ | ||
+VERSION_1 { | ||
+ global: | ||
+ main; | ||
+ local: | ||
+ *; | ||
+}; | ||
diff --git a/meson.build b/meson.build | ||
index 6acf90676..b37a85119 100644 | ||
--- a/meson.build | ||
+++ b/meson.build | ||
@@ -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') | ||
diff --git a/va/meson.build b/va/meson.build | ||
index 372ae89ff..33c6cc8d3 100644 | ||
--- a/va/meson.build | ||
+++ b/va/meson.build | ||
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters