Skip to content

Segfault compiling libc on armv7-unknown-linux-gnueabihf #62896

Closed

Description

Originally reported as rust-lang/libc#1441 but I was asked to report this here.

Steps to reproduce

cargo new --bin compile-fail
cd compile-fail
rustup override set nightly
echo 'libc = "=0.2.60"' >> Cargo.toml
cargo check --release

Output:

     Created binary (application) `compile-fail` package
info: using existing install for 'nightly-armv7-unknown-linux-gnueabihf'
info: override toolchain for '/home/fenhl/compile-fail' set to 'nightly-armv7-unknown-linux-gnueabihf'

  nightly-armv7-unknown-linux-gnueabihf unchanged - rustc 1.38.0-nightly (273f42b59 2019-07-21)

    Updating crates.io index
   Compiling libc v0.2.60
error: Could not compile `libc`.

Caused by:
  process didn't exit successfully: `rustc --crate-name build_script_build /home/fenhl/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.60/build.rs --color always --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=aaad41c440293f27 -C extra-filename=-aaad41c440293f27 --out-dir /home/fenhl/compile-fail/target/release/build/libc-aaad41c440293f27 -L dependency=/home/fenhl/compile-fail/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)

Workaround

Run the cargo check command with RUSTFLAGS='-Ccodegen-units=1' or add the following to the Cargo.toml:

[profile.release]
codegen-units = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

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.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions