73 lines
1.9 KiB
Markdown
73 lines
1.9 KiB
Markdown
|
|
# EEBBK S6 Kernel Toolchain
|
||
|
|
|
||
|
|
Build toolchain for the EEBBK S6 (SM7150 / sdmmagpie) Android kernel.
|
||
|
|
|
||
|
|
Contains:
|
||
|
|
- **clang-11.0.1** (AOSP prebuilt 6443078) — matches stock firmware compiler
|
||
|
|
- **binutils-2.27** (GNU) — matches stock firmware assembler/linker
|
||
|
|
|
||
|
|
The kernel source is in a separate repository:
|
||
|
|
`android_kernel_eebbk_sm6150` (CAF LA.UM.9.1.c25, kernel 4.14.190).
|
||
|
|
|
||
|
|
## Install
|
||
|
|
|
||
|
|
```bash
|
||
|
|
git clone <this-repo> # e.g. android_kernel_toolchain
|
||
|
|
cd android_kernel_toolchain
|
||
|
|
./setup.sh <kernel-repo-path>
|
||
|
|
```
|
||
|
|
|
||
|
|
Example:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
git clone http://<host>:3003/huang1057/android_kernel_toolchain.git
|
||
|
|
git clone http://<host>:3003/huang1057/android_kernel_eebbk_sm6150.git
|
||
|
|
|
||
|
|
cd android_kernel_toolchain
|
||
|
|
./setup.sh ../android_kernel_eebbk_sm6150
|
||
|
|
```
|
||
|
|
|
||
|
|
This unpacks `clang` and `binutils` into `<kernel-repo-parent>/toolchain/`:
|
||
|
|
|
||
|
|
```
|
||
|
|
<parent>/
|
||
|
|
├── android_kernel_eebbk_sm6150/ <- kernel source
|
||
|
|
└── toolchain/
|
||
|
|
├── android_prebuilts_clang_host_linux-x86_clang-6443078-10.0/
|
||
|
|
└── binutils-2.27-install/
|
||
|
|
```
|
||
|
|
|
||
|
|
## Build the kernel
|
||
|
|
|
||
|
|
```bash
|
||
|
|
cd android_kernel_eebbk_sm6150
|
||
|
|
|
||
|
|
export TC=../toolchain
|
||
|
|
export ARCH=arm64
|
||
|
|
export CROSS_COMPILE=$TC/binutils-2.27-install/bin/aarch64-linux-gnu-
|
||
|
|
export CLANG=$TC/android_prebuilts_clang_host_linux-x86_clang-6443078-10.0
|
||
|
|
export PATH=$CLANG/bin:$PATH
|
||
|
|
export LOCALVERSION=-perf
|
||
|
|
|
||
|
|
make vendor/sdmsteppe-perf_defconfig
|
||
|
|
|
||
|
|
make -j$(nproc) \
|
||
|
|
CC="python3 ./scripts/gcc-wrapper.py $CLANG/bin/aarch64-linux-gnu-clang" \
|
||
|
|
HOSTCC=gcc HOSTCXX=g++
|
||
|
|
|
||
|
|
gzip -n -9 -c arch/arm64/boot/Image > Image.gz
|
||
|
|
```
|
||
|
|
|
||
|
|
## Output
|
||
|
|
|
||
|
|
- `arch/arm64/boot/Image` — uncompressed kernel
|
||
|
|
- `Image.gz` — compressed kernel (for boot.img packing)
|
||
|
|
|
||
|
|
## Notes
|
||
|
|
|
||
|
|
- `LOCALVERSION=-perf` keeps the vermagic at `4.14.190-perf` (no trailing `+`),
|
||
|
|
required so stock vendor kernel modules load.
|
||
|
|
- Do NOT use `LLVM_IAS=1`. GNU binutils 2.27 `as` is required
|
||
|
|
(`-no-integrated-as` is handled by the toolchain).
|
||
|
|
- Requires Python 3 (for `gcc-wrapper.py`), gcc (host), on Linux x86_64.
|