[vlc-devel] [PATCH 1/2] bank: enable static modules for mach-o binaries

Alexandre Janniaux ajanni at videolabs.io
Fri Mar 6 18:09:54 CET 2020


Hi,

On Fri, Mar 06, 2020 at 06:31:14PM +0200, Remi Denis-Courmont wrote:
> Le 2020-03-06 17:07, Alexandre Janniaux a écrit :
> > > Hell no. We use to have that and it was absolutely horrible to
> > > maintain and
> > > to use. Getting rid of that was pretty much the whole point of
> > > switching to
> > > libtool back then.
> >
> > I'm not sure of what you're talking about regarding the
> > maintenance and the ease to use,
>
> I'm referring tp how VLC was built and run before libtool was taken into
> use.

Ok, thanks for clarification.

> > as I'm a bit confuse on whether you're talking about dlopen
> > or about the whole static and dynamic loader being together.
>
> We support importing static and dynamic plugins for years, using the
> mechanism that this patch tries to change. No problems there and I've no
> opinion on this first patch, other than it should be checked by a macOS dev.

This patch is wrong as-is, using weak symbols is actually
different from ELF and I must define vlc_static_modules at
build time. On Mach-O, it defines the behaviour at runtime
only, which makes no sense when building a static library
only.

> The problem is how to link dynamically loaded plugins if libvlccore is not a
> shared library, and how we used to do that.

I agree with you. Currently Android and iOS use static
libraries and build a single dynamic library from libvlc,
libvlccore, libcompat, and all static plugins. There is
currently not out-of-tree plugins usage on Android and iOS
because it is basically not supported, or half-supported by
doing your own build of libvlc, which defeats extensibility.

Just for contextualizing this, on Android, you can share
shared objects between apk as long as the signature and root
package name is shared. This is one the main target of these
modification.

So indeed we need to have a shared object for libvlccore, but
it cannot be written in a few commits and need modifications
in multiple project, especially if it also includes refactors
in buildsystem so that maintenance of mobile platforms
doesn't become an horrible self-inflicted pain with rough
edges everywhere.

Regards,
--
Alexandre Janniaux
Videolabs


More information about the vlc-devel mailing list