rust-lang / rust-lang/libc

Signal types missing for some embedded targets

Open
#3,615 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-API-request E-easy
Dominant language
Rust
Stars
2.6k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
69

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with library/test/src/test_result.rs around the SIGABRT use, then inspect libc's newlib module and the referenced newlib sys/signal.h definitions. Reproduce the failure for riscv32imc-esp-espidf using -Zbuild-std. Done means the required signal definitions are available for that target and the standard library build succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.