Open sporniket opened 10 months ago
wasi-libc does not currently support either dup
or alarm
. You most likely will need to modify the yices2 source code (or maybe just the compile flags) to remove the use of those APIs.
(The alarm.c and dup.c files that you link to are part of the upstream musl project but neither of them is compiled when building wasi-libc).
I see, thank you.
Context
Hello, I am trying to build yices2, (see there : https://github.com/sporniket/yices2-built-with-wasi-sdk ), I have tried wasi-sdk 19 and 20 without difference.
So far, I have
The problem
Now I am stuck with :
wasm-ld: error: ../build/wasm32-unknown-wasi-release/lib/libyices.a(timeout.o): undefined symbol: alarm
Did I miss another build option or something, or is it not possible at all to build yices2 at the moment ?
Steps to reproduce
build
script : in summary, it downloads WASI-SDK (19, but I also tried with 20), it downloads and build GMP, and then it try to build yices2When performing the build, I have warnings about 2 undefined functions :
dup()
alarm()
Then it fails when during the linking step :
I have looked for the name
alarm
with commands likear t wasi-sdk-19.0/share/wasi-sysroot/lib/wasm32-wasi/libc.a | grep ala
onlibc.a
,libwasi-emulated-process-clocks.a
andlibwasi-emulated-signal.a
, and in fact in the other libs found in wasi-sysroot too, without success.I guess this will be the same for dup too.
However in wasi-libc repository, I can see
alarm
at https://github.com/WebAssembly/wasi-libc/blob/main/libc-top-half/musl/src/unistd/alarm.c, anddup
at https://github.com/WebAssembly/wasi-libc/blob/main/libc-top-half/musl/src/unistd/dup.cBuild option
As seen in the build script, I am using
-D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_PROCESS_CLOCKS
as well as-lwasi-emulated-process-clocks -lwasi-emulated-signal
: