This commit is contained in:
Jeremy Soller 2017-01-03 19:25:21 -07:00
parent 2f60051492
commit 0192461eb9
3 changed files with 18 additions and 13 deletions

6
.cargo/config Normal file
View File

@ -0,0 +1,6 @@
[target.x86_64-unknown-redox]
linker = "libc-artifacts/gcc.sh"
rustflags = [
"--verbose",
"-Z", "print-link-args"
]

23
cook.sh
View File

@ -1,16 +1,15 @@
#!/bin/bash
ROOT="$PWD"
export CARGOFLAGS=--verbose
export CFLAGS="-static -nostartfiles -nostdlib -nodefaultlibs \
-undef -imacros $ROOT/libc-artifacts/define.h \
-isystem $ROOT/libc-artifacts/usr/include \
-L $ROOT/libc-artifacts/usr/lib \
$ROOT/libc-artifacts/usr/lib/crt0.o -lm -lc -lgcc \
-fno-stack-protector -U_FORTIFY_SOURCE"
export CARGO_BUILD_RUSTFLAGS="--verbose -Z print-link-args -C linker=gcc -C link-args=\"\$CFLAGS\""
# Configuration
export TARGET=x86_64-unknown-redox
# Automatic variables
ROOT="$PWD"
REPO="$ROOT/repo/$TARGET"
export CC="$ROOT/libc-artifacts/gcc.sh"
# Variables to be overriden by recipes
export CARGOFLAGS=--verbose
set -e
@ -51,13 +50,13 @@ function op {
;;
build)
pushd build > /dev/null
cp -r "$ROOT/Xargo.toml" "$ROOT/libc-artifacts" .
cp -r "$ROOT/Xargo.toml" "$ROOT/.cargo" "$ROOT/libc-artifacts" .
xargo build --target "$TARGET" --release $CARGOFLAGS
popd > /dev/null
;;
test)
pushd build > /dev/null
cp -r "$ROOT/Xargo.toml" "$ROOT/libc-artifacts" .
cp -r "$ROOT/Xargo.toml" "$ROOT/.cargo" "$ROOT/libc-artifacts" .
xargo test --no-run --target "$TARGET" --release $CARGOFLAGS
popd > /dev/null
;;
@ -81,7 +80,7 @@ function op {
for bin in $bins
do
cp -v "$bin" "../stage/bin/$(basename $bin)"
strip -v "../stage/bin/$(basename $bin)"
#strip -v "../stage/bin/$(basename $bin)"
done
fi
fi

@ -1 +1 @@
Subproject commit 4bff613d3c4214ef4081427ab0a74d8f6f724935
Subproject commit fd716b6dc0be2755a71ad40ddb6dfce49d5ffa91