Skip to content

Trim and document libc shim #44765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions src/rustc/libc_shim/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
# This is a shim Cargo.toml over the "real Cargo.toml" found in the libc
# repository itself. The purpose for this is to add a build script which prints
# out `--cfg stdbuild` to mirror the makefiles' build system.
#
# Note that other than that this isn't actually needed, and we should probably
# remove this shim in favor of just working with cargo features directly with
# libc. That should make everything nicer!

[package]
name = "libc"
version = "0.0.0"
authors = ["The Rust Project Developers"]
build = "build.rs"

[lib]
name = "libc"
Expand All @@ -20,4 +11,27 @@ bench = false
doc = false

[dependencies]
# Specify the path to libcore; at the time of writing, removing this shim in
# favor of using libc from git results in a compilation failure:
#
# Building stage0 std artifacts (x86_64-apple-darwin -> x86_64-apple-darwin)
# Compiling libc v0.0.0 (file:///Users/tamird/src/rust/src/rustc/libc_shim)
# error[E0463]: can't find crate for `core`
#
# error: aborting due to previous error
#
# error: Could not compile `libc`.
#
# Caused by:
# process didn't exit successfully: `/Users/tamird/src/rust/build/bootstrap/debug/rustc --crate-name libc src/rustc/libc_shim/../../liblibc/src/lib.rs --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 --cfg feature="default" --cfg feature="no_std" --cfg feature="stdbuild" -C metadata=d758f87058112d7d -C extra-filename=-d758f87058112d7d --out-dir /Users/tamird/src/rust/build/x86_64-apple-darwin/stage0-std/x86_64-apple-darwin/release/deps --target x86_64-apple-darwin -L dependency=/Users/tamird/src/rust/build/x86_64-apple-darwin/stage0-std/x86_64-apple-darwin/release/deps -L dependency=/Users/tamird/src/rust/build/x86_64-apple-darwin/stage0-std/release/deps` (exit code: 101)
# thread 'main' panicked at 'command did not execute successfully: "/Users/tamird/src/rust/build/x86_64-apple-darwin/stage0/bin/cargo" "build" "-j" "4" "--target" "x86_64-apple-darwin" "--release" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/Users/tamird/src/rust/src/libstd/Cargo.toml" "--message-format" "json"
# expected success, got: exit code: 101', src/bootstrap/compile.rs:883:8
#
# See https://github.com/rust-lang/rfcs/pull/1133.
core = { path = "../../libcore" }

[features]
# Certain parts of libc are conditionally compiled differently than when used
# outside rustc. See https://github.com/rust-lang/libc/search?l=Rust&q=stdbuild&type=&utf8=%E2%9C%93.
stdbuild = []
default = ["stdbuild"]
18 changes: 0 additions & 18 deletions src/rustc/libc_shim/build.rs

This file was deleted.