Open
Description
Issue Description
Building libc v0.2.162 fails in release mode but succeeds in debug mode.
Target Triple
aarch64-apple-darwin
(Apple Silicon macOS)
Environment Info
- OS: macOS ( 14.4.1 )
- Rust Version: rustc 1.82.0 (f6e511eec 2024-10-15)
- Cargo Version:cargo 1.82.0 (8f40fc59f 2024-08-21)
Steps to Reproduce
- Create a new project with the above minimal example
- Run
cargo build
(succeeds) - Run
cargo build --release -vv
(fails)
Build Logs
❯ cargo clean
Removed 127 files, 20.7MiB total
❯ cargo build
warning: /Users/fanv/Documents/daily-work/code/rustcode/libc/Cargo.toml: no edition set: defaulting to the 2015 edition while the latest is 2021
Compiling libc v0.2.162 (/Users/fanv/Documents/daily-work/code/rustcode/libc)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.02s
❯ cargo build -vv --release
warning: /Users/fanv/Documents/daily-work/code/rustcode/libc/Cargo.toml: no edition set: defaulting to the 2015 edition while the latest is 2021
Compiling libc v0.2.162 (/Users/fanv/Documents/daily-work/code/rustcode/libc)
Running `CARGO=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo CARGO_CRATE_NAME=build_script_build CARGO_MANIFEST_DIR=/Users/fanv/Documents/daily-work/code/rustcode/libc CARGO_PKG_AUTHORS='The Rust Project Developers' CARGO_PKG_DESCRIPTION='Raw FFI bindings to platform libraries like libc.
' CARGO_PKG_HOMEPAGE='https://github.com/rust-lang/libc' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=libc CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/rust-lang/libc' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.2.162 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=162 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 DYLD_FALLBACK_LIBRARY_PATH='/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/deps:/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/lib:/Users/fanv/lib:/usr/local/lib:/usr/lib' /Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc --crate-name build_script_build --edition=2015 build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=214 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="std"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("align", "const-extern-fn", "default", "extra_traits", "rustc-dep-of-std", "rustc-std-workspace-core", "std", "use_std"))' -C metadata=7e62781a0ba77f41 -C extra-filename=-7e62781a0ba77f41 --out-dir /Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/build/libc-7e62781a0ba77f41 -C strip=debuginfo -L dependency=/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/deps`
Running `CARGO=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo CARGO_CFG_PANIC=unwind CARGO_CFG_TARGET_ABI='' CARGO_CFG_TARGET_ARCH=aarch64 CARGO_CFG_TARGET_ENDIAN=little CARGO_CFG_TARGET_ENV='' CARGO_CFG_TARGET_FAMILY=unix CARGO_CFG_TARGET_FEATURE=aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh CARGO_CFG_TARGET_HAS_ATOMIC=128,16,32,64,8,ptr CARGO_CFG_TARGET_OS=macos CARGO_CFG_TARGET_POINTER_WIDTH=64 CARGO_CFG_TARGET_VENDOR=apple CARGO_CFG_UNIX='' CARGO_ENCODED_RUSTFLAGS='' CARGO_FEATURE_DEFAULT=1 CARGO_FEATURE_STD=1 CARGO_MANIFEST_DIR=/Users/fanv/Documents/daily-work/code/rustcode/libc CARGO_PKG_AUTHORS='The Rust Project Developers' CARGO_PKG_DESCRIPTION='Raw FFI bindings to platform libraries like libc.
' CARGO_PKG_HOMEPAGE='https://github.com/rust-lang/libc' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=libc CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/rust-lang/libc' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.2.162 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=162 CARGO_PKG_VERSION_PRE='' DEBUG=false DYLD_FALLBACK_LIBRARY_PATH='/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/deps:/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release:/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib:/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/lib:/Users/fanv/lib:/usr/local/lib:/usr/lib' HOST=aarch64-apple-darwin NUM_JOBS=10 OPT_LEVEL=3 OUT_DIR=/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/build/libc-04bf9d3a393b075f/out PROFILE=release RUSTC=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc RUSTDOC=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustdoc TARGET=aarch64-apple-darwin /Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/build/libc-7e62781a0ba77f41/build-script-build`
error: failed to run custom build command for `libc v0.2.162 (/Users/fanv/Documents/daily-work/code/rustcode/libc)`
Caused by:
process didn't exit successfully: `CARGO=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo CARGO_CFG_PANIC=unwind CARGO_CFG_TARGET_ABI='' CARGO_CFG_TARGET_ARCH=aarch64 CARGO_CFG_TARGET_ENDIAN=little CARGO_CFG_TARGET_ENV='' CARGO_CFG_TARGET_FAMILY=unix CARGO_CFG_TARGET_FEATURE=aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh CARGO_CFG_TARGET_HAS_ATOMIC=128,16,32,64,8,ptr CARGO_CFG_TARGET_OS=macos CARGO_CFG_TARGET_POINTER_WIDTH=64 CARGO_CFG_TARGET_VENDOR=apple CARGO_CFG_UNIX='' CARGO_ENCODED_RUSTFLAGS='' CARGO_FEATURE_DEFAULT=1 CARGO_FEATURE_STD=1 CARGO_MANIFEST_DIR=/Users/fanv/Documents/daily-work/code/rustcode/libc CARGO_PKG_AUTHORS='The Rust Project Developers' CARGO_PKG_DESCRIPTION='Raw FFI bindings to platform libraries like libc.
' CARGO_PKG_HOMEPAGE='https://github.com/rust-lang/libc' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=libc CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/rust-lang/libc' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.2.162 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=162 CARGO_PKG_VERSION_PRE='' DEBUG=false DYLD_FALLBACK_LIBRARY_PATH='/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/deps:/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release:/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib:/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/lib:/Users/fanv/lib:/usr/local/lib:/usr/lib' HOST=aarch64-apple-darwin NUM_JOBS=10 OPT_LEVEL=3 OUT_DIR=/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/build/libc-04bf9d3a393b075f/out PROFILE=release RUSTC=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc RUSTDOC=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustdoc TARGET=aarch64-apple-darwin /Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/build/libc-7e62781a0ba77f41/build-script-build` (signal: 9, SIGKILL: kill)
```❯ cargo build -vv --release
warning: /Users/fanv/Documents/daily-work/code/rustcode/libc/Cargo.toml: no edition set: defaulting to the 2015 edition while the latest is 2021
Compiling libc v0.2.162 (/Users/fanv/Documents/daily-work/code/rustcode/libc)
Running `CARGO=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo CARGO_CRATE_NAME=build_script_build CARGO_MANIFEST_DIR=/Users/fanv/Documents/daily-work/code/rustcode/libc CARGO_PKG_AUTHORS='The Rust Project Developers' CARGO_PKG_DESCRIPTION='Raw FFI bindings to platform libraries like libc.
' CARGO_PKG_HOMEPAGE='https://github.com/rust-lang/libc' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=libc CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/rust-lang/libc' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.2.162 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=162 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 DYLD_FALLBACK_LIBRARY_PATH='/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/deps:/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/lib:/Users/fanv/lib:/usr/local/lib:/usr/lib' /Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc --crate-name build_script_build --edition=2015 build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=214 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="default"' --cfg 'feature="std"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("align", "const-extern-fn", "default", "extra_traits", "rustc-dep-of-std", "rustc-std-workspace-core", "std", "use_std"))' -C metadata=7e62781a0ba77f41 -C extra-filename=-7e62781a0ba77f41 --out-dir /Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/build/libc-7e62781a0ba77f41 -C strip=debuginfo -L dependency=/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/deps`
Running `CARGO=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo CARGO_CFG_PANIC=unwind CARGO_CFG_TARGET_ABI='' CARGO_CFG_TARGET_ARCH=aarch64 CARGO_CFG_TARGET_ENDIAN=little CARGO_CFG_TARGET_ENV='' CARGO_CFG_TARGET_FAMILY=unix CARGO_CFG_TARGET_FEATURE=aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh CARGO_CFG_TARGET_HAS_ATOMIC=128,16,32,64,8,ptr CARGO_CFG_TARGET_OS=macos CARGO_CFG_TARGET_POINTER_WIDTH=64 CARGO_CFG_TARGET_VENDOR=apple CARGO_CFG_UNIX='' CARGO_ENCODED_RUSTFLAGS='' CARGO_FEATURE_DEFAULT=1 CARGO_FEATURE_STD=1 CARGO_MANIFEST_DIR=/Users/fanv/Documents/daily-work/code/rustcode/libc CARGO_PKG_AUTHORS='The Rust Project Developers' CARGO_PKG_DESCRIPTION='Raw FFI bindings to platform libraries like libc.
' CARGO_PKG_HOMEPAGE='https://github.com/rust-lang/libc' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=libc CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/rust-lang/libc' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.2.162 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=162 CARGO_PKG_VERSION_PRE='' DEBUG=false DYLD_FALLBACK_LIBRARY_PATH='/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/deps:/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release:/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib:/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/lib:/Users/fanv/lib:/usr/local/lib:/usr/lib' HOST=aarch64-apple-darwin NUM_JOBS=10 OPT_LEVEL=3 OUT_DIR=/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/build/libc-04bf9d3a393b075f/out PROFILE=release RUSTC=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc RUSTDOC=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustdoc TARGET=aarch64-apple-darwin /Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/build/libc-7e62781a0ba77f41/build-script-build`
error: failed to run custom build command for `libc v0.2.162 (/Users/fanv/Documents/daily-work/code/rustcode/libc)`
Caused by:
process didn't exit successfully: `CARGO=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo CARGO_CFG_PANIC=unwind CARGO_CFG_TARGET_ABI='' CARGO_CFG_TARGET_ARCH=aarch64 CARGO_CFG_TARGET_ENDIAN=little CARGO_CFG_TARGET_ENV='' CARGO_CFG_TARGET_FAMILY=unix CARGO_CFG_TARGET_FEATURE=aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh CARGO_CFG_TARGET_HAS_ATOMIC=128,16,32,64,8,ptr CARGO_CFG_TARGET_OS=macos CARGO_CFG_TARGET_POINTER_WIDTH=64 CARGO_CFG_TARGET_VENDOR=apple CARGO_CFG_UNIX='' CARGO_ENCODED_RUSTFLAGS='' CARGO_FEATURE_DEFAULT=1 CARGO_FEATURE_STD=1 CARGO_MANIFEST_DIR=/Users/fanv/Documents/daily-work/code/rustcode/libc CARGO_PKG_AUTHORS='The Rust Project Developers' CARGO_PKG_DESCRIPTION='Raw FFI bindings to platform libraries like libc.
' CARGO_PKG_HOMEPAGE='https://github.com/rust-lang/libc' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=libc CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/rust-lang/libc' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.2.162 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=162 CARGO_PKG_VERSION_PRE='' DEBUG=false DYLD_FALLBACK_LIBRARY_PATH='/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/deps:/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release:/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib:/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/lib:/Users/fanv/lib:/usr/local/lib:/usr/lib' HOST=aarch64-apple-darwin NUM_JOBS=10 OPT_LEVEL=3 OUT_DIR=/Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/build/libc-04bf9d3a393b075f/out PROFILE=release RUSTC=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc RUSTDOC=/Users/fanv/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustdoc TARGET=aarch64-apple-darwin /Users/fanv/Documents/daily-work/code/rustcode/libc/target/release/build/libc-7e62781a0ba77f41/build-script-build` (signal: 9, SIGKILL: kill)