You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
had to patch yices to somehow get rid of setjmp/longjmp (I forked the original repo to version those patches)
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
I use Ubuntu 20 LTS, uname -a ⇒ Linux Asusia 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux with usual dev tools installed.
clone with submodule the repository
cd to the cloned repository
invoke the 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 yices2
git clone --recurse-submodules https://github.com/sporniket/yices2-built-with-wasi-sdk.git
cd yices2-built-with-wasi-sdk
./build.sh
When performing the build, I have warnings about 2 undefined functions :
dup()
alarm()
api/yices_api.c:1176:12: warning: call to undeclared function 'dup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
tmp_fd = dup(fd);
^
[...]
utils/timeout.c:293:10: warning: call to undeclared function 'alarm'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
(void) alarm(delay);
^
utils/timeout.c:310:12: warning: call to undeclared function 'alarm'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
(void) alarm(0); // cancel the alarm
^
utils/timeout.c:325:12: warning: call to undeclared function 'alarm'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
(void) alarm(0);
^
I have looked for the name alarm with commands like ar t wasi-sdk-19.0/share/wasi-sysroot/lib/wasm32-wasi/libc.a | grep ala on libc.a, libwasi-emulated-process-clocks.a and libwasi-emulated-signal.a, and in fact in the other libs found in wasi-sysroot too, without success.
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 :
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).
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
:The text was updated successfully, but these errors were encountered: