From 0192461eb9b986f8d1311266ae56b984faf466f5 Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jackpot51@gmail.com> Date: Tue, 3 Jan 2017 19:25:21 -0700 Subject: [PATCH] Fix gcc --- .cargo/config | 6 ++++++ cook.sh | 23 +++++++++++------------ libc-artifacts | 2 +- 3 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 .cargo/config diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 000000000..43363244e --- /dev/null +++ b/.cargo/config @@ -0,0 +1,6 @@ +[target.x86_64-unknown-redox] +linker = "libc-artifacts/gcc.sh" +rustflags = [ + "--verbose", + "-Z", "print-link-args" +] diff --git a/cook.sh b/cook.sh index 232a56522..cf6b555f3 100755 --- a/cook.sh +++ b/cook.sh @@ -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 diff --git a/libc-artifacts b/libc-artifacts index 4bff613d3..fd716b6dc 160000 --- a/libc-artifacts +++ b/libc-artifacts @@ -1 +1 @@ -Subproject commit 4bff613d3c4214ef4081427ab0a74d8f6f724935 +Subproject commit fd716b6dc0be2755a71ad40ddb6dfce49d5ffa91 -- GitLab