Skip to content

Commit

Permalink
Update toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
liyafe1997 committed Aug 11, 2024
1 parent bdb267a commit 0cf3119
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
32 changes: 29 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# Ensure the script exits on error
set -e

TOOLCHAIN_PATH=$HOME/proton-clang/proton-clang-20210522/bin

TARGET_DEVICE=$1

if [ -z "$1" ]; then
Expand All @@ -18,8 +20,24 @@ if [ -z "$1" ]; then
exit 1
fi

if ! command -v aarch64-linux-android-ld >/dev/null 2>&1; then
echo "[aarch64-linux-android-ld] does not exist, please check your environment."


if [ ! -d $TOOLCHAIN_PATH ]; then
echo "TOOLCHAIN_PATH [$TOOLCHAIN_PATH] does not exist."
echo "Please ensure the toolchain is there, or change TOOLCHAIN_PATH in the script to your toolchain path."
exit 1
fi

echo "TOOLCHAIN_PATH: [$TOOLCHAIN_PATH]"
export PATH="$TOOLCHAIN_PATH:$PATH"

if ! command -v aarch64-linux-gnu-ld >/dev/null 2>&1; then
echo "[aarch64-linux-gnu-ld] does not exist, please check your environment."
exit 1
fi

if ! command -v arm-linux-gnueabi-ld >/dev/null 2>&1; then
echo "[arm-linux-gnueabi-ld] does not exist, please check your environment."
exit 1
fi

Expand All @@ -29,6 +47,13 @@ if ! command -v clang >/dev/null 2>&1; then
fi


# Enable ccache for speed up compiling
export CCACHE_DIR="$HOME/.cache/ccache_mikernel"
export CC="ccache gcc"
export CXX="ccache g++"
export PATH="/usr/lib/ccache:$PATH"
echo "CCACHE_DIR: [$CCACHE_DIR]"

if [ ! -f "arch/arm64/configs/${TARGET_DEVICE}_defconfig" ]; then
echo "No target device [${TARGET_DEVICE}] found."
echo "Avaliable defconfigs, please choose one target from below down:"
Expand All @@ -38,6 +63,7 @@ fi


# Check clang is existing.
echo "[clang --version]:"
clang --version


Expand All @@ -61,7 +87,7 @@ else
fi


MAKE_ARGS="ARCH=arm64 SUBARCH=arm64 O=out CC=clang CROSS_COMPILE=aarch64-linux-android- CROSS_COMPILE_ARM32=arm-linux-androideabi- CLANG_TRIPLE=aarch64-linux-gnu-"
MAKE_ARGS="ARCH=arm64 SUBARCH=arm64 O=out CC=clang CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi- CROSS_COMPILE_COMPAT=arm-linux-gnueabi- CLANG_TRIPLE=aarch64-linux-gnu-"


echo "Cleaning..."
Expand Down
7 changes: 0 additions & 7 deletions buildall.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
#!/bin/bash
set -e

# Enable ccache
export CCACHE_DIR="$HOME/.cache/ccache_mikernel"
export CC="ccache gcc"
export CXX="ccache g++"
export PATH="/usr/lib/ccache:$PATH"
ccache -M 50G

bash build.sh psyche
bash build.sh thyme
bash build.sh umi
Expand Down

0 comments on commit 0cf3119

Please sign in to comment.