[vlc-commits] [Git][videolan/vlc][master] src: meson: add support for _vlc_static_module on Darwin

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri May 23 09:25:37 UTC 2025



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
2e3d0af5 by Alexandre Janniaux at 2025-05-23T09:09:49+00:00
src: meson: add support for _vlc_static_module on Darwin

The static module bank, represented by the _vlc_static_module symbol, is
conditionally enabled depending on the link options in configure.ac.
Indeed, in the past with bitcode support and maybe today with LTO
support, there is no way to use the dynamic_lookup option from the
linker, and the two-level namespace from darwin blocks the symbol from
being looked up in the executable.

_vlc_static_module is in particular used by the tests, so re-expose the
options to enable it by default. The define was missing in particular.

- - - - -


1 changed file:

- src/meson.build


Changes:

=====================================
src/meson.build
=====================================
@@ -36,11 +36,19 @@ libvlccore_deps = [
 ]
 
 vlccore_cargs = [ '-DMODULE_STRING="core"', '-DHAVE_DYNAMIC_PLUGINS' ]
+libvlccore_link_args = []
 
 if host_system == 'darwin'
     libvlccore_deps += foundation_dep
     libvlccore_deps += corefoundation_dep
     libvlccore_deps += dependency('CFNetwork', required: true)
+    libvlccore_link_args += [
+        '-Wl,-U,_vlc_static_modules',
+        '-Wl,-undefined,dynamic_lookup',
+    ]
+    vlccore_cargs += [
+        '-DHAVE_DYLIB_DYNAMIC_LOOKUP=1',
+    ]
 elif host_system == 'windows'
 min_windows_version_test = '''
 #include <sdkddkver.h>
@@ -303,8 +311,6 @@ if get_option('videolan_manager')
     libvlccore_sources += libvlccore_vlm_sources
 endif
 
-libvlccore_link_args = []
-
 if host_system == 'darwin'
     libvlccore_sources += [
         'darwin/dirs.m',
@@ -325,7 +331,6 @@ if host_system == 'darwin'
             'posix/spawn.c',
         ]
     endif
-    libvlccore_link_args += '-Wl,-U,_vlc_static_modules'
 elif host_system == 'windows'
     libvlccore_sources += [
         'win32/error.c',



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2e3d0af5ac0c28b95cd96d2eadea20683c14bda4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2e3d0af5ac0c28b95cd96d2eadea20683c14bda4
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list