-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.sh
55 lines (44 loc) · 1.34 KB
/
setup.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
53
54
55
#
# Environment setup metascript for arm64 Android kernel builds with Clang
# Copyright (C) 2019 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-11.0.0-20200117/bin"
# 64-bit GCC toolchain prefix
gcc_prefix64="$HOME/toolchains/proton_clang-11.0.0-20200117/bin/aarch64-linux-gnu-"
# 32-bit GCC toolchain prefix
gcc_prefix32="$HOME/toolchains/proton_clang-11.0.0-20200117/bin/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_ld_path="$LD_LIBRARY_PATH"
_ksetup_old_path="$PATH"
export LD_LIBRARY_PATH="$clang_bin/../lib:$clang_bin/../lib64:$LD_LIBRARY_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"
CLANG_TRIPLE="aarch64-linux-gnu-"
KBUILD_COMPILER_STRING="$(get_clang_version clang)"
)