Skip to content
Snippets Groups Projects
Verified Commit 29cee43e authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Add upstreams to gcc, gnu-binutils. Update llvm. Use llvm recipe when building rust

parent f60171e1
No related branches found
No related tags found
No related merge requests found
GIT=https://gitlab.redox-os.org/redox-os/gcc.git GIT=https://gitlab.redox-os.org/redox-os/gcc.git
GIT_UPSTREAM=https://gcc.gnu.org/git/gcc.git
BRANCH=redox BRANCH=redox
BUILD_DEPENDS=(relibc) BUILD_DEPENDS=(relibc)
DEPENDS="gnu-binutils relibc" DEPENDS="gnu-binutils relibc"
......
GIT=https://gitlab.redox-os.org/redox-os/binutils-gdb.git GIT=https://gitlab.redox-os.org/redox-os/binutils-gdb.git
GIT_UPSTREAM=git://sourceware.org/git/binutils-gdb.git
BUILD_DEPENDS=(relibc) BUILD_DEPENDS=(relibc)
function recipe_version { function recipe_version {
......
GIT=https://gitlab.redox-os.org/redox-os/llvm.git GIT=https://gitlab.redox-os.org/redox-os/llvm.git
GIT_UPSTREAM=https://github.com/rust-lang/llvm.git
BRANCH=redox BRANCH=redox
function recipe_version { function recipe_version {
...@@ -32,7 +33,7 @@ function recipe_build { ...@@ -32,7 +33,7 @@ function recipe_build {
-DLLVM_ENABLE_THREADS=Off -DLLVM_ENABLE_THREADS=Off
-DLLVM_INCLUDE_TESTS=Off -DLLVM_INCLUDE_TESTS=Off
-target="$HOST" -target="$HOST"
-DLLVM_TABLEGEN="/usr/bin/llvm-tblgen-4.0" -DLLVM_TABLEGEN="/usr/bin/llvm-tblgen-7"
-I"$sysroot/include" -I"$sysroot/include"
-DCMAKE_CXX_FLAGS='--std=gnu++11' -DCMAKE_CXX_FLAGS='--std=gnu++11'
-DLLVM_TOOL_LTO_BUILD=Off -DLLVM_TOOL_LTO_BUILD=Off
......
...@@ -6,11 +6,10 @@ host = ["x86_64-unknown-redox"] ...@@ -6,11 +6,10 @@ host = ["x86_64-unknown-redox"]
target = ["x86_64-unknown-redox"] target = ["x86_64-unknown-redox"]
docs = false docs = false
submodules = false submodules = false
tools = ["src"]
verbose = 1 verbose = 1
[rust] [rust]
thinlto = false
use-jemalloc = false
backtrace = false backtrace = false
rpath = false rpath = false
codegen-tests = false codegen-tests = false
......
...@@ -4,7 +4,7 @@ import sys ...@@ -4,7 +4,7 @@ import sys
import os import os
args = sys.argv[1:] 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. # The values here are copied from the output of llvm-config running under Redox.
# This is a hack, and should be replaced if possible. # This is a hack, and should be replaced if possible.
......
GIT=https://gitlab.redox-os.org/redox-os/rust.git GIT=https://gitlab.redox-os.org/redox-os/rust.git
BRANCH=compile-redox BRANCH=compile-redox
BUILD_DEPENDS=(llvm)
DEPENDS="gcc cargo" 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 { function recipe_version {
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
skip=1 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 { function recipe_update {
echo "skipping update" echo "skipping update"
skip=1 skip=1
} }
function recipe_build { function recipe_build {
# Build LLVM unset AR AS CC CXX LD NM OBJCOPY OBJDUMP RANLIB READELF STRIP
pushd "$LLVM_BUILD" python x.py dist --config ../config.toml --jobs $(nproc) --incremental --keep-stage 0
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
skip=1 skip=1
} }
...@@ -97,7 +34,7 @@ function recipe_stage { ...@@ -97,7 +34,7 @@ function recipe_stage {
libpath="$1/lib/rustlib/${TARGET}/lib" libpath="$1/lib/rustlib/${TARGET}/lib"
mkdir -p "$binpath" "$libpath" mkdir -p "$binpath" "$libpath"
cp -fv "build/${TARGET}/stage2/bin/rustc" "$binpath" 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" cp -fv $(find build/${TARGET}/stage2/lib/rustlib/${TARGET}/lib/ -type f | grep -v librustc) "$libpath"
skip=1 skip=1
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment