meson: control using LD Version Scripts
LD version scripts are meant to be used when visibility attributes can't be used*, and have compatibility issues with other linkers. When a symbol in the linker script is missing, LD will ignore it, mold will warn, and LLD will error. This patch is only an optional flag for now in-case of packagers using these scripts and due to an issue between rust + meson 1 2. Although the size difference in rusticl is negligible, (114M v 117M), it still exposes internal details.
*if only using the global & local sections, as is done in mesa. For specific version
sections, the symver
attribute is the replacement, which clang doesn't support yet.
This should provide a potential fix for #8003 (closed) and #8359
For more information see:
- https://www.gnu.org/software/gnulib/manual/html_node/LD-Version-Scripts.html
- Section 2.2.5 in Ulrich Drepper’s paper, which is linked in the above manual page
- https://github.com/llvm/llvm-project/issues/60859
- https://gcc.gnu.org/wiki/Visibility
Edited by Julia Tatz