From 6764521fb2398c004130ab710a85a2f95f148f6f Mon Sep 17 00:00:00 2001 From: fukiame Date: Wed, 11 Oct 2023 08:14:59 +0700 Subject: [PATCH] toolchains: add proton clang --- toolchains/Proton-Clang.sh | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 toolchains/Proton-Clang.sh diff --git a/toolchains/Proton-Clang.sh b/toolchains/Proton-Clang.sh new file mode 100755 index 0000000..bf00635 --- /dev/null +++ b/toolchains/Proton-Clang.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +maindir="$(pwd)" +outside="${maindir}/.." + +dir="${outside}/proton-clang-master" + +case $1 in + "setup" ) + # Clone compiler + if [[ ! -d "${dir}" ]]; then + curl -Lo a.tar.gz "https://github.com/kdrag0n/proton-clang/archive/master.tar.gz" + tar -zxf a.tar.gz + fi + ;; + + "build" ) + export PATH="${dir}/bin:/usr/bin:${PATH}" + make -j$(nproc --all) O=out ARCH=arm64 SUBARCH=arm64 $2 + make -j$(nproc --all) O=out \ + CROSS_COMPILE="aarch64-linux-gnu-" \ + CROSS_COMPILE_ARM32="arm-linux-gnueabi-" \ + CROSS_COMPILE_COMPAT="arm-linux-gnueabi-" \ + CC=clang \ + LD=ld.lld \ + NM=llvm-nm \ + AR=llvm-ar \ + STRIP=llvm-strip \ + OBJCOPY=llvm-objcopy \ + OBJDUMP=llvm-objdump \ + READELF=llvm-readelf \ + LLVM_IAS=1 \ + HOSTCC=clang \ + HOSTCXX=clang++ \ + HOSTLD=ld.lld \ + HOSTAR=llvm-ar \ + 2>&1 | tee ${CUR_TOOLCHAIN}.log + ;; +esac