Skip to content

SIGILL trying to build bstr in a no_std environment #137138

Open
@ObserverUnit

Description

@ObserverUnit

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions