diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-06-02 18:12:10 +0100 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-06-07 12:57:39 +0000 |
commit | 1f5c6d62bf1e88ae24dce79b5d7a586e8f783371 (patch) | |
tree | dd60d405ef275549f2e7b108dd7867d3257f1e10 /test cases | |
parent | a7fc3fe3561c0b15a5263192a1645c765adf0ec2 (diff) | |
download | meson-1f5c6d62bf1e88ae24dce79b5d7a586e8f783371.tar.gz |
More clearly explain portability issues with linking to a module
Refine #3277
According to what I read on the internet, on OSX, both MH_BUNDLE (module)
and MH_DYLIB (shared library) can be dynamically loaded using dlopen(), but
it is not possible to link against MH_BUNDLE as if they were shared
libraries.
Metion this as an issue in the documentation.
Emitting a warning, and then going on to fail during the build with
mysterious errors in symbolextractor isn't very helpful, so make attempting
this an error on OSX.
Add a test for that.
See also:
https://docstore.mik.ua/orelly/unix3/mac/ch05_03.htm
https://stackoverflow.com/questions/2339679/what-are-the-differences-between-so-and-dylib-on-osx
Diffstat (limited to 'test cases')
3 files changed, 15 insertions, 0 deletions
diff --git a/test cases/failing/78 link with shared module on osx/meson.build b/test cases/failing/78 link with shared module on osx/meson.build new file mode 100644 index 000000000..2c714f97a --- /dev/null +++ b/test cases/failing/78 link with shared module on osx/meson.build @@ -0,0 +1,8 @@ +project('link with shared module', 'c') + +if host_machine.system() != 'darwin' + error('Test only fails on OSX') +endif + +m = shared_module('mymodule', 'module.c') +e = executable('prog', 'prog.c', link_with : m) diff --git a/test cases/failing/78 link with shared module on osx/module.c b/test cases/failing/78 link with shared module on osx/module.c new file mode 100644 index 000000000..81b0d5af0 --- /dev/null +++ b/test cases/failing/78 link with shared module on osx/module.c @@ -0,0 +1,3 @@ +int func(void) { + return 1496; +} diff --git a/test cases/failing/78 link with shared module on osx/prog.c b/test cases/failing/78 link with shared module on osx/prog.c new file mode 100644 index 000000000..8164d8da1 --- /dev/null +++ b/test cases/failing/78 link with shared module on osx/prog.c @@ -0,0 +1,4 @@ + +int main(int argc, char **argv) { + return func(); +} |