Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

va: fix --version-script detection for lld >= 17 #758

Merged
merged 1 commit into from
Jun 3, 2024

Commits on Jun 3, 2024

  1. va: fix --version-script detection for lld >= 17

    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:
    
        ld: error: va/libva.so.2.2000.0.p/va_compat.c.o: symbol
        vaCreateSurfaces@VA_API_0.32.0 has undefined version VA_API_0.32.0
    
    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:
    
        Checking if "-Wl,--version-script" : links: NO
    
    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` and `vaCreateSurfaces`, are undefined.
    
    Fix the problem by providing placeholder definitions for these symbols
    in the `code` argument to meson's `cc.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.
    
    Signed-off-by: Dimitry Andric <[email protected]>
    DimitryAndric authored and XinfengZhang committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    eaa7ebb View commit details
    Browse the repository at this point in the history