Skip to content

add weak memcpy et al symbols #29

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 7 commits into from
Aug 16, 2016
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 <japaricious@gmail.com>"]
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