From 1f5c6d62bf1e88ae24dce79b5d7a586e8f783371 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sat, 2 Jun 2018 18:12:10 +0100 Subject: 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 --- mesonbuild/build.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mesonbuild/build.py') diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 4b42365..36e2e3c 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1086,8 +1086,12 @@ You probably should put it in link_with instead.''') ''' for link_target in self.link_targets: if isinstance(link_target, SharedModule): - mlog.warning('''target links against shared modules. This is not -recommended as it can lead to undefined behaviour on some platforms''') + if for_darwin(self.is_cross, self.environment): + raise MesonException('''target links against shared modules. +This is not permitted on OSX''') + else: + mlog.warning('''target links against shared modules. This is not +recommended as it is not supported on some platforms''') return class Generator: -- cgit v1.1