-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
signal header C++/WASI libc inconsistency (WASI SDK 8) #93
Comments
Interesting. I guess we need to choose between declare functions that don't exist at link time (we do this for raise() for example, although that is probably an oversight) and modifying libstdc++ sources. Changing upstream libstdc++ is probably right way to go long term. Alternatively, perhaps the best solution would be to simply remove |
Update WASI SDK to fix C++ setjmp/signal headers Fixes the issue #595 with C++ packages for the development snapshots made from the `swiftwasm` branch. Previously C++ dependencies couldn't be built as default Clang headers weren't tailored to support WASI, WebAssembly/wasi-sdk#93 being one of the examples. This should also unblock TokamakUI/Tokamak#170.
Signals are now completely removed; this can be closed, right? |
There is an inconsistency in the signal headers for C++ vs C lib that causes build failure. Tested for WASI SDK 8.
Error from compiler:
/usr/local/wasi-sdk/share/wasi-sysroot/include/c++/v1/csignal:53:9: error: no member named 'signal' in the global namespace; did you mean 'sigval'?
using ::signal;
The WASI clib header (share/wasi-sysroot/include/signal.h) uses __wasilibc_unmodified_upstream to disable signal function:
#ifdef __wasilibc_unmodified_upstream /* WASI has no signals */
void (*signal(int, void (*)(int)))(int);
#endif
But the C++ csignal header (share/wasi-sysroot/include/c++/v1/csignal) refers to signal function always:
_LIBCPP_BEGIN_NAMESPACE_STD
using ::sig_atomic_t;
#ifdef __wasilibc_unmodified_upstream
// ADDED BY MEusing ::signal;
#endif
// ADDED BY MEusing ::raise;
_LIBCPP_END_NAMESPACE_STD
I just add __wasilibc_unmodified_upstream in csignal as a workaround for my build pipeline but likely better to add fake signal in WASI c lib to avoid modifying C++ llvm header? Not sure what is preferred.
The text was updated successfully, but these errors were encountered: