aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/compilers.py2
-rw-r--r--test cases/common/125 shared module/meson.build17
2 files changed, 6 insertions, 13 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 3dc4340..63117e8 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -2208,7 +2208,7 @@ class ClangCompiler():
def get_std_shared_module_link_args(self):
if self.clang_type == CLANG_OSX:
- return ['-bundle']
+ return ['-bundle', '-Wl,-undefined,dynamic_lookup']
return ['-shared']
class ClangCCompiler(ClangCompiler, CCompiler):
diff --git a/test cases/common/125 shared module/meson.build b/test cases/common/125 shared module/meson.build
index 44abf55..6fd21c2 100644
--- a/test cases/common/125 shared module/meson.build
+++ b/test cases/common/125 shared module/meson.build
@@ -2,18 +2,11 @@ project('shared module', 'c')
dl = meson.get_compiler('c').find_library('dl', required : false)
l = shared_library('runtime', 'runtime.c')
-if host_machine.system() == 'darwin' or host_machine.system() == 'windows'
- # At least in OSX and seemingly also on Windows you must have
- # all symbols present when linking a module.
- #
- # In Linux many projects build plugins without linking to
- # the runtime so they have undefined symbols. We need to support
- # both for ease of transitioning.
- mlink = [l]
-else
- mlink = []
-endif
-m = shared_module('mymodule', 'module.c', link_with : mlink)
+# Do NOT link the module with the runtime library. This
+# is a common approach for plugins that are only used
+# with dlopen. Any symbols are resolved dynamically
+# at runtime
+m = shared_module('mymodule', 'module.c')
e = executable('prog', 'prog.c', link_with : l, dependencies : dl)
test('import test', e, args : [m.full_path()])