From fc87a3047e6604c72939306bb9584a27c7bcfa76 Mon Sep 17 00:00:00 2001 From: Gagan Malvi Date: Tue, 14 Sep 2021 20:48:10 +0200 Subject: [PATCH] build: compile with Proton Clang. Signed-off-by: Gagan Malvi --- build.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index dc7789b3668f..97e21a55fb2a 100755 --- a/build.sh +++ b/build.sh @@ -1,8 +1,8 @@ #!/bin/bash -TC_DIR="$HOME" echo "Cloning dependencies" -git clone --depth=1 https://github.com/mvaisakh/gcc-arm64 -b gcc-new $TC_DIR/arm64 -git clone --depth=1 https://github.com/mvaisakh/gcc-arm -b gcc-new $TC_DIR/arm +git clone --depth=1 https://github.com/kdrag0n/proton-clang clang +git clone --depth=1 https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9 gcc +git clone --depth=1 https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.9 gcc32 git clone https://github.com/sm6115-dev/AnyKernel3.git --depth=1 AnyKernel echo "Done" @@ -10,6 +10,7 @@ KERNEL_DIR=$(pwd) IMAGE="${KERNEL_DIR}/out/arch/arm64/boot/Image" TANGGAL=$(date +"%Y%m%d-%H") BRANCH="$(git rev-parse --abbrev-ref HEAD)" +PATH="${KERNEL_DIR}/clang/bin:${KERNEL_DIR}/gcc/bin:${KERNEL_DIR}/gcc32/bin:${PATH}" export ARCH=arm64 export KBUILD_BUILD_USER=gagan export KBUILD_BUILD_HOST=malvi @@ -18,10 +19,12 @@ make O=out ARCH=arm64 vendor/bengal-perf_defconfig # Compile plox compile() { - make -j$(nproc --all) O=out \ - PATH="$TC_DIR/arm64/bin:$TC_DIR/arm/bin:$PATH" \ - CROSS_COMPILE=$TC_DIR/arm64/bin/aarch64-elf- \ - CROSS_COMPILE_ARM32=$TC_DIR/arm/bin/arm-eabi- -Wno-format Image dtb.img dtbo.img |& tee $LOG + make -j$(nproc) O=out \ + ARCH=arm64 \ + CC=clang \ + CLANG_TRIPLE=aarch64-linux-gnu- \ + CROSS_COMPILE=aarch64-linux-android- \ + CROSS_COMPILE_ARM32=arm-linux-androideabi- $1 $2 $3 }