Skip to content

Signature mismatch in __wasilibc_find_relpath #83686

Open
@jrandall

Description

@jrandall

In #67267, @alexcrichton indicated that the signature of __wasilibc_find_relpath had changed upstream, and that PR was merged changing the signature from a 4-argument version to a 2-argument version.

I'm not 100% sure what "upstream" means in this context, but I had previously thought it was wasi-libc from the WebAssembly repo. It does seem to be the case that until recently, WebAssembly/wasi-libc had a 2-argument version of __wasilibc_find_relpath so that seems consistent.

However, about 4 months ago in WebAssembly/wasi-libc#214, @alexcrichton changed the signature of __wasilibc_find_relpath from a 2-argument version to a 4-argument version (among higher-level changes relating to getcwd/chdir): https://github.com/WebAssembly/wasi-libc/pull/214/files#diff-a1d7011f390a08ae599db3993ed73f49d1b52748faae3fc11d0f5a12e5e1a2edR28-R31

We have a project in which we build a rust staticlib crate using the wasm32-wasi target, and then link that with C code that is also built against wasm32-wasi. This had been working, but after updating rust to 1.50.0 (from a much older version) it is now broken with the following final (llvm-11) linker error:

wasm-ld: warning: function signature mismatch: __wasilibc_find_relpath
     >>> defined as (i32, i32) -> i32 in /build/example/libexample.a(std-0bc94da15b7c3ad9.std.553gu1ty-cgu.0.rcgu.o)
     >>> defined as (i32, i32, i32, i32) -> i32 in /opt/wasi-sdk/share/sysroot/lib/wasm32-wasi/libc.a(preopens.o)

If "upstream" means what I think it does, I think the rust signature of __wasilibc_find_relpath now no longer matches the current wasi-libc version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-wasmTarget: WASM (WebAssembly), http://webassembly.org/

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions