From d0e5c4fbfcb8df82b25ce11e55fc12d6c19c0052 Mon Sep 17 00:00:00 2001 From: XOR Date: Sat, 19 Oct 2024 22:14:54 +0200 Subject: [PATCH 1/2] Add basic build script --- build_kernel.sh | 50 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) mode change 100644 => 100755 build_kernel.sh diff --git a/build_kernel.sh b/build_kernel.sh old mode 100644 new mode 100755 index 62475d60f930..10ccc12e3671 --- a/build_kernel.sh +++ b/build_kernel.sh @@ -1,8 +1,50 @@ #!/bin/bash +# ========================================= +# _____ _ +# | ___| __ ___ ___| |__ +# | |_ | '__/ _ \/ __| '_ \ +# | _|| | | __/\__ \ | | | +# |_| |_| \___||___/_| |_| +# +# ========================================= +# +# Minty - The kernel build script for Mint +# The Fresh Project +# Copyright (C) 2019-2021 TenSeventy7 +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# ========================= +# +ORIGIN_DIR=$(pwd) + +LLVM_TOOLCHAIN=$ORIGIN_DIR/toolchain/linux-x86-android-9.0.0_r6-clang-4639204 +GNU_TOOLCHAIN=$ORIGIN_DIR/toolchain/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9 + +PATH=$LLVM_TOOLCHAIN/bin:$GNU_TOOLCHAIN/bin:$PATH + +# compiler -> LLVM +#export CLANG=$LLVM_TOOLCHAIN/bin/clang + +# binutils -> GNU +export CROSS_COMPILE=aarch64-linux-androidkernel- +export CLANG_TRIPLE=aarch64-linux-gnu- + +export PLATFORM_VERSION=13 +export ANDROID_MAJOR_VERSION=t export ARCH=arm64 -export PLATFORM_VERSION=12 -export ANDROID_MAJOR_VERSION=s -make ARCH=arm64 exynos9610-a51xx_defconfig -make ARCH=arm64 -j16 +make CC=clang -j$(nproc --all) exynos9610-a51xx_defconfig +make CC=clang #-j$(nproc --all) From e9bb7b3fe53b188870338494d6127dc987e97e3b Mon Sep 17 00:00:00 2001 From: XOR Date: Sat, 19 Oct 2024 22:17:17 +0200 Subject: [PATCH 2/2] Makefile: Set compilers path to default Linux --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d588eecd6c41..33be2e50d3b4 100644 --- a/Makefile +++ b/Makefile @@ -311,7 +311,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ # Default value for CROSS_COMPILE is not to prefix executables # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile ARCH ?=arm64 -CROSS_COMPILE= $(srctree)/toolchain/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android- +CROSS_COMPILE ?=$(CONFIG_CROSS_COMPILE:"%"=%) # Architecture as present in compile.h UTS_MACHINE := $(ARCH) @@ -507,7 +507,7 @@ endif ifeq ($(cc-name),clang) ifneq ($(CROSS_COMPILE),) -CLANG_TRIPLE ?= $(srctree)/toolchain/clang/host/linux-x86/clang-4639204/bin/aarch64-linux-gnu- +CLANG_TRIPLE ?= $(CROSS_COMPILE) CLANG_FLAGS := --target=$(notdir $(CLANG_TRIPLE:%-=%)) ifeq ($(shell $(srctree)/scripts/clang-android.sh $(CC) $(CLANG_FLAGS)), y) $(error "Clang with Android --target detected. Did you specify CLANG_TRIPLE?")