diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2022-02-14 22:02:35 +0530 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-02-14 23:30:24 -0500 |
commit | 2d56ff135e6e0f3cdf455797a6561796a8c1b7b4 (patch) | |
tree | 26078410b16d584f0e02b72181d4f98b7b34bb6c /docs | |
parent | 39f61795ca1ae7de3c4c1fc08f88b3d864502cec (diff) | |
download | meson-2d56ff135e6e0f3cdf455797a6561796a8c1b7b4.zip meson-2d56ff135e6e0f3cdf455797a6561796a8c1b7b4.tar.gz meson-2d56ff135e6e0f3cdf455797a6561796a8c1b7b4.tar.bz2 |
shared module: Allow linking on Android
Android requires shared modules that use symbols from other shared
modules to be linked before they can be dlopen()ed in the correct
order. Not doing so leads to a missing symbol error:
https://github.com/android/ndk/issues/201
We need to always allow linking for this. Also add a soname, although
it's not confirmed that it's needed, and it doesn't really hurt if it
isn't needed.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/yaml/functions/shared_module.yaml | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/docs/yaml/functions/shared_module.yaml b/docs/yaml/functions/shared_module.yaml index ff374e7..20bd5c4 100644 --- a/docs/yaml/functions/shared_module.yaml +++ b/docs/yaml/functions/shared_module.yaml @@ -15,12 +15,18 @@ description: | notes: - | - *Linking to a shared module is deprecated, and will be an error in the future*. - It used to be allowed because it was the only way to have a shared-library-like target that + *Linking to a shared module on platforms other than Android is deprecated, and will be an error + in the future*. + It was previously allowed because it was the only way to have a shared-library-like target that contained references to undefined symbols. However, since 0.40.0, the `override_options:` - [[build_target]] keyword argument can be used to create such a [[shared_library]], and shared - modules have other characteristics that make them incompatible with linking, such as a lack of - SONAME. Linking to shared modules also does not work on some platforms, such as on macOS / iOS. + [[build_target]] keyword argument can be used to create such a [[shared_library]] by passing + `override_options: 'b_lundef=false'`. Shared modules have other characteristics that make + them incompatible with linking, such as a lack of SONAME. + On macOS and iOS, linking to shared modules is disallowed by the linker, so we disallow it at + configure time. + On Android, if a shared module `foo` uses symbols from another shared module `bar`, `foo` must + also be linked to `bar`. Hence, linking one shared module to another will always be allowed when + building for Android. posargs_inherit: _build_target_base varargs_inherit: _build_target_base |