emscripten-core / emscripten-core/emscripten
How to :-s STANDALONE_WASM and provide my own mmap/munamp
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
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 https://github.com/emscripten-core/emscripten/blob/38485ce0fe83c8b978b5634587bf34e13c5f3c3d/system/lib/standalone/standalone.c#L66-L73
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)
```
Contributor guide
Assessment
This issue has not been assessed yet.