Merge pull request #29 from japaric/weak-memcpy
add weak `memcpy` et al symbols
This commit is contained in:
commit
89594e16ae
@ -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
ci/script.sh
11
ci/script.sh
@ -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() {
|
||||
|
@ -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)]
|
||||
|
||||
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user