Skip to content

How to use static linked C++ library via FFI #3886

Answered by Liamolucko
noname0310 asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like LLVM's generating __wasm_call_ctors calls again:

(func $__wbindgen_describe_init.command_export (;1496;) (type 14)
  call $__wasm_call_ctors
  call $__wbindgen_describe_init
)

This has come up before, but only in the context of compiling to WASI (#2969). Previously I'd assumed that __wasm_call_ctors was just something WASI-specific, but now I'm thinking it might just get generated automatically whenever there's code that needs global initialisation, which included all WASI code. (This is all speculation, I haven't actually double-checked this yet.)

It seems like #2673 may actually have been the same issue since the OP there also mentioned C++, but it never went anywhere.

Aft…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@noname0310
Comment options

@daxpedda
Comment options

@noname0310
Comment options

@daxpedda
Comment options

@noname0310
Comment options

Comment options

You must be logged in to vote
2 replies
@Liamolucko
Comment options

@noname0310
Comment options

Answer selected by noname0310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants
Converted from issue

This discussion was converted from issue #3884 on March 12, 2024 08:18.