diff --git a/recipes/gcc/recipe.sh b/recipes/gcc/recipe.sh index 9380d079f99dee0a47129dbb473274522fa98ac3..cc406eea668dc030d1f0b33b5372a6e6c7edc67d 100644 --- a/recipes/gcc/recipe.sh +++ b/recipes/gcc/recipe.sh @@ -1,4 +1,5 @@ GIT=https://gitlab.redox-os.org/redox-os/gcc.git +GIT_UPSTREAM=https://gcc.gnu.org/git/gcc.git BRANCH=redox BUILD_DEPENDS=(relibc) DEPENDS="gnu-binutils relibc" diff --git a/recipes/gnu-binutils/recipe.sh b/recipes/gnu-binutils/recipe.sh index a4878e05fdc91f96030e4ed67484fbc8a84722c5..cae419df40784f3c4dc1d350a23480e0c35e9fd9 100644 --- a/recipes/gnu-binutils/recipe.sh +++ b/recipes/gnu-binutils/recipe.sh @@ -1,4 +1,5 @@ GIT=https://gitlab.redox-os.org/redox-os/binutils-gdb.git +GIT_UPSTREAM=git://sourceware.org/git/binutils-gdb.git BUILD_DEPENDS=(relibc) function recipe_version { diff --git a/recipes/llvm/recipe.sh b/recipes/llvm/recipe.sh index 6f8720e6e322647a073bdde466319cddf8eb50f1..25002f49ab54526a962d1f0805a50c6d012f0d22 100644 --- a/recipes/llvm/recipe.sh +++ b/recipes/llvm/recipe.sh @@ -1,4 +1,5 @@ GIT=https://gitlab.redox-os.org/redox-os/llvm.git +GIT_UPSTREAM=https://github.com/rust-lang/llvm.git BRANCH=redox function recipe_version { @@ -32,7 +33,7 @@ function recipe_build { -DLLVM_ENABLE_THREADS=Off -DLLVM_INCLUDE_TESTS=Off -target="$HOST" - -DLLVM_TABLEGEN="/usr/bin/llvm-tblgen-4.0" + -DLLVM_TABLEGEN="/usr/bin/llvm-tblgen-7" -I"$sysroot/include" -DCMAKE_CXX_FLAGS='--std=gnu++11' -DLLVM_TOOL_LTO_BUILD=Off diff --git a/recipes/rust/config.toml b/recipes/rust/config.toml index 2bd91ff32247bb8848a2dd280920db76d05fea5d..e4b39ee1c06fda24f3f2bf4928c651fc7851e648 100644 --- a/recipes/rust/config.toml +++ b/recipes/rust/config.toml @@ -6,11 +6,10 @@ host = ["x86_64-unknown-redox"] target = ["x86_64-unknown-redox"] docs = false submodules = false +tools = ["src"] verbose = 1 [rust] -thinlto = false -use-jemalloc = false backtrace = false rpath = false codegen-tests = false diff --git a/recipes/rust/llvm-config b/recipes/rust/llvm-config index be16d9b3073d5cc9408e8afc2c835bc74a1d9480..63e4e157100c0bb444ebc3a76f96afa93c675190 100755 --- a/recipes/rust/llvm-config +++ b/recipes/rust/llvm-config @@ -4,7 +4,7 @@ import sys import os args = sys.argv[1:] -prefix = os.path.realpath(os.path.dirname(os.path.abspath(sys.argv[0])) + "/llvm-prefix") +prefix = os.path.realpath(os.path.dirname(os.path.abspath(sys.argv[0])) + "/sysroot") # The values here are copied from the output of llvm-config running under Redox. # This is a hack, and should be replaced if possible. diff --git a/recipes/rust/recipe.sh b/recipes/rust/recipe.sh index d24f3ae851c21988e2a304939ccf97aaf726d25e..ec445229beea1824fff55c18e611bd25427ad208 100644 --- a/recipes/rust/recipe.sh +++ b/recipes/rust/recipe.sh @@ -1,84 +1,21 @@ GIT=https://gitlab.redox-os.org/redox-os/rust.git BRANCH=compile-redox +BUILD_DEPENDS=(llvm) DEPENDS="gcc cargo" -LLVM_GIT="https://gitlab.redox-os.org/redox-os/llvm.git" -LLVM_SOURCE="$(realpath -m llvm-source)" -LLVM_BUILD="$(realpath -m llvm-build)" -LLVM_PREFIX="$(realpath -m llvm-prefix)" -SYSROOT="/usr/$HOST" -unset AR AS CC CXX LD NM OBJCOPY OBJDUMP RANLIB READELF STRIP - - -LLVM_CMAKE_ARGS=( - -Wno-dev - -DCMAKE_CROSSCOMPILING=True - -DCMAKE_INSTALL_PREFIX="$LLVM_PREFIX" - -DLLVM_DEFAULT_TARGET_TRIPLE="$HOST" - -DLLVM_TARGET_ARCH="$ARCH" - -DLLVM_TARGETS_TO_BUILD=X86 - -DCMAKE_SYSTEM_NAME=Generic - -DPYTHON_EXECUTABLE="/usr/bin/python2" - -DUNIX=1 - -DLLVM_ENABLE_THREADS=Off - -DLLVM_INCLUDE_TESTS=Off - -target="$HOST" - -DLLVM_TABLEGEN="/usr/bin/llvm-tblgen-4.0" - -I"$SYSROOT/include" - -DCMAKE_CXX_FLAGS='--std=gnu++11' - -DLLVM_TOOL_LTO_BUILD=Off - -DLLVM_TOOL_LLVM_PROFDATA_BUILD=Off - -DLLVM_TOOL_LLI_BUILD=Off - -DLLVM_TOOL_RDOBJ_BUILD=Off - -DLLVM_TOOL_LLVM_COV_BUILD=Off - -DLLVM_TOOL_LLVM_XRAY_BUILD=Off - -DLLVM_TOOL_LLVM_LTO2_BUILD=Off - -DLLVM_TOOL_LLVM_LTO_BUILD=Off - -DLLVM_TOOL_LLVM_RTDYLD_BUILD=Off -) - function recipe_version { printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" skip=1 } -function recipe_fetch { - if [ ! -d "$LLVM_SOURCE" ] - then - git clone "$LLVM_GIT" -b redox --depth 1 "$LLVM_SOURCE" - fi - - pushd "$LLVM_SOURCE" > /dev/null - git remote set-url origin "$LLVM_GIT" - git fetch origin - git pull - git submodule sync --recursive - git submodule update --init --recursive - popd > /dev/null -} - -function recipe_prepare { - rm -rf "$LLVM_PREFIX" - mkdir -p "$LLVM_PREFIX" - - rm -rf "$LLVM_BUILD" - mkdir "$LLVM_BUILD" -} - function recipe_update { echo "skipping update" skip=1 } function recipe_build { - # Build LLVM - pushd "$LLVM_BUILD" - CC=$HOST-gcc CXX=$HOST-g++ cmake "${LLVM_CMAKE_ARGS[@]}" "${LLVM_SOURCE}" - make -j$(nproc) - make install - popd - - python x.py dist --config ../config.toml --jobs $(nproc) --incremental + unset AR AS CC CXX LD NM OBJCOPY OBJDUMP RANLIB READELF STRIP + python x.py dist --config ../config.toml --jobs $(nproc) --incremental --keep-stage 0 skip=1 } @@ -97,7 +34,7 @@ function recipe_stage { libpath="$1/lib/rustlib/${TARGET}/lib" mkdir -p "$binpath" "$libpath" cp -fv "build/${TARGET}/stage2/bin/rustc" "$binpath" - ${HOST}-strip "$binpath/rustc" + ${STRIP} "$binpath/rustc" cp -fv $(find build/${TARGET}/stage2/lib/rustlib/${TARGET}/lib/ -type f | grep -v librustc) "$libpath" skip=1 }