rust-lang / rust-lang/rust

SIGILL trying to build `bstr` in a no_std environment

Open
#137,138 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-LLVM C-bug I-crash T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code

there is a bare-bone example in this repo
clone it then do
cargo build --target x86_64-unknown-none

Meta

rustc --version --verbose:

c 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-unknown-linux-gnu
release: 1.81.0
LLVM version: 18.1.7

same problem for latest nightly as of writing this (nightly-2025-02-16) and beta too

Error output
error: could not compile `bstr` (lib)

Caused by:
  process didn't exit successfully: `/home/aler/.rustup/toolchains/nightly-2025-02-16-x86_64-unknown-linux-gnu/bin/rustc --crate-name bstr --edition=2021 /home/aler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bstr-1.11.3/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=182 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("alloc", "default", "serde", "std", "unicode"))' -C metadata=88315fca68f793d3 -C extra-filename=-838f38bd3ea009ac --out-dir /home/aler/Documents/head/target/x86_64-unknown-none/debug/deps --target x86_64-unknown-none -L dependency=/home/aler/Documents/head/target/x86_64-unknown-none/debug/deps -L dependency=/home/aler/Documents/head/target/debug/deps --extern memchr=/home/aler/Documents/head/target/x86_64-unknown-none/debug/deps/libmemchr-e902a720dd10a02a.rmeta --cap-lints allow -C panic=abort -C relocation-model=static` (signal: 4, SIGILL: illegal instruction)

i have also tried reporting this at bstr's repo

Backtrace

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

Clone the linked SafaOS/BStrFailsToCompile repository and first run cargo build --target x86_64-unknown-none with the reported toolchain versions. Compare the stable, beta, and nightly results while investigating the rustc compilation of bstr; done means the reproducible build no longer terminates with SIGILL.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.