GDExtension libraries that use std::call_once
during static initialization crash Godot editor with freetype, libpng, zlib, graphite, harfbuzz
as system-provided
#91401
Labels
Tested versions
Reproducible in recent Godot 4.x version (latest attempt is v4.4.dev.custom_build [893bbdf]) that uses system-provided
freetype, libpng, zlib, graphite, harfbuzz
libraries.System information
Godot v4.4.dev (893bbdf) - Freedesktop SDK 24.08 (Flatpak runtime) on Wayland - Wayland display driver, Single-window, 1 monitor - Vulkan (Forward+) - dedicated AMD Radeon RX 6650 XT (RADV NAVI23) - 12th Gen Intel(R) Core(TM) i5-12500 (12 threads)
The problem is found when developing GDExtension libraries on Linux, not sure if it also occur on other platforms.
Issue description
If Godot editor is using system-provided
freetype, libpng, zlib, graphite, harfbuzz
libraries instead of built-in, opening projects with GDExtension libraries that usesstd::call_once
during static initialization will crash the editor.While official Godot editor will work without problems as it has everything builtin, many custom builds including Linux distribution packages (for example Arch and Flathub) configure Godot to use these libraries as system-provided, resulting in said GDExtension libraries unusable in custom Godot editor builds.
However, building
icu4c
libraries as system-provided likefreetype, libpng, zlib, graphite, harfbuzz
seems to solve the problem, I suppose this can be fixed by includingbuiltin_icu4c
intoft_linked_deps
check in linuxbsd detect.py.Steps to reproduce
scons
.once called
appear on stdout.builtin_freetype=no builtin_libpng=no builtin_zlib=no builtin_graphite=no builtin_harfbuzz=no
, and open the project.builtin_freetype=no builtin_libpng=no builtin_zlib=no builtin_graphite=no builtin_harfbuzz=no builtin_icu4c=no
Minimal reproduction project (MRP)
https://github.com/j20001970/godot_static_call_once_crash
The text was updated successfully, but these errors were encountered: