summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-11-06 13:52:51 -0500
committerXavier Claessens <xavier.claessens@collabora.com>2023-11-09 16:20:01 -0500
commitd25d8e2772b92838299b4f4056fe3888c10c0ee7 (patch)
tree54860c02283c20c6b4d81f104bb427267af241d4 /docs
parentd0a7a203a6edb570c36a9fb5f04a3541df2be687 (diff)
downloadmeson-d25d8e2772b92838299b4f4056fe3888c10c0ee7.tar.gz
rust: Fix linking with C libraries (again)
Pass link arguments directly down to linker by using `-C link-args=` instead of letting rustc/linker resolve `-l` arguments. This solves problems with e.g. +verbatim not being portable. Note that we also pass `-l` args as `-Clink-args=-l` because rustc would otherwise reorder arguments and put `-lstdc++` before `-Clink-args=libfoo++.a`. However, when building a rlib/staticlib we should still use `-l` arguments because that allows rustc to bundle static libraries we link-whole. In that case, since there is no platform specific dynamic linker, +verbatim works. This also fix installed staticlib that now bundle uninstalled static libraries it links to (recursively). This is done by putting them all into self.link_whole_targets instead of putting their objects into self.objects, and let rustc do the bundling. This has the extra advantage that rustc can bundle static libries built with CustomTarget. Disable bundling in all other cases, otherwise we could end up with duplicated objects in static libraries, in diamond dependency graph case. Fixes: #12484
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions