Add build toolchain: clang 11.0.1 + binutils 2.27

- clang-6443078.tar.gz: AOSP clang 11.0.1
- binutils-2.27-install.tar.gz: GNU binutils 2.27
- setup.sh: unpacks toolchain next to the kernel repo

Usage:
  git clone <this-repo>
  cd <this-repo>
  ./setup.sh   # unpacks to ../toolchain/
This commit is contained in:
huang1057
2026-08-16 17:13:37 +08:00
commit 54466c54de
3 changed files with 43 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Executable
+43
View File
@@ -0,0 +1,43 @@
#!/bin/bash
# setup.sh - 解压工具链到母项目 (android_kernel_eebbk_sm6150) 旁边
#
# 用法:
# git clone <toolchain-repo> # 克隆工具链仓库
# cd <toolchain-repo> # 进入
# ./setup.sh # 运行, 会把工具链放到母项目同级目录
#
# 最终目录结构:
# <parent>/
# ├── android_kernel_eebbk_sm6150/ <- 内核源码
# └── toolchain/
# ├── android_prebuilts_clang_host_linux-x86_clang-6443078-10.0/
# └── binutils-2.27-install/
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# 工具链仓库目录的上一级 = 母项目目录
PARENT_DIR="$(dirname "$SCRIPT_DIR")"
TOOLCHAIN_DIR="$PARENT_DIR/toolchain"
echo "=== 工具链安装到: $TOOLCHAIN_DIR ==="
mkdir -p "$TOOLCHAIN_DIR"
echo "=== 解压 binutils-2.27 ==="
tar -xzf "$SCRIPT_DIR/binutils-2.27-install.tar.gz" -C "$TOOLCHAIN_DIR"
echo "完成"
echo "=== 解压 clang-11.0.1 (较大, 请稍候) ==="
tar -xzf "$SCRIPT_DIR/clang-6443078.tar.gz" -C "$TOOLCHAIN_DIR"
echo "完成"
echo ""
echo "=== 工具链就绪 ==="
ls -d "$TOOLCHAIN_DIR"/android_prebuilts_clang_host_linux-x86_clang-6443078-10.0
ls -d "$TOOLCHAIN_DIR"/binutils-2.27-install
echo ""
echo "编译内核时设置:"
echo " export TC=$TOOLCHAIN_DIR"
echo " export CROSS_COMPILE=\$TC/binutils-2.27-install/bin/aarch64-linux-gnu-"
echo " export CLANG=\$TC/android_prebuilts_clang_host_linux-x86_clang-6443078-10.0"
echo " export PATH=\$CLANG/bin:\$PATH"