Skip to content
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
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@ authors = ["Jorge Aparicio <[email protected]>"]
name = "rustc_builtins"
version = "0.1.0"

[dependencies]
rlibc = { git = "https://github.com/alexcrichton/rlibc", optional = true }

[dev-dependencies]
quickcheck = "0.3.1"

[features]
default = ["rlibc/weak"]
11 changes: 11 additions & 0 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,21 @@ build() {

inspect() {
$PREFIX$NM -g --defined-only target/**/debug/*.rlib

set +e
$PREFIX$OBJDUMP -Cd target/**/debug/*.rlib
$PREFIX$OBJDUMP -Cd target/**/release/*.rlib
set -e

# Check presence of weak symbols
case $TRAVIS_OS_NAME in
linux)
local symbols=( memcmp memcpy memmove memset )
for symbol in "${symbols[@]}"; do
$PREFIX$NM target/**/debug/deps/librlibc*.rlib | grep -q "W $symbol"
done
;;
esac
}

run_tests() {
Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#![allow(unused_features)]
#![feature(asm)]
#![feature(core_intrinsics)]
#![feature(linkage)]
#![feature(naked_functions)]
#![cfg_attr(not(test), no_std)]
#![no_builtins]
// TODO(rust-lang/rust#35021) uncomment when that PR lands
// #![feature(rustc_builtins)]

Expand All @@ -16,6 +17,9 @@ extern crate quickcheck;
#[cfg(test)]
extern crate core;

#[cfg(all(not(windows), not(target_os = "macos")))]
extern crate rlibc;

#[cfg(target_arch = "arm")]
pub mod arm;

Expand Down