diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-08-15 14:48:32 -0700 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-08-24 22:50:35 -0400 |
commit | c94c492089e7fecb56b7cc11ea76712a770f1e34 (patch) | |
tree | 39d5db23379cd7e857fcef9a060cbd87b6730185 /mesonbuild/compilers/compilers.py | |
parent | c02d7fe119b8f936d10741e73abbc40a4a450ce5 (diff) | |
download | meson-c94c492089e7fecb56b7cc11ea76712a770f1e34.zip meson-c94c492089e7fecb56b7cc11ea76712a770f1e34.tar.gz meson-c94c492089e7fecb56b7cc11ea76712a770f1e34.tar.bz2 |
build: don't add targets to link_whole_targets if we took their objects
What happens is this:
- liba is a convenience static library
- libb is an installed static library
- libb links in liba with --link-whole
- libc links to libb
- we generate a link line with libb *and* liba, even though libb is a
strict superset of liba
This is a bug that has existed since the we stopped using link-whole to
combine convenience libraries, and to instead propagate their
dependencies up. For most linkers this is harmless, if inefficient.
However, for apple's ld64 with the addition calling `ranlib -c`, this
ends up causing multiple copies of symbols to clash (I think that other
linkers recognize that these symbols are the same and combine them), and
linking to fail.
The fix is to stop adding libraries to a target's `link_whole_targets`
when we take its objects instead. This is an all around win since it
fixes this bug, shortens linker command lines, and avoids opening
archives that no new symbols will be found in anyway.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
0 files changed, 0 insertions, 0 deletions