Skip to content

relocation R_WASM_MEMORY_ADDR_TLS_SLEB cannot be used against an undefined symbol __wasm_lpad_context #541

@alepvn33

Description

@alepvn33

Hello all, I am trying to compile a large C++ codebase to WASM.
Exception handling (throw, catch) is being used, as well as pthreads.

I am compiling the code with WASI SDK 24.0 release using these flags:

```
-DCMAKE_C_COMPILER="/opt/wasi-sdk/bin/clang" -DCXX_EXTRA="-Oz -g" -DCMAKE_CXX_COMPILER="/opt/wasi-sdk/bin/clang++" \
-DCMAKE_CXX_FLAGS="--target=wasm32-wasi-threads -pthread -fwasm-exceptions \
-gpubnames -D_WASI_EMULATED_PROCESS_CLOCKS -lwasi-emulated-process-clocks -D_WASI_EMULATED_SIGNAL \
-lwasi-emulated-signal -D_WASI_EMULATED_MMAN -D_WASI_EMULATED_GETPID -lwasi-emulated-getpid -Wno-everything \
-Wl,-z,stack-size=16777216 -Wl,--initial-memory=33554432,--no-check-features"  \
 -DCMAKE_C_FLAGS="--target=wasm32-wasi-threads -pthread -fwasm-exceptions" && \

As you can see, I am using -fwasm-exceptions and -pthread flags, nevertheless I am getting a compiling error:

`relocation R_WASM_MEMORY_ADDR_TLS_SLEB cannot be used against an undefined symbol `__wasm_lpad_context``

Why is this? I have read in other issues that WASI SDK should have exception handling support by now.

Thanks for your help.

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