unikraft / lib-newlib

Unikraft port of newlib, a C standard library
Other
5 stars 23 forks source link

uksignal support crashes app-helloworld-go build #10

Open razvanvirtan opened 3 years ago

razvanvirtan commented 3 years ago

When trying to build app-helloworld-go, we get this error:

/home/razvan/Documents/Unikraft/debug_helloworld_go/apps/app-helloworld-go/build/libgcc/origin/gcc-7.3.0/libgo/runtime/go-signal.c:200:33: error: ‘siginfo_t {aka struct <anonymous>}’ has no member named ‘si_addr’; did you mean ‘si_code’?
   ret.sigaddr = (uintptr)(info->si_addr);

This didn't happen before the uksignal support was integrated in newlib [1]. Apparently, the definition for siginfo_t is now provided by lib-newlib/musl-imported/include/signal.h and it is lighter than before, not including si_addr (this patch has lost it's effect [2]).

I think some newlib/uksignal updates will be needed in order to cover this usecase again.

[1] https://github.com/unikraft/lib-newlib/commit/08d36e62a6ecb3157b703907c093d3796a530e70 [2] https://github.com/unikraft/lib-newlib/blob/staging/patches/0006-Add-si_addr-field-for-siginfo_t-and-use-__rtems__-de.patch

cffs commented 3 years ago

I am afraid the problem is not just in the type definition. This siginfo_t definition correctly reflects what is actually supported by uksignal, which is not yet POSIX compatible. The only siginfo_t fields ever set by uksignal are si_signo, si_code and si_pid. If si_addr is needed, we should likely ensure it is properly set by the appropriate functions. Question: how should we synchronize siginfo_t definitions in C libraries such as newlib or musl, and the actual implementation in uksignal?