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 --- docs/markdown/Reference-manual.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index a5733a2..cc49e88 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1161,6 +1161,10 @@ variables defined in the [`executable`](#executable) it is loaded by, you will need to set the `export_dynamic` argument of the executable to `true`. +**Note:** Linking to a shared module is not supported on some platforms, notably +OSX. Consider using a [`shared_library`](#shared_library) instead, if you need +to both `dlopen()` and link with a library. + *Added 0.37.0* ### static_library() -- cgit v1.1