-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup_clang.sh
52 lines (41 loc) · 1.08 KB
/
setup_clang.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
# Environment setup metascript for arm64 Android kernel builds with Clang
# Copyright (C) 2019-2020 Danny Lin <[email protected]>
#
# This script must be *sourced* from a Bourne-compatible shell in order to
# function. Nothing will happen if you execute it.
#
# Path to executables in Clang toolchain
clang_bin="$HOME/toolchains/proton-clang/bin"
# 64-bit GCC toolchain prefix
gcc_prefix64="aarch64-linux-gnu-"
# 32-bit GCC toolchain prefix
gcc_prefix32="arm-linux-gnueabi-"
# Number of parallel jobs to run
# Do not remove; set to 1 for no parallelism.
jobs=$(nproc)
# Do not edit below this point
# ----------------------------
# Load the shared helpers
source helpers.sh
_ksetup_old_path="$PATH"
export PATH="$clang_bin:$PATH"
# Index of variables for cleanup in unsetup
_ksetup_vars+=(
clang_bin
gcc_prefix64
gcc_prefix32
jobs
kmake_flags
)
kmake_flags+=(
CC="clang"
AR="llvm-ar"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
STRIP="llvm-strip"
CROSS_COMPILE="$gcc_prefix64"
CROSS_COMPILE_ARM32="$gcc_prefix32"
KBUILD_COMPILER_STRING="$(get_clang_version clang)"
)