diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-07-18 21:20:32 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2023-08-07 05:44:08 -0700 |
commit | 926c3a69195385bd5c16acd269f4dae5322e0c03 (patch) | |
tree | 38aecac74189f1243b597585dad8ef5200ff0a40 /test cases/rust | |
parent | 9df16279971b48787c1db232c274054f173531df (diff) | |
download | meson-926c3a69195385bd5c16acd269f4dae5322e0c03.zip meson-926c3a69195385bd5c16acd269f4dae5322e0c03.tar.gz meson-926c3a69195385bd5c16acd269f4dae5322e0c03.tar.bz2 |
Error when an installed static library links to internal custom target
When an installed static library A links to an internal static library B
built using a custom_target(), raise an error instead of a warning. This
is because to be usable, A needs to contain B which would require to
extract the archive to get its objects files.
This used to work, but was printing a warning and was installing a
broken static library, because we used to overlink in many cases, and
that got fixed in Meson 1.2.0. It now fails at link time with symbols
from the custom target not being defined. It's better to turn the
warning into a hard error at configure time.
While at it, noticed this situation can happen for any internal custom
or rust target we link to, recursively.
get_internal_static_libraries_recurse() could be called on CustomTarget
objects which do not implement it, and even if we did not call that
method, it would still fail when trying to call extract_all_objects() on
it.
Fixes: #12006
Diffstat (limited to 'test cases/rust')
-rw-r--r-- | test cases/rust/5 polyglot static/meson.build | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test cases/rust/5 polyglot static/meson.build b/test cases/rust/5 polyglot static/meson.build index 5d1f023..54f383c 100644 --- a/test cases/rust/5 polyglot static/meson.build +++ b/test cases/rust/5 polyglot static/meson.build @@ -7,7 +7,7 @@ r = static_library('stuff', 'stuff.rs', rust_crate_type : 'staticlib') # as it would do with C libraries, but then cannot extract objects from stuff and # thus should error out. # FIXME: We should support this use-case in the future. -testcase expect_error('Cannot link_whole a custom or Rust target into a static library') +testcase expect_error('Cannot link_whole a custom or Rust target \'stuff\' into a static library \'clib\'. Instead, pass individual object files with the "objects:" keyword argument if possible. Meson had to promote link to link_whole because \'clib\' is installed but not \'stuff\', and thus has to include objects from \'stuff\' to be usable.') l = static_library('clib', 'clib.c', link_with : r, install : true) endtestcase |