-
-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathRTBuilder_32b
342 lines (310 loc) · 15.7 KB
/
RTBuilder_32b
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
#!/bin/bash
# ===============================================
# Raspberry Pi Toolchains(raspberry-pi-cross-compilers): This project
# provides latest automated GCC Cross Compiler & Native (ARM & ARM64)
# build-scripts and precompiled standalone toolchains for Raspberry Pi.
# Copyright (C) 2020 Abhishek Thakur(@abhiTronix) <[email protected]>
# 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 <https://www.gnu.org/licenses/>.
# ===============================================
# This script auto downloads, compiles, and compresses Cross & Native GCC ARM Toolchain binaries
# targeting Raspberry Pi 32-bit Bookworm(Debian 12), Bullseye(Debian 11), and Buster(Debian 10) OSes only.
set -eo pipefail
helpfunction() {
#helper function that prints custom usage help menu
echo ""
echo ""
figlet -t -k -f /usr/share/figlet/standard.flf "Raspberry Pi Toolchains Builder 32-bit"
echo ""
figlet -t -k -f /usr/share/figlet/term.flf "Copyright (c) 2020 abhiTronix"
echo ""
echo ""
echo "Usage: $0 -g [GCC version] -r [Target Pi type] -o [Target Pi OS type] -V"
echo -e "\t-g GCC version you want to compile?: (8.3.0|8.4.0|9.1.0|9.2.0|9.3.0|9.4.0|10.1.0|10.2.0|10.3.0|11.1.0|11.2.0|11.3.0|12.1.0|12.2.0|12.3.0|12.4.0|13.1.0|13.2.0|13.3.0|14.1.0|14.2.0)"
echo -e "\t-r What's yours Target Raspberry Pi type?: (0-1|2-3|3+)"
echo -e "\t-o What's yours Target Raspberry Pi OS type?: (buster|bullseye|bookworm)"
echo -e "\t-V Verbose output for debugging?"
echo ""
echo ""
exit 1 # Exits script after printing help
}
#input arguments handler
while getopts "g:r:o:V" opt; do
case "$opt" in
g) GCC_VERSION="$OPTARG" ;;
r) RPI_TYPE="$OPTARG" ;;
o) RPIOS_TYPE="$OPTARG" ;;
V)
VERBOSE=1
echo "Info: Activated verbose output!"
echo ""
set -v # Set verbose mode.
;;
?) helpfunction ;; #prints help function for invalid parameter
esac
done
#validates parameters and print usage helper function in case parameters are missing
if [ -z "$VERBOSE" ]; then
VERBOSE=0
fi
if [ -z "$GCC_VERSION" ] || [ -z "$RPI_TYPE" ] || [ -z "$RPIOS_TYPE" ]; then
echo "Error: Required parameters are missing!"
helpfunction
fi
#collect parameters from raspbery pi type
if [ "$RPI_TYPE" = "2-3" ]; then
FOLDER_VERSION=1
KERNEL=kernel7
ARCH=armv7-a
FPU=neon-vfpv4
elif [ "$RPI_TYPE" = "3+" ]; then
FOLDER_VERSION=2
KERNEL=kernel7
ARCH=armv8-a
FPU=neon-fp-armv8
elif [ "$RPI_TYPE" = "0-1" ]; then
FOLDER_VERSION=0
KERNEL=kernel
ARCH=armv6
FPU=vfp
else
echo "Invalid argument value: $RPI_TYPE"
exit
fi
#collect dependencies versions from raspberry pi os
if [ "$RPIOS_TYPE" = "bookworm" ]; then
if echo ${GCC_VERSION%.*} "12.2" | awk '{exit ( $1 >= $2 )}'; then
echo "$GCC_VERSION is not supported on bookworm!"
exit 0
else
GCCBASE_VERSION=12.2.0
fi
GLIBC_VERSION=2.36
BINUTILS_VERSION=2.40
elif [ "$RPIOS_TYPE" = "buster" ]; then
if echo ${GCC_VERSION%.*} "8.3" | awk '{exit ( $1 >= $2 )}'; then
echo "$GCC_VERSION is not supported on buster!"
exit 0
else
GCCBASE_VERSION=8.3.0
fi
GLIBC_VERSION=2.28
BINUTILS_VERSION=2.31.1
elif [ "$RPIOS_TYPE" = "bullseye" ]; then
if echo ${GCC_VERSION%.*} "10.2" | awk '{exit ( $1 >= $2 )}'; then
echo "$GCC_VERSION is not supported on bullseye!"
exit 0
else
GCCBASE_VERSION=10.2.0
fi
GLIBC_VERSION=2.31
BINUTILS_VERSION=2.35.2
else
echo "Invalid argument value: $RPIOS_TYPE"
exit 1
fi
#collect build directory if not defined
if [ "$BUILDDIR" = "" ]; then
#select temp directory as default
echo "Build directory is empty, using temp directory!"
BUILDDIR=$(dirname "$(mktemp tmp.XXXXXXXXXX -ut)")
fi
#collect programming languages if not defined
if [ "$LANGUAGES" = "" ]; then
#select `c,c++,fortran` as default
echo "Building binaries for c,c++,fortran programming languages!"
LANGUAGES=c,c++,fortran
fi
#pre-defined params
TARGET=arm-linux-gnueabihf
GDB_VERSION=15.1
#validate env variables
if ! [[ "$GCC_VERSION" =~ ^(8.3.0|8.4.0|9.1.0|9.2.0|9.3.0|9.4.0|10.1.0|10.2.0|10.3.0|11.1.0|11.2.0|11.3.0|12.1.0|12.2.0|12.3.0|12.4.0|13.1.0|13.2.0|13.3.0|14.1.0|14.2.0)$ ]]; then exit 1; fi
if ! [[ "$GCCBASE_VERSION" =~ ^(8.3.0|10.2.0|12.2.0)$ ]]; then exit 1; fi
if ! [[ "$GLIBC_VERSION" =~ ^(2.28|2.31|2.36)$ ]]; then exit 1; fi
if ! [[ "$BINUTILS_VERSION" =~ ^(2.31.1|2.35.2|2.40)$ ]]; then exit 1; fi
if ! [[ "$FOLDER_VERSION" =~ ^(0|1|2)$ ]]; then exit 1; fi
if ! [[ "$KERNEL" =~ ^(kernel|kernel7)$ ]]; then exit 1; fi
if ! [[ "$ARCH" =~ ^(armv6|armv7-a|armv8-a)$ ]]; then exit 1; fi
if ! [[ "$FPU" =~ ^(vfp|neon-vfpv4|neon-fp-armv8)$ ]]; then exit 1; fi
if [ "$BUILDDIR" = "" ]; then exit 1; fi
if [ "$LANGUAGES" = "" ]; then exit 1; fi
#download binaries if not found
echo "Downloading and Setting up build directories"
DOWNLOADDIR=$BUILDDIR/build_toolchains
INSTALLDIR=$BUILDDIR/cross-pi-gcc-$GCC_VERSION-$FOLDER_VERSION
SYSROOTDIR=$BUILDDIR/cross-pi-gcc-$GCC_VERSION-$FOLDER_VERSION/$TARGET/libc
mkdir -p "$DOWNLOADDIR"
mkdir -p "$INSTALLDIR"
cd "$DOWNLOADDIR" || exit
#download binaries if not found
if [ ! -d "linux" ]; then
git clone --depth=1 https://github.com/raspberrypi/linux
fi
if [ ! -d "gcc-$GCCBASE_VERSION" ]; then
if [ ! -f "gcc-$GCCBASE_VERSION.tar.gz" ]; then wget -q --no-check-certificate https://ftp.gnu.org/gnu/gcc/gcc-$GCCBASE_VERSION/gcc-$GCCBASE_VERSION.tar.gz; fi
tar xf gcc-$GCCBASE_VERSION.tar.gz
cd gcc-$GCCBASE_VERSION || exit
if [ "$GCCBASE_VERSION" = "10.2.0" ]; then
echo "Applying GCC patch!"
sed -i -e '66i#define PATH_MAX 4096\' libsanitizer/asan/asan_linux.cpp
fi
mkdir -p build
sed -i contrib/download_prerequisites -e '/base_url=/s/ftp/http/'
contrib/download_prerequisites
rm ./*.tar.* || true
cd "$DOWNLOADDIR" || exit
rm ./*.tar.* || true
fi
sed -i 's/# include <limits.h>/# include <linux\/limits.h>/' gcc-$GCCBASE_VERSION/libsanitizer/asan/asan_linux.cpp
sed -i 's/#include <limits.h>/#include <linux\/limits.h>/' gcc-$GCCBASE_VERSION/libsanitizer/asan/asan_linux.cpp
if [ ! -d "binutils-$BINUTILS_VERSION" ]; then
if [ ! -f "binutils-$BINUTILS_VERSION.tar.bz2" ]; then wget -q --no-check-certificate https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS_VERSION.tar.bz2; fi
tar xf binutils-$BINUTILS_VERSION.tar.bz2
cd binutils-$BINUTILS_VERSION || exit
mkdir -p build
cd "$DOWNLOADDIR" || exit
rm ./*.tar.* || true
fi
if [ ! -d "glibc-$GLIBC_VERSION" ]; then
# Download patched Glibc 2.31 if GCC 10 series are being built
if [[ "$GCCBASE_VERSION" =~ ^10.* ]] && [ "$GLIBC_VERSION" = "2.31" ]; then
echo "Downloading patched Glibc v2.31!"
git clone https://sourceware.org/git/glibc.git --branch release/2.31/master
mv glibc glibc-$GLIBC_VERSION
else
if [ ! -f "glibc-$GLIBC_VERSION.tar.bz2" ]; then wget -q --no-check-certificate https://ftp.gnu.org/gnu/glibc/glibc-$GLIBC_VERSION.tar.bz2; fi
tar xf glibc-$GLIBC_VERSION.tar.bz2
fi
cd glibc-$GLIBC_VERSION || exit
mkdir -p build
cd "$DOWNLOADDIR" || exit
rm ./*.tar.* || true
fi
if [ ! -d "gdb-$GDB_VERSION" ]; then
if [ ! -f "gdb-$GDB_VERSION.tar.xz" ]; then wget -q --no-check-certificate https://ftp.gnu.org/gnu/gdb/gdb-$GDB_VERSION.tar.xz; fi
tar xf gdb-$GDB_VERSION.tar.xz
cd gdb-$GDB_VERSION || exit
mkdir -p build
cd "$DOWNLOADDIR" || exit
rm ./*.tar.* || true
fi
if [ ! -d "gcc-$GCC_VERSION" ]; then
# Download patched GCC 10 series for bullseye
if [ "$RPIOS_TYPE" = "bullseye" ] && [[ "$GCC_VERSION" =~ ^10.* ]] && [ "$GCC_VERSION" != "10.2.0" ]; then
echo "Downloading patched GCC-10!"
git clone https://sourceware.org/git/gcc.git --branch releases/gcc-10
mv gcc gcc-$GCC_VERSION
else
if [ ! -f "gcc-$GCC_VERSION.tar.gz" ]; then wget -q --no-check-certificate https://ftp.gnu.org/gnu/gcc/gcc-"$GCC_VERSION"/gcc-"$GCC_VERSION".tar.gz; fi
tar xf gcc-"$GCC_VERSION".tar.gz
fi
cd gcc-"$GCC_VERSION" || exit
mkdir -p build
sed -i contrib/download_prerequisites -e '/base_url=/s/ftp/http/'
contrib/download_prerequisites
rm ./*.tar.* || true
cd "$DOWNLOADDIR" || exit
rm ./*.tar.* || true
fi
sed -i 's/# include <limits.h>/# include <linux\/limits.h>/' gcc-$GCC_VERSION/libsanitizer/asan/asan_linux.cpp
sed -i 's/#include <limits.h>/#include <linux\/limits.h>/' gcc-$GCC_VERSION/libsanitizer/asan/asan_linux.cpp
echo "Setting up paths..."
PATH=$BUILDDIR/cross-pi-gcc-$GCC_VERSION-$FOLDER_VERSION/bin:$PATH
unset LD_LIBRARY_PATH #patch
figlet -t -k -f /usr/share/figlet/standard.flf "Building Kernel Headers..."
cd "$DOWNLOADDIR"/linux || exit
KERNEL=$KERNEL
make -s ARCH=arm INSTALL_HDR_PATH="$SYSROOTDIR"/usr headers_install
mkdir -p "$SYSROOTDIR"/usr/lib
figlet -t -k -f /usr/share/figlet/standard.flf "Building binutils..."
if [ -n "$(ls -A "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build/*; fi
cd "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build || exit
../configure --target=$TARGET --prefix= --with-arch=$ARCH --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-fpu=$FPU --with-float=hard --disable-multilib
make -s -j$(nproc)
make -s install-strip DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build/*; fi
figlet -t -k -f /usr/share/figlet/standard.flf "Building Cross GCC $GCCBASE_VERSION Binaries..."
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-$GCCBASE_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-$GCCBASE_VERSION/build/*; fi
cd "$DOWNLOADDIR"/gcc-$GCCBASE_VERSION/build || exit
../configure --prefix= --target=$TARGET --enable-languages=$LANGUAGES --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-arch=$ARCH --with-fpu=$FPU --with-float=hard --disable-multilib
make -s -j$(nproc) all-gcc
make -s install-strip-gcc DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build/*; fi
cd "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build || exit
../configure --prefix=/usr --build="$MACHTYPE" --host=$TARGET --target=$TARGET --with-arch=$ARCH --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-fpu=$FPU --with-float=hard --with-headers="$SYSROOTDIR"/usr/include --with-lib="$SYSROOTDIR"/usr/lib --disable-multilib libc_cv_forced_unwind=yes
make -s install-bootstrap-headers=yes install-headers DESTDIR="$SYSROOTDIR"
make -s -j$(nproc) csu/subdir_lib
install csu/crt1.o csu/crti.o csu/crtn.o "$SYSROOTDIR"/usr/lib
$TARGET-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o "$SYSROOTDIR"/usr/lib/libc.so
touch "$SYSROOTDIR"/usr/include/gnu/stubs.h "$SYSROOTDIR"/usr/include/bits/stdio_lim.h
cd "$DOWNLOADDIR"/gcc-$GCCBASE_VERSION/build || exit
make -s -j$(nproc) all-target-libgcc
make -s install-target-libgcc DESTDIR="$INSTALLDIR"
cd "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build || exit
make -s -j$(nproc)
make -s install DESTDIR="$SYSROOTDIR"
cd "$DOWNLOADDIR"/gcc-$GCCBASE_VERSION/build || exit
if [ -n "$(ls -A "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build/*; fi
make -s -j$(nproc)
make -s install-strip DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-$GCCBASE_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-$GCCBASE_VERSION/build/*; fi
if [ "$GCC_VERSION" != "$GCCBASE_VERSION" ]; then
figlet -t -k -f /usr/share/figlet/standard.flf "Cross Compiling New Version..."
cd "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build || exit
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build/*; fi
../configure --prefix= --target=$TARGET --enable-languages=$LANGUAGES --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-headers="$SYSROOTDIR"/usr/include --with-lib="$SYSROOTDIR"/usr/lib --with-arch=$ARCH --with-fpu=$FPU --with-float=hard --disable-multilib
make -s -j$(nproc)
make -s install-strip DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build/*; fi
figlet -t -k -f /usr/share/figlet/standard.flf "Building GCC Native GCC $GCC_VERSION Binaries..."
mkdir -p "$BUILDDIR"/native-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION
cd "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build || exit
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build/*; fi
../configure --prefix= --build="$MACHTYPE" --host=$TARGET --target=$TARGET --enable-languages=$LANGUAGES --with-arch=$ARCH --with-fpu=$FPU --with-float=hard --disable-multilib --program-suffix=-"$GCC_VERSION"
make -s -j$(nproc)
make -s install-strip DESTDIR="$BUILDDIR"/native-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build/*; fi
cd "$DOWNLOADDIR"/gcc-"$GCC_VERSION" || exit
cat gcc/limitx.h gcc/glimits.h gcc/limity.h >"$BUILDDIR"/native-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION/lib/gcc/$TARGET/"$GCC_VERSION"/include-fixed/limits.h
figlet -t -k -f /usr/share/figlet/standard.flf "Building Native GDB Binaries..."
cd "$DOWNLOADDIR"/gdb-$GDB_VERSION/build || exit
if [ -n "$(ls -A "$DOWNLOADDIR"/gdb-$GDB_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gdb-$GDB_VERSION/build/*; fi
../configure --prefix= --build="$MACHTYPE" --host=$TARGET --target=$TARGET --enable-languages=$LANGUAGES --with-arch=$ARCH --with-fpu=$FPU --with-float=hard --program-suffix=-"$GCC_VERSION"
make -s -j$(nproc)
make -s install DESTDIR="$BUILDDIR"/native-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION
if [ -n "$(ls -A "$DOWNLOADDIR"/gdb-$GDB_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gdb-$GDB_VERSION/build/*; fi
figlet -t -k -f /usr/share/figlet/standard.flf "Done Building Native GDB Binaries..."
mv "$BUILDDIR"/native-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION "$HOME"
cd "$HOME" || exit
#compress with maximum possible compression level.
tar cf - native-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION | pigz -9 -p 32 >native-gcc-"$GCC_VERSION"-pi_"$RPI_TYPE".tar.gz
rm -rf "$HOME"/native-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION
figlet -t -k -f /usr/share/figlet/standard.flf "Done Building Native GCC $GCC_VERSION Binaries..."
fi
cd "$DOWNLOADDIR"/gcc-"$GCC_VERSION" || exit
cat gcc/limitx.h gcc/glimits.h gcc/limity.h >$(dirname $($TARGET-gcc -print-libgcc-file-name))/include-fixed/limits.h
figlet -t -k -f /usr/share/figlet/standard.flf "Building Cross GDB Binaries..."
cd "$DOWNLOADDIR"/gdb-$GDB_VERSION/build || exit
if [ -n "$(ls -A "$DOWNLOADDIR"/gdb-$GDB_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gdb-$GDB_VERSION/build/*; fi #cleanup
../configure --prefix= --target=$TARGET --with-arch=$ARCH --enable-languages=$LANGUAGES --with-fpu=$FPU --with-float=hard -with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR"
make -s -j$(nproc)
make -s install DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/gdb-$GDB_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gdb-$GDB_VERSION/build/*; fi #cleanup
figlet -t -k -f /usr/share/figlet/standard.flf "Done Building Cross GDB Binaries..."
mv "$BUILDDIR"/cross-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION "$HOME"
cd "$HOME" || exit
#compress with maximum possible compression level.
tar cf - cross-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION | pigz -9 >cross-gcc-"$GCC_VERSION"-pi_"$RPI_TYPE".tar.gz
figlet -t -k -f /usr/share/figlet/standard.flf "Done Building Cross GCC $GCC_VERSION Binaries..."
rm -rf "$HOME"/cross-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION
#clean path
PATH=$(echo "$PATH" | sed -e 's;:\?$BUILDDIR/cross-pi-gcc-$GCC_VERSION-$FOLDER_VERSION/bin;;' -e 's;$BUILDDIR/cross-pi-gcc-$GCC_VERSION-$FOLDER_VERSION/bin:\?;;')