Skip to content

WebGL build fails in Unity 6000.5: undefined symbols saveSetjmp and testSetjmp #46

Description

@shlafin

Environment

  • UniText: 1.0.0
  • Unity: 6000.5.2f1
  • Platform: WebGL
  • Operating system: macOS
  • Native library: Plugins/WebGL/libunitext_native.a

Problem

A WebGL build fails during the final Emscripten linking stage because libunitext_native.a references legacy setjmp/longjmp symbols that are unavailable in the Emscripten toolchain bundled with Unity 6000.5.

The original error is:

Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js:
undefined symbol: saveSetjmp
(referenced by root reference (e.g. compiled C/C++ code))

Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.js:
undefined symbol: testSetjmp
(referenced by root reference (e.g. compiled C/C++ code))

Aborting compilation due to previous errors

I verified that libunitext_native.a contains references to both saveSetjmp and testSetjmp.

Tests performed

Unity 6000.5 with WebAssembly 2023 enabled

The build fails with:

undefined symbol: saveSetjmp
undefined symbol: testSetjmp

Adding:

-sSUPPORT_LONGJMP=emscripten

results in:

emcc: error: SUPPORT_LONGJMP=emscripten is not compatible with -fwasm-exceptions

Unity enables native WebAssembly exceptions when WebAssembly 2023 is enabled, while the supplied UniText library appears to depend on the legacy Emscripten setjmp/longjmp implementation.

Unity 6000.5 with WebAssembly 2023 disabled

Using:

-sSUPPORT_LONGJMP=emscripten

still fails with:

undefined symbol: saveSetjmp
undefined symbol: testSetjmp

Therefore, disabling WebAssembly 2023 is not sufficient in Unity 6000.5.

Unity 6000.3

The project builds successfully in Unity 6000.3 with:

Enable WebAssembly 2023: Disabled
Emscripten Arguments: -sSUPPORT_LONGJMP=emscripten

This suggests that the Emscripten/LLVM update between Unity 6000.3 and Unity 6000.5 removed or changed the legacy internal functions used by the current precompiled library.

Expected behavior

UniText 1.0.0 should build for WebGL using current Unity 6 versions, including Unity 6000.5, without requiring deprecated internal Emscripten symbols.

Request

Could you please provide a version of libunitext_native.a rebuilt with the Emscripten toolchain bundled with Unity 6000.5, preferably using the current WebAssembly exception and longjmp model?

It would also be helpful to document:

  • which Unity versions the supplied WebGL library supports;
  • whether WebAssembly 2023 should be enabled or disabled;
  • whether any custom Emscripten arguments are required.

Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions