Skip to content

Fix duplicated SDL symbols in plugins#112

Merged
kunitoki merged 1 commit into
mainfrom
dev/fix_sdl_duplicated_symbols
Jun 4, 2026
Merged

Fix duplicated SDL symbols in plugins#112
kunitoki merged 1 commit into
mainfrom
dev/fix_sdl_duplicated_symbols

Conversation

@kunitoki
Copy link
Copy Markdown
Owner

@kunitoki kunitoki commented Jun 4, 2026

This pull request introduces a new mechanism to ensure that when SDL is statically linked into plugin bundles, its Objective-C runtime symbols are made private to avoid symbol collisions. The main changes involve generating a symbol patch header, configuring per-plugin private static SDL builds, and updating the build system to integrate these steps for all plugin formats (CLAP, VST3, AU).

SDL symbol privatization and build integration:

  • Added a new CMake module, yup_sdl.cmake, which provides functions to generate a header file (sdl-symbols-patch.h) that renames SDL Objective-C symbols for each plugin, and to build a private static SDL library per plugin target.
  • Introduced the template file sdl-symbols-patch.h.in, which defines macros to rename all relevant SDL Objective-C and related symbols using a plugin-specific prefix.

Build system updates for plugin targets:

  • Updated yup_audio_plugin.cmake to use the new SDL privatization mechanism for CLAP, VST3, and AU plugin targets, ensuring each gets its own patched SDL static library and header. The patch and private SDL libraries are linked into each plugin. [1] [2] [3] [4] [5] [6]
  • Modified the platform setup in yup.cmake to include the new yup_sdl.cmake module.

Other improvements:

  • Added an extra compiler warning suppression (-Wno-gnu-folding-constant) for the SDL2 static target on Apple platforms.
  • Removed a redundant library link to sdl2::sdl2 from the plugin build process, as the new mechanism handles SDL linkage.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.51%. Comparing base (b0e166d) to head (a675519).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
+ Coverage   78.50%   78.51%   +0.01%     
==========================================
  Files         605      605              
  Lines       60548    60548              
==========================================
+ Hits        47531    47540       +9     
+ Misses      13017    13008       -9     

see 3 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0e166d...a675519. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kunitoki kunitoki merged commit 1a531a6 into main Jun 4, 2026
40 checks passed
@kunitoki kunitoki deleted the dev/fix_sdl_duplicated_symbols branch June 4, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant