Commit Graph

11 Commits (main)

Author SHA1 Message Date
Alessandro De Blasis a10854654d build: disable ubsan in C deps for MSVC static linking
Zig's ubsan runtime cannot be bundled on Windows (LNK4229),
leaving __ubsan_handle_* symbols unresolved when the static
archive is consumed by an external linker like MSVC link.exe.

freetype, glslang, spirv-cross, and highway already suppress
ubsan unconditionally. Add MSVC-conditional suppression to the
seven C dependencies that were missing it: harfbuzz, libpng,
dcimgui, wuffs, oniguruma, zlib, and stb.

The fix is gated on abi == .msvc so ubsan coverage is preserved
on Linux and macOS where bundle_ubsan_rt works.
2026-04-23 05:23:15 +02:00
Alessandro De Blasis deeda46186 build: skip linkLibCpp on MSVC for dcimgui, spirv-cross, harfbuzz
Zig unconditionally passes -nostdinc++ and adds its bundled
libc++/libc++abi include paths, which conflict with MSVC's own C++
runtime headers. The MSVC SDK directories (added via linkLibC)
already contain both C and C++ headers, so linkLibCpp is not needed.

This is the same fix already applied upstream to highway, simdutf,
utfcpp, glslang, SharedDeps, and GhosttyZig.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:03:33 +01:00
Mitchell Hashimoto de4ee288f5
pkg/dcimgui: only add the OpenGL3 shutdown helper if backend enabled 2026-02-26 06:56:17 -08:00
Mitchell Hashimoto 7db8346fca
apprt/gtk: fix SIGSEGV on ImGui GLArea re-realize
Fixes #10406

ImGui_ImplOpenGL3_Shutdown() calls imgl3wShutdown() which dlcloses the
GL library handles but does not zero out the imgl3w function pointer
table (imgl3wProcs). When a GLArea is re-realized (e.g. during
reparenting), ImGui_ImplOpenGL3_Init() calls ImGui_ImplOpenGL3_InitLoader()
which checks "if (glGetIntegerv == nullptr)". Since the stale pointers
are non-null, it skips re-initialization. The next GL call through a
dangling function pointer causes a SIGSEGV.

Fix this by introducing ImGui_ImplOpenGL3_ShutdownWithLoaderCleanup()
which calls the normal shutdown and then zeroes the imgl3wProcs table,
forcing the next Init to reload GL function pointers via imgl3wInit().

Also properly destroy the ImGui context and reset widget state in
glAreaUnrealize so re-realize starts clean. This was extra but was
probably leaking memory.
2026-02-25 15:25:22 -08:00
Mitchell Hashimoto a25e91bb25
pkg/dcimgui: expose more private dockbuilder stuff 2026-01-31 08:47:13 -08:00
Tommy D. Rossi 61394d5213 build: add -fPIC for musl targets in C++ dependencies 2026-01-07 06:55:40 -08:00
Mitchell Hashimoto f2bc722a58
pkg/dcimgui: fix wchar size mismatch 2025-12-31 13:36:40 -08:00
Mitchell Hashimoto 965ffb1750
pkg/dcimgui: add freetype 2025-12-31 13:20:27 -08:00
Mitchell Hashimoto 896361f426
Fix up API calls for initialization 2025-12-31 13:01:28 -08:00
Mitchell Hashimoto 978400b0b0
replace cimgui with dcimgui 2025-12-31 10:42:10 -08:00
Mitchell Hashimoto 3bd898603a
pkg/dcimgui: DearBindings-based Imgui support 2025-12-31 10:11:43 -08:00