Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 915200

Summary: media-libs/libva-2.19.0 fails to link with clang-17: ld.lld: error: va/libva.so.2.1900.0.p/va_compat.c.o: symbol vaCreateSurfaces@VA_API_0.32.0 has undefined version VA_API_0.32.0
Product: Gentoo Linux Reporter: ppw0
Component: Current packagesAssignee: VA-API Project <vaapi>
Status: RESOLVED FIXED    
Severity: normal CC: amit.ugol, contyk, gentoo.qxrin, juippis, parona, toralf
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/intel/libva/pull/758
https://github.com/intel/libva/pull/732
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 731004, 912821    
Attachments: build log
emerge --info

Description ppw0 2023-10-05 09:39:26 UTC
Created attachment 872154 [details]
build log

In a clang-17[default-libcxx] environment, media-libs/libva-2.19.0 will fail to link during emerge with the following error message:

```
FAILED: va/libva.so.2.1900.0 
clang  -o va/libva.so.2.1900.0 va/libva.so.2.1900.0.p/va.c.o va/libva.so.2.1900.0.p/va_compat.c.o va/libva.so.2.1900.0.p/va_str.c.o va/libva.so.2.1900.0.p/va_trace.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libva.so.2 -O2 -march=native -pipe -Wl,-O2 -Wl,--as-needed -ldl -Wl,--end-group
ld.lld: error: va/libva.so.2.1900.0.p/va_compat.c.o: symbol vaCreateSurfaces@VA_API_0.32.0 has undefined version VA_API_0.32.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
```

This can be avoided by passing "-Wl,--undefined-version" to LDFLAGS.

Attaching logs.
Comment 1 ppw0 2023-10-05 09:39:43 UTC
Created attachment 872155 [details]
emerge --info
Comment 2 jospezial 2023-10-09 12:27:56 UTC
https://github.com/intel/libva/pull/758

Just released libva-2.20.0 will possibly fail the same.
Comment 3 Brahmajit Das 2023-10-11 08:35:46 UTC
Reproducible with media-libs/libva-2.20.0
Comment 4 Alfred Wingate 2024-04-06 19:52:25 UTC
*** Bug 928752 has been marked as a duplicate of this bug. ***
Comment 5 Joonas Niilola gentoo-dev 2024-05-01 07:31:56 UTC
Still getting this with media-libs/libva-2.21.0

The patch https://patch-diff.githubusercontent.com/raw/intel/libva/pull/758.patch from https://github.com/intel/libva/pull/758 fixes compilation at least.
Comment 6 Amit Ugol 2024-05-05 05:55:45 UTC
can confirm that the patch 'fixed' compilation for media-libs/libva-2.21.0 on clang version 18.1.4+libcxx
Comment 7 Larry the Git Cow gentoo-dev 2024-05-06 14:40:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6008de38ffbf328bb331f19a3ed71fda97af502d

commit 6008de38ffbf328bb331f19a3ed71fda97af502d
Author:     Violet Purcell <vimproved@inventati.org>
AuthorDate: 2023-10-12 19:20:50 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2024-05-06 14:40:05 +0000

    media-libs/libva: fix link with LLD 17
    
    Upstream-PR: https://github.com/intel/libva/pull/732
    Closes: https://bugs.gentoo.org/915200
    Closes: https://github.com/gentoo/gentoo/pull/33314
    Signed-off-by: Violet Purcell <vimproved@inventati.org>
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 .../files/libva-2.21.0-no-undefined-version.patch  | 46 ++++++++++++++++++++++
 media-libs/libva/libva-2.21.0.ebuild               |  4 ++
 2 files changed, 50 insertions(+)