libc icon indicating copy to clipboard operation
libc copied to clipboard

Signal types missing for some embedded targets

Open madsmtm opened this issue 1 year ago • 4 comments

I'm just getting started with embedded programming, and found that compiling the standard library using rust-analyzer with -Zbuild-std fails because of this line.

I'm not entirely sure, but it seems like this is entirely valid code, and that the problem lies with libc missing definitions for SIGABRT (and other signal handler #defines).

As far as I can tell, these are defined in newlib's sys/signal.h header, so perhaps the solution could be as simple as adding these to libc's newlib module? I can put up a PR if you think that's the way to go?

My target triple is riscv32imc-esp-espidf.

This would resolve the following issues: https://github.com/esp-rs/esp-idf-svc/issues/366 https://github.com/rust-lang/rust-analyzer/issues/16552

madsmtm avatar Mar 07 '24 23:03 madsmtm

I would suggest to go for the PR :)

devnexen avatar Mar 10 '24 22:03 devnexen

Hello, are you still planning on PRing this into libc? Otherwise I want to take a crack at it

Tevz-Beskovnik avatar Apr 14 '24 16:04 Tevz-Beskovnik

I'm fine with you doing it, thanks!

madsmtm avatar Apr 14 '24 18:04 madsmtm

you initially linked cygwin-newlib implementation. Please keep in mind that esp's uses its own fork of newlib. So if you want to cross reference what is there and what not have a look here . If i understand correctly it should cover both newlib functions found in esp rom and the once that get compiled into the binary (for functions not present in the ROM).

Vollbrecht avatar Apr 21 '24 11:04 Vollbrecht