Skip to content
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

Replace the in-tree libc with the external copy #29546

Merged
merged 2 commits into from
Nov 10, 2015
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
[submodule "src/rust-installer"]
path = src/rust-installer
url = https://github.com/rust-lang/rust-installer
[submodule "src/liblibc"]
path = src/liblibc
url = https://github.com/rust-lang/libc
3 changes: 3 additions & 0 deletions mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,6 @@ $(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate))))
ifdef CFG_DISABLE_ELF_TLS
RUSTFLAGS_std := --cfg no_elf_tls
endif

CRATEFILE_libc := $(SREL)src/liblibc/src/lib.rs
RUSTFLAGS_libc := --cfg stdbuild
3 changes: 2 additions & 1 deletion mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $(eval $(call RUST_CRATE,coretest))
DEPS_collectionstest :=
$(eval $(call RUST_CRATE,collectionstest))

TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system \
TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system libc \
alloc_jemalloc,$(TARGET_CRATES)) \
collectionstest coretest
TEST_DOC_CRATES = $(DOC_CRATES)
Expand Down Expand Up @@ -283,6 +283,7 @@ tidy-binaries:
| grep '^$(S)src/compiler-rt' -v \
| grep '^$(S)src/libbacktrace' -v \
| grep '^$(S)src/rust-installer' -v \
| grep '^$(S)src/liblibc' -v \
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py

.PHONY: tidy-errors
Expand Down
3 changes: 2 additions & 1 deletion src/etc/tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def interesting_file(f):
'src/rustllvm',
'src/rt/valgrind',
'src/rt/msvc',
'src/rust-installer'
'src/rust-installer',
'src/liblibc',
}

if any(d in dirpath for d in skippable_dirs):
Expand Down
1 change: 1 addition & 0 deletions src/liballoc_jemalloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#![staged_api]
#![no_std]
#![cfg_attr(not(stage0), allocator)]
#![cfg_attr(stage0, allow(improper_ctypes))]
#![unstable(feature = "alloc_jemalloc",
reason = "this library is unlikely to be stabilized in its current \
form or name",
Expand Down
9 changes: 8 additions & 1 deletion src/liballoc_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#![staged_api]
#![no_std]
#![cfg_attr(not(stage0), allocator)]
#![cfg_attr(stage0, allow(improper_ctypes))]
#![unstable(feature = "alloc_system",
reason = "this library is unlikely to be stabilized in its current \
form or name",
Expand Down Expand Up @@ -141,10 +142,16 @@ mod imp {
}

#[cfg(windows)]
#[allow(bad_style)]
mod imp {
use libc::{BOOL, DWORD, HANDLE, LPVOID, SIZE_T};
use MIN_ALIGN;

type LPVOID = *mut u8;
type HANDLE = LPVOID;
type SIZE_T = usize;
type DWORD = u32;
type BOOL = i32;

extern "system" {
fn GetProcessHeap() -> HANDLE;
fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID;
Expand Down
1 change: 1 addition & 0 deletions src/libflate/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#![feature(staged_api)]
#![feature(unique)]
#![cfg_attr(test, feature(rustc_private, rand, vec_push_all))]
#![cfg_attr(stage0, allow(improper_ctypes))]

#[cfg(test)]
#[macro_use]
Expand Down
1 change: 1 addition & 0 deletions src/liblibc
Submodule liblibc added at b1a043