Skip to content

How to :-s STANDALONE_WASM and provide my own mmap/munamp #13312

Open
@yowl

Description

@yowl

These symbols are in libstandalonewasm.a :

llvm-nm E:\GitHub\emsdk\upstream\emscripten\cache\wasm\libstandalonewasm.a

standalone.o:
00000000 d .L.str
0000000b d .L.str.1
00000017 d .L.str.2
00000001 T _Exit
0000016c T __cxa_allocate_exception
00000162 T __cxa_throw
000000a1 T __map_file
         U __stack_pointer
000000ab T __syscall192
000000f7 T __syscall221
000000b0 T __syscall5
000000f2 T __syscall54
000000a6 T __syscall91

syscall192 and syscall91, and they are just stubs

long __syscall91(int x, int y) { // munmap
return -ENOSYS;
}
// mmap2()
long __syscall192(long addr, long len, long prot, long flags, long fd, long off) {
return -ENOSYS;
}

I want to provide my own implementation of these. Is that possible? Currently when mine are linked in wasm-ld fails with duplicate symbol errors and ld's --allow-multiple-definition is not supported:

wasm-ld: error: duplicate symbol: __syscall91
>>> defined in wasi.o
>>> defined in E:\GitHub\emsdk\upstream\emscripten\cache\wasm\libstandalonewasm.a(standalone.o)

wasm-ld: error: duplicate symbol: __syscall192
>>> defined in wasi.o
>>> defined in E:\GitHub\emsdk\upstream\emscripten\cache\wasm\libstandalonewasm.a(standalone.o)

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