From f366a5dc3d8e3a8affbd438ad46a38cf905aa56d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 2 Jun 2017 21:03:21 -0600 Subject: [PATCH 1/5] Disable test build until libterm is fixed --- Xargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xargo.toml b/Xargo.toml index e816fa4ff..4bb0924c7 100644 --- a/Xargo.toml +++ b/Xargo.toml @@ -1,6 +1,6 @@ [dependencies.std] features = ["panic_unwind"] -[dependencies.test] -stage = 1 +#[dependencies.test] +#stage = 1 From 7ee086d593e590d92e9fd1abed56fa57016a214e Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sat, 3 Jun 2017 19:23:58 -0600 Subject: [PATCH 2/5] Update pkgutils --- pkgutils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgutils b/pkgutils index e8b316a8d..de029601f 160000 --- a/pkgutils +++ b/pkgutils @@ -1 +1 @@ -Subproject commit e8b316a8d52437b6f28cb3c68c61895403337018 +Subproject commit de029601fdc1ec6368afa7fb6eeb33b9333beac9 From d4b058bddabdd22331d84c6dfc5a03113385950f Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sat, 3 Jun 2017 19:25:14 -0600 Subject: [PATCH 3/5] Use cargo to run pkgutils --- cook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cook.sh b/cook.sh index c2b2e2548..d1799f00b 100755 --- a/cook.sh +++ b/cook.sh @@ -194,7 +194,7 @@ function op { echo "target = \"$TARGET\"" >> "stage.toml" mkdir -p stage/pkg cp -v stage.toml "stage/pkg/$1.toml" - $ROOT/pkgutils/target/release/pkg create stage + cargo run --release --manifest-path "$ROOT/pkgutils/Cargo.toml" --bin pkg -- create stage ;; untar) rm -rfv stage.tar stage.sig stage.toml From c4b0a276b269616a2609409565ca03f33e442382 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sat, 3 Jun 2017 19:27:00 -0600 Subject: [PATCH 4/5] Remove pkgutils from setup.sh --- cook.sh | 2 +- setup.sh | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/cook.sh b/cook.sh index d1799f00b..7de389fb2 100755 --- a/cook.sh +++ b/cook.sh @@ -194,7 +194,7 @@ function op { echo "target = \"$TARGET\"" >> "stage.toml" mkdir -p stage/pkg cp -v stage.toml "stage/pkg/$1.toml" - cargo run --release --manifest-path "$ROOT/pkgutils/Cargo.toml" --bin pkg -- create stage + TARGET=x86_64-unknown-redox cargo run --release --manifest-path "$ROOT/pkgutils/Cargo.toml" --bin pkg -- create stage ;; untar) rm -rfv stage.tar stage.sig stage.toml diff --git a/setup.sh b/setup.sh index 795627d99..62aa36f5b 100755 --- a/setup.sh +++ b/setup.sh @@ -24,10 +24,4 @@ then cargo install -f xargo fi -echo "Building pkgutils" -pushd pkgutils -# TODO Change pkgutils to not hard code TARGET -TARGET=x86_64-unknown-redox cargo build --release -popd - echo "cook.sh is ready to use" From c88984c5cfc09f5fd2021f849b1150b0bd3177d8 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Sat, 3 Jun 2017 20:12:48 -0700 Subject: [PATCH 5/5] Recipes for gcc, binutils, newlib --- cook.sh | 7 +++- recipes/gcc/recipe.sh | 60 ++++++++++++++++++++++++++++++++++ recipes/gnu-binutils/recipe.sh | 50 ++++++++++++++++++++++++++++ recipes/newlib/recipe.sh | 59 +++++++++++++++++++++++++++++++++ 4 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 recipes/gcc/recipe.sh create mode 100644 recipes/gnu-binutils/recipe.sh create mode 100644 recipes/newlib/recipe.sh diff --git a/cook.sh b/cook.sh index 7de389fb2..713296153 100755 --- a/cook.sh +++ b/cook.sh @@ -62,7 +62,12 @@ function op { then if [ ! -d source ] then - git clone --recursive "$GIT" source + if [ -n "$BRANCH" ] + then + git clone --recursive "$GIT" -b "$BRANCH" source + else + git clone --recursive "$GIT" source + fi fi pushd source > /dev/null diff --git a/recipes/gcc/recipe.sh b/recipes/gcc/recipe.sh new file mode 100644 index 000000000..7554b5cd9 --- /dev/null +++ b/recipes/gcc/recipe.sh @@ -0,0 +1,60 @@ +GIT=https://github.com/redox-os/gcc.git +BRANCH=redox + +HOST=x86_64-elf-redox +export AR="${HOST}-ar" +export AS="${HOST}-as" +export CC="${HOST}-gcc" +export CXX="${HOST}-g++" +export LD="${HOST}-ld" +export NM="${HOST}-nm" +export OBJCOPY="${HOST}-objcopy" +export OBJDUMP="${HOST}-objdump" +export RANLIB="${HOST}-ranlib" +export READELF="${HOST}-readelf" +export STRIP="${HOST}-strip" + +function recipe_version { + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + return 1 +} + +function recipe_update { + echo "skipping update" + return 1 +} + +function recipe_build { + ./contrib/download_prerequisites + cp config.sub gmp/config.sub + cp config.sub isl/config.sub + cp config.sub mpfr/config.sub + cp -f config.sub mpc/config.sub + pushd libstdc++-v3 + autoconf2.64 + popd + + mkdir build + cd build + ../configure --host=${HOST} --target=${HOST} --prefix=/ --enable-static --disable-shared --disable-dlopen --disable-nls --enable-languages=c --without-headers + make all-gcc all-target-libgcc + return 1 +} + +function recipe_test { + echo "skipping test" + return 1 +} + +function recipe_clean { + cd build + make clean + return 1 +} + +function recipe_stage { + dest="$(realpath $1)" + cd build + make DESTDIR="$dest" install-gcc install-target-libgcc + return 1 +} diff --git a/recipes/gnu-binutils/recipe.sh b/recipes/gnu-binutils/recipe.sh new file mode 100644 index 000000000..51040bb82 --- /dev/null +++ b/recipes/gnu-binutils/recipe.sh @@ -0,0 +1,50 @@ +GIT=https://github.com/redox-os/binutils-gdb.git + +HOST=x86_64-elf-redox +export AR="${HOST}-ar" +export AS="${HOST}-as" +export CC="${HOST}-gcc" +export CXX="${HOST}-g++" +export LD="${HOST}-ld" +export NM="${HOST}-nm" +export OBJCOPY="${HOST}-objcopy" +export OBJDUMP="${HOST}-objdump" +export RANLIB="${HOST}-ranlib" +export READELF="${HOST}-readelf" +export STRIP="${HOST}-strip" + +function recipe_version { + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + return 1 +} + +function recipe_update { + echo "skipping update" + return 1 +} + +function recipe_build { + mkdir build + cd build + ../configure --host=${HOST} --target=${HOST} --prefix=/ --with-sysroot=/usr/x86_64-elf-redox --disable-gdb --disable-nls --disable-werror + make + return 1 +} + +function recipe_test { + echo "skipping test" + return 1 +} + +function recipe_clean { + cd build + make clean + return 1 +} + +function recipe_stage { + dest="$(realpath $1)" + cd build + make DESTDIR="$dest" install + return 1 +} diff --git a/recipes/newlib/recipe.sh b/recipes/newlib/recipe.sh new file mode 100644 index 000000000..b2aef6c52 --- /dev/null +++ b/recipes/newlib/recipe.sh @@ -0,0 +1,59 @@ +GIT=https://github.com/redox-os/newlib.git +BRANCH=redox + +CC= + +HOST=x86_64-elf-redox + +function recipe_version { + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + return 1 +} + +function recipe_update { + echo "skipping update" + return 1 +} + +function recipe_build { + pushd newlib/libc/sys + aclocal-1.11 -I ../.. + autoconf + automake-1.11 --cygnus Makefile + popd + + pushd newlib/libc/sys/redox + aclocal-1.11 -I ../../.. + autoconf + automake-1.11 --cygnus Makefile + popd + + mkdir build + cd build + + ../configure --target="${HOST}" --prefix=/ + make + + return 1 +} + +function recipe_test { + echo "skipping test" + return 1 +} + +function recipe_clean { + cd build + make clean + return 1 +} + +function recipe_stage { + dest="$(realpath $1)" + cd build + make DESTDIR="$dest" install + cd "$dest" + mv x86_64-elf-redox/* ./ + rmdir x86_64-elf-redox + return 1 +}