-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathaarch64-linux-android-6.x
executable file
·110 lines (101 loc) · 5.38 KB
/
aarch64-linux-android-6.x
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
# Copyright (C) 2015-2016 UBERTC
# This file is free software; UBER TOOLCHAINS
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Colorize build warnings, errors, and scripted prints
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
red=$(tput setaf 1) # red
grn=$(tput setaf 2) # green
blu=$(tput setaf 4) # blue
txtbld=$(tput bold) # Bold
bldred=${txtbld}$(tput setaf 1) # red
bldgrn=${txtbld}$(tput setaf 2) # green
bldblu=${txtbld}$(tput setaf 4) # blue
txtrst=$(tput sgr0) # Reset
echo ""
echo "${bldblu}Your system is preparing to build .... ${txtrst}"
echo ""
echo "${bldblu} ______________________________________________________________ ${txtrst}"
echo "${bldblu}| |${txtrst}"
echo "${bldblu}| _| _| _|_|_| _|_|_|_| _|_|_| _|_|_|_|_| _|_|_| |${txtrst}"
echo "${bldblu}| _| _| _| _| _| _| _| _| _| |${txtrst}"
echo "${bldblu}| _| _| _|_|_| _|_|_| _|_|_| _| _| |${txtrst}"
echo "${bldblu}| _| _| _| _| _| _| _| _| _| |${txtrst}"
echo "${bldblu}| _| _| _| _| _| _| _| _| _| |${txtrst}"
echo "${bldblu}| _|_| _|_|_| _|_|_|_| _| _| _| _|_|_| |${txtrst}"
echo "${bldblu}|______________________________________________________________|${txtrst}"
echo ""
echo ""
cd ../gcc/gcc-UBER && rm -rf * && git reset --hard && git fetch uu linaro-6.x && git checkout FETCH_HEAD && cd ../../;
export DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
export NUM_JOBS="$(cat /proc/cpuinfo | grep -c processor)";
MAKE_FLAGS=-j"$NUM_JOBS";
echo ""
echo "${bldblu}Cleaning up files from previous compile!${txtrst}"
echo ""
cd build;
if [ -e Makefile ];
then
make $MAKE_FLAGS clean &> /dev/null;
make $MAKE_FLAGS distclean &> /dev/null;
fi;
export UBER_PATH=$DIR/out/aarch64-linux-android-6.x-kernel;
export PREFIX=--prefix=$UBER_PATH;
if [ -d "$UBER_PATH" ];
then
rm -rf $UBER_PATH;
mkdir -p $UBER_PATH;
else
mkdir -p $UBER_PATH;
fi;
# UBERROOT
cd ../sysroot && rm -rf * && git reset --hard && git fetch uu gcc-6.x && git checkout FETCH_HEAD && cd ../build;
export UBERROOT_SRC_PATH=../sysroot/arch-arm64;
export UBERROOT_DEST_PATH=$UBER_PATH;
cp -R $UBERROOT_SRC_PATH -f $UBERROOT_DEST_PATH;
export UBERROOT=--with-sysroot=$UBERROOT_DEST_PATH/arch-arm64;
# Build Configuration
./configure $PREFIX $UBERROOT --host=x86_64-linux-gnu --build=x86_64-linux-gnu --target=aarch64-linux-android --program-transform-name='s&^&aarch64-linux-android-&' --with-gcc-version=UBER --with-pkgversion='LINARO-6.x.x' --with-binutils-version=uber --with-gmp-version=uber --with-mpfr-version=uber --with-mpc-version=uber --with-cloog-version=uber --with-isl-version=uber --enable-threads --enable-ld=default --enable-fix-cortex-a53-835769 --enable-plugins --enable-gold --disable-option-checking --disable-libsanitizer --enable-libatomic-ifuncs=no --enable-libgomp --enable-initfini-array --disable-docs --disable-nls --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --disable-bootstrap --quiet --with-gxx-include-dir=$UBERROOT_DEST_PATH/c++ --disable-werror --disable-shared;
echo ""
echo "${bldblu}Building your Linaro aarch64-6.x Toolchain!!!${txtrst}"
echo ""
all1=$(date +%s.%N)
script -q $DIR/out/Linaro-AARCH64-6.x.log -c "make 1>/dev/null $MAKE_FLAGS";
echo ""
echo "${bldblu}Installing Toolchain to:${txtrst}${blu} $UBER_PATH ${txtrst}"
echo ""
make install &> /dev/null;
GCC_INSTALLED=$UBER_PATH/bin/aarch64-linux-android-gcc;
if [ -e $GCC_INSTALLED ];
then
rm -rf $UBERROOT_DEST_PATH/arch-arm64;
echo ""
echo "${bldgrn} _|_|_| _| _| _|_|_| _|_|_| _|_|_|_| _|_|_| _|_|_| _|${txtrst}"
echo "${bldgrn}_| _| _| _| _| _| _| _| _|${txtrst}"
echo "${bldgrn} _|_| _| _| _| _| _|_|_| _|_| _|_| _|${txtrst}"
echo "${bldgrn} _| _| _| _| _| _| _| _| ${txtrst}"
echo "${bldgrn}_|_|_| _|_| _|_|_| _|_|_| _|_|_|_| _|_|_| _|_|_| _|${txtrst}"
echo ""
echo "${bldgrn}Your Linaro 6.x aarch64 Toolchain has completed successfully!!! ${txtrst}"
echo "${bldgrn}Toolchain is located at:${txtrst}${grn} $UBER_PATH ${txtrst}"
echo ""
all2=$(date +%s.%N)
echo "${bldgrn}Total elapsed time: ${txtrst}${grn}$(echo "($all2 - $all1) / 60"|bc ) minutes ($(echo "$all2 - $all1"|bc ) seconds) ${txtrst}"
sleep 5
else
echo ""
echo "${bldred}_|_|_|_| _|_|_| _|_|_| _|_| _|_|_| ${txtrst}"
echo "${bldred}_| _| _| _| _| _| _| _| _|${txtrst}"
echo "${bldred}_|_|_| _|_|_| _|_|_| _| _| _|_|_| ${txtrst}"
echo "${bldred}_| _| _| _| _| _| _| _| _|${txtrst}"
echo "${bldred}_|_|_|_| _| _| _| _| _|_| _| _|${txtrst}"
echo ""
echo "${bldred}Error Log is found at:${txtrst}${red} $DIR/out/Linaro-AARCH64-6.x.log ${txtrst}"
echo ""
read -p "Press ENTER to Exit"
fi;