Skip to content
Snippets Groups Projects
Commit 790e16ce authored by Nirbheek Chauhan's avatar Nirbheek Chauhan :ant: Committed by GStreamer Marge Bot
Browse files

cerbero: Fix loading of rsvg, ttmlsubs, resindvd under MSVC

We were setting `objc` as `[]` in the native file, because of which
meson was auto-detecting it and finding it inside the MSYS-MinGW env.
Then it was using that (instead of the MSVC compiler) to search for
libraries inside `dependency()` and picked the GCC-compatible import
libraries (`.dll.a`) for all dependencies, such as cairo, pango,
libxml2, fontconfig, etc.

The MSVC linker tried its best to chug along and mostly succeeded, but
possibly due to format incompatibilities between `.dll.a` and `.lib`
import library formats or bugs in GCC and/or MSVC, this led to the
linker getting confused and looking for some libxml2 symbols both
inside cairo *and* libxml2 DLLs, and doing the same for some cairo
symbols too.

For example, it was looking for `xmlDocGetRootElement` and
`cairo_create` in both `libxml2-2.dll` and *also* in `libcairo-2.dll`.

Since in PE images multiple references to the same symbol in different
DLLs is allowed and all these references must be resolved at runtime,
this was a runtime error not a build-time error. The same thing was
also happening to resindvd.

Oh, also re-enable resindvd which was accidentally disabled on MSVC
when it was supposed to be disabled on UWP.

Closes #277

Part-of: <!525>
parent d8b165d3
No related branches found
No related tags found
1 merge request!525cerbero: Fix loading of rsvg, ttmlsubs, resindvd under MSVC
......@@ -848,8 +848,8 @@ class Meson (Build, ModifyEnvBase) :
cc = build_env.pop('CC')
cxx = build_env.pop('CXX')
objc = build_env.pop('OBJC', [])
objcxx = build_env.pop('OBJCXX', [])
objc = build_env.pop('OBJC', ['false'])
objcxx = build_env.pop('OBJCXX', ['false'])
ar = build_env.pop('AR')
# We currently don't set the pre-processor or the linker when building with meson
build_env.pop('CPP', None)
......@@ -929,8 +929,8 @@ class Meson (Build, ModifyEnvBase) :
cc = self.config.mingw_env_for_build_system['CC']
cxx = self.config.mingw_env_for_build_system['CXX']
ar = self.config.mingw_env_for_build_system['AR']
objc = cc
objcxx = cxx
objc = false
objcxx = false
elif self.config.platform == Platform.DARWIN:
cc = ['clang']
cxx = ['clang++']
......
......@@ -485,7 +485,7 @@ class Recipe(custom.GStreamer):
(self.config.target_platform == Platform.IOS and self.config.target_arch != Architecture.ARM64):
self.disable_plugin('vulkan', 'vulkan', library_name='vulkan')
if self.using_msvc() or self.config.target_platform in (Platform.ANDROID, Platform.IOS):
if self.using_uwp() or self.config.target_platform in (Platform.ANDROID, Platform.IOS):
self.disable_plugin('resindvd', 'dvd', dep='libdvdnav')
# dtls plugin needs openssl, and we pick up the system openssl if on
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment