-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jorge Aparicio
committed
Oct 17, 2016
1 parent
ccfe4fc
commit e4fa0f6
Showing
12 changed files
with
231 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[target.thumbv6m-none-eabi] | ||
rustflags = ["-C", "link-arg=-nostartfiles"] | ||
|
||
[target.thumbv7m-none-eabi] | ||
rustflags = ["-C", "link-arg=-nostartfiles"] | ||
|
||
[target.thumbv7em-none-eabi] | ||
rustflags = ["-C", "link-arg=-nostartfiles"] | ||
|
||
[target.thumbv7em-none-eabihf] | ||
rustflags = ["-C", "link-arg=-nostartfiles"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM ubuntu:16.04 | ||
RUN apt-get update | ||
RUN apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
gcc \ | ||
gcc-arm-none-eabi \ | ||
libc6-dev \ | ||
libnewlib-dev | ||
RUN curl -LSfs http://japaric.github.io/trust/install.sh | \ | ||
sh -s -- --git japaric/xargo --tag v0.2.0 --target x86_64-unknown-linux-gnu --to /usr/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM ubuntu:16.04 | ||
RUN apt-get update | ||
RUN apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
gcc \ | ||
gcc-arm-none-eabi \ | ||
libc6-dev \ | ||
libnewlib-dev | ||
RUN curl -LSfs http://japaric.github.io/trust/install.sh | \ | ||
sh -s -- --git japaric/xargo --tag v0.2.0 --target x86_64-unknown-linux-gnu --to /usr/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM ubuntu:16.04 | ||
RUN apt-get update | ||
RUN apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
gcc \ | ||
gcc-arm-none-eabi \ | ||
libc6-dev \ | ||
libnewlib-dev | ||
RUN curl -LSfs http://japaric.github.io/trust/install.sh | \ | ||
sh -s -- --git japaric/xargo --tag v0.2.0 --target x86_64-unknown-linux-gnu --to /usr/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM ubuntu:16.04 | ||
RUN apt-get update | ||
RUN apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
gcc \ | ||
gcc-arm-none-eabi \ | ||
libc6-dev \ | ||
libnewlib-dev | ||
RUN curl -LSfs http://japaric.github.io/trust/install.sh | \ | ||
sh -s -- --git japaric/xargo --tag v0.2.0 --target x86_64-unknown-linux-gnu --to /usr/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
say() { | ||
echo "install.sh: $1" | ||
} | ||
|
||
say_err() { | ||
say "$1" >&2 | ||
} | ||
|
||
err() { | ||
if [ ! -z $td ]; then | ||
rm -rf $td | ||
fi | ||
|
||
say_err "ERROR $1" | ||
exit 1 | ||
} | ||
|
||
need() { | ||
if ! command -v $1 > /dev/null 2>&1; then | ||
err "need $1 (command not found)" | ||
fi | ||
} | ||
|
||
need basename | ||
need curl | ||
need cut | ||
need grep | ||
need install | ||
need mkdir | ||
need mktemp | ||
need rev | ||
need rustc | ||
need tar | ||
|
||
force=false | ||
while test $# -gt 1; do | ||
case $1 in | ||
--crate) | ||
crate=$2 | ||
shift | ||
;; | ||
--git) | ||
git=$2 | ||
shift | ||
;; | ||
--force) | ||
force=true | ||
;; | ||
--tag) | ||
tag=$2 | ||
shift | ||
;; | ||
--target) | ||
target=$2 | ||
shift | ||
;; | ||
--to) | ||
dest=$2 | ||
shift | ||
;; | ||
*) | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
if [ -z $git ]; then | ||
err 'must specify a git repository using `--git`. Example: `install.sh --git japaric/xargo`' | ||
fi | ||
|
||
url="https://github.com/$git" | ||
say_err "Git repository: $url" | ||
|
||
if [ -z $crate ]; then | ||
crate=$(echo $git | cut -d'/' -f2) | ||
fi | ||
|
||
say_err "Crate: $crate" | ||
|
||
url="$url/releases" | ||
|
||
if [ -z $tag ]; then | ||
tag=$(curl -s "$url/latest" | cut -d'"' -f2 | rev | cut -d'/' -f1 | rev) | ||
say_err "Tag: latest ($tag)" | ||
else | ||
say_err "Tag: $tag" | ||
fi | ||
|
||
if [ -z $target ]; then | ||
target=$(rustc -Vv | grep host | cut -d' ' -f2) | ||
fi | ||
|
||
say_err "Target: $target" | ||
|
||
if [ -z $dest ]; then | ||
dest="$HOME/.cargo/bin" | ||
fi | ||
|
||
say_err "Installing to: $dest" | ||
|
||
url="$url/download/$tag/$crate-$tag-$target.tar.gz" | ||
|
||
td=$(mktemp -d || mktemp -d -t tmp) | ||
curl -sL $url | tar -C $td -xz | ||
|
||
for f in $(find $td -type f -executable); do | ||
fn=$(basename $f) | ||
|
||
if [ -e "$dest/$fn" ] && [ $force = false ]; then | ||
err "$fn already exists in $dest" | ||
else | ||
mkdir -p $dest | ||
install -m 755 $f $dest | ||
fi | ||
done | ||
|
||
rm -rf $td |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
#![cfg_attr(thumb, feature(lang_items))] | ||
#![cfg_attr(thumb, no_main)] | ||
#![cfg_attr(thumb, no_std)] | ||
|
||
extern crate trust; | ||
|
||
#[cfg(not(thumb))] | ||
fn main() { | ||
println!(concat!("target: ", | ||
include_str!(concat!(env!("OUT_DIR"), "/target.txt")))); | ||
|
||
trust::hello(); | ||
} | ||
|
||
#[cfg(thumb)] | ||
#[no_mangle] | ||
pub fn _start() -> ! { | ||
loop {} | ||
} | ||
|
||
#[cfg(thumb)] | ||
#[no_mangle] | ||
pub fn __aeabi_unwind_cpp_pr0() {} | ||
|
||
#[cfg(thumb)] | ||
#[lang = "panic_fmt"] | ||
fn panic_fmt() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![cfg_attr(thumb, no_std)] | ||
|
||
#[cfg(feature = "c")] | ||
pub fn hello() { | ||
extern { | ||
|