Auto merge of #73 - japaric:weak, r=japaric

put weak mem* symbols behind an opt-in Cargo feature

closes #64
cc #66
This commit is contained in:
homunkulus 2016-09-22 23:59:48 +00:00
commit c56a3f8a6e
4 changed files with 30 additions and 7 deletions

View File

@ -32,12 +32,20 @@ matrix:
os: linux os: linux
- env: TARGET=thumbv6m-none-eabi - env: TARGET=thumbv6m-none-eabi
os: linux os: linux
- env: TARGET=thumbv6m-none-eabi WEAK=true
os: linux
- env: TARGET=thumbv7em-none-eabi - env: TARGET=thumbv7em-none-eabi
os: linux os: linux
- env: TARGET=thumbv7em-none-eabi WEAK=true
os: linux
- env: TARGET=thumbv7em-none-eabihf - env: TARGET=thumbv7em-none-eabihf
os: linux os: linux
- env: TARGET=thumbv7em-none-eabihf WEAK=true
os: linux
- env: TARGET=thumbv7m-none-eabi - env: TARGET=thumbv7m-none-eabi
os: linux os: linux
- env: TARGET=thumbv7m-none-eabi WEAK=true
os: linux
- env: TARGET=x86_64-apple-darwin - env: TARGET=x86_64-apple-darwin
language: ruby language: ruby
os: osx os: osx

View File

@ -18,6 +18,6 @@ rand = "0.3.14"
path = "gcc_s" path = "gcc_s"
[features] [features]
default = ["rlibc/weak"] weak = ["rlibc/weak"]
[workspace] [workspace]

View File

@ -8,8 +8,13 @@ gist_it() {
} }
build() { build() {
if [[ $WEAK ]]; then
$CARGO build --features weak --target $TARGET
$CARGO build --features weak --target $TARGET --release
else
$CARGO build --target $TARGET $CARGO build --target $TARGET
$CARGO build --target $TARGET --release $CARGO build --target $TARGET --release
fi
} }
inspect() { inspect() {
@ -19,12 +24,21 @@ inspect() {
$PREFIX$OBJDUMP -Cd target/**/release/*.rlib | gist_it $PREFIX$OBJDUMP -Cd target/**/release/*.rlib | gist_it
set -e set -e
# Check presence of weak symbols # Check presence/absence of weak symbols
if [[ $LINUX ]]; then if [[ $WEAK ]]; then
local symbols=( memcmp memcpy memmove memset ) local symbols=( memcmp memcpy memmove memset )
for symbol in "${symbols[@]}"; do for symbol in "${symbols[@]}"; do
$PREFIX$NM target/**/debug/deps/librlibc*.rlib | grep -q "W $symbol" $PREFIX$NM target/$TARGET/debug/deps/librlibc-*.rlib | grep -q "W $symbol"
done done
else
set +e
ls target/$TARGET/debug/deps/librlibc-*.rlib
if [[ $? == 0 ]]; then
exit 1
fi
set -e
fi fi
} }
@ -50,6 +64,7 @@ main() {
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \ -e TRAVIS_BRANCH=$TRAVIS_BRANCH \
-e TRAVIS_COMMIT=$TRAVIS_COMMIT \ -e TRAVIS_COMMIT=$TRAVIS_COMMIT \
-e TRAVIS_OS_NAME=$TRAVIS_OS_NAME \ -e TRAVIS_OS_NAME=$TRAVIS_OS_NAME \
-e WEAK=$WEAK \
-v $(pwd):/mnt \ -v $(pwd):/mnt \
japaric/rustc-builtins \ japaric/rustc-builtins \
sh -c 'cd /mnt; sh -c 'cd /mnt;

View File

@ -23,7 +23,7 @@ extern crate gcc_s;
#[cfg(test)] #[cfg(test)]
extern crate rand; extern crate rand;
#[cfg(all(not(windows), not(target_os = "macos")))] #[cfg(feature = "weak")]
extern crate rlibc; extern crate rlibc;
pub mod int; pub mod int;