va: fix --version-script detection for lld >= 17 #758
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When building libva with lld (the llvm-project linker), version 17 or later, an error similar to the following is emitted when linking libva.so:
The root cause is that lld 17 checks linker version scripts more strictly by default, and emits an error when undefined symbols or undefined versions are referenced.
Earlier in the build, it turns out that due to these lld errors, va's meson.build fails to detect
--version-script
support:This is because the small test program used by meson to check whether a shared library can be linked with the
libva.syms
version script is completely empty, and therefore the two symbols in the version script,vaCreateSurfaces_0_32_0
andvaCreateSurfaces
, are undefined.Fix the problem by providing placeholder definitions for these symbols in the
code
argument to meson'scc.links()
function. This ensures that meson correctly detects--version-script
support with lld version 17 or later, and makes it possible to link the libva shared library.