[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
howtos:hardware:arm:gcc-10.x_aarch64_cross-compiler [2021/03/12 02:14 (UTC)] – [Aarch64 cross-compiler script code] made script into downladable file exaga | howtos:hardware:arm:gcc-10.x_aarch64_cross-compiler [2021/10/01 09:17 (UTC)] – [Aarch64 cross-compiling 'HOWTO' example] corrected error in kernel8.img filename exaga | ||
---|---|---|---|
Line 1: | Line 1: | ||
<!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | ||
- | ====== Slackware ARM current gcc-10.2.x armv8 arm64 aarch64 cross-compiler for the Raspberry Pi 4 ====== | + | ====== Slackware ARM current gcc-10.3.x armv8 arm64 aarch64 cross-compiler for the Raspberry Pi 4 ====== |
===== Preface ===== | ===== Preface ===== | ||
Line 10: | Line 10: | ||
===== Notes ===== | ===== Notes ===== | ||
- | Slackware ARM current was used on a Raspberry Pi 4 [4GB RAM] to build and install the gcc-10.2.0 aarch64-linux cross-compiler. | + | Slackware ARM current was used on a Raspberry Pi 4 [4GB RAM] to build and install the gcc-10.3.0 aarch64-linux cross-compiler. |
The Linux kernel source downloaded is from the Raspberry Pi Github repository: https:// | The Linux kernel source downloaded is from the Raspberry Pi Github repository: https:// | ||
Line 27: | Line 27: | ||
===== Aarch64 cross-compiler script code ===== | ===== Aarch64 cross-compiler script code ===== | ||
- | Copy and paste the following code into a text file and save it under any name you like but best to keep the extension of " | + | Download |
- | Make the file executable using 'chmod +x < | + | Make the file executable using 'chmod +x SARPi64.SlackBuild-gcc-10.3-aarch64-cc.sh' or 'chmod 755 SARPi64.SlackBuild-gcc-10.3-aarch64-cc.sh' command. |
Refer to the commented top section of the script code for usage. | Refer to the commented top section of the script code for usage. | ||
- | <file sh SARPi64.SlackBuild-gcc-10.2-aarch64-cc.sh> | + | <file sh SARPi64.SlackBuild-gcc-10.3-aarch64-cc.sh> |
#! /bin/bash | #! /bin/bash | ||
############################################################################## | ############################################################################## | ||
- | # Slackware ARM gcc-10.2.0 aarch64 cross-compiler for Raspberry Pi | + | # Slackware ARM gcc-10.3.0 aarch64 cross-compiler for Raspberry Pi |
# | # | ||
- | # SARPi64.SlackBuild-gcc-10.2.0-aarch64-cc [v3.0] - 2020-12-29 | + | # SARPi64.SlackBuild-gcc-10.3.0-aarch64-cc [v3.0] - 2021-04-22 |
# | # | ||
# 2020-12-29 by Exaga | # 2020-12-29 by Exaga | ||
Line 51: | Line 51: | ||
# | # | ||
# This script downloads RPi Linux kernel source and the required binaries, | # This script downloads RPi Linux kernel source and the required binaries, | ||
- | # and configures, builds, patches, and installs a gcc 10.2.x aarch64-linux | + | # and configures, builds, patches, and installs a gcc 10.3.x aarch64-linux |
# cross-compiler on Slackware ARM current running on a Raspberry Pi 3/4. | # cross-compiler on Slackware ARM current running on a Raspberry Pi 3/4. | ||
# | # | ||
Line 58: | Line 58: | ||
# (e.g. / | # (e.g. / | ||
# | # | ||
- | # ~# chmod +x SARPi64.SlackBuild-gcc-10.2-aarch64-cc.sh | + | # ~# chmod +x SARPi64.SlackBuild-gcc-10.3-aarch64-cc.sh |
- | # ~# ./ | + | # ~# ./ |
# | # | ||
# You may install the cross-compiler anywhere you like, as long as it can be | # You may install the cross-compiler anywhere you like, as long as it can be | ||
Line 100: | Line 100: | ||
# | # | ||
### IMPORTANT! ### | ### IMPORTANT! ### | ||
- | # Before running this build script, export the INSTALL_PATH | + | # This script |
- | # root ' | + | # The PATH of the cross-compiler |
- | # the location | + | # the $PATH. PATH command: |
- | # $PATH. | + | |
- | # permanent fixture. It's up to you if/how you do it. Example export | + | |
- | # PATH command: | + | |
# | # | ||
# ~# export PATH=/ | # ~# export PATH=/ | ||
Line 138: | Line 135: | ||
# Required build packages-versions [* newer versions may exist] | # Required build packages-versions [* newer versions may exist] | ||
- | BINUTILS_VERSION=binutils-2.35 | + | BINUTILS_VERSION=binutils-2.36 |
CLOOG_VERSION=cloog-0.18.1 | CLOOG_VERSION=cloog-0.18.1 | ||
- | GCC_VERSION=gcc-10.2.0 | + | GCC_VERSION=gcc-10.3.0 |
- | GLIBC_VERSION=glibc-2.32 | + | GLIBC_VERSION=glibc-2.33 |
GMP_VERSION=gmp-6.2.1 | GMP_VERSION=gmp-6.2.1 | ||
ISL_VERSION=isl-0.18 | ISL_VERSION=isl-0.18 | ||
Line 190: | Line 187: | ||
echo " ## Build: $GCC_VERSION | echo " ## Build: $GCC_VERSION | ||
echo " ## Timestamp: $(date '+%F %T') " | echo " ## Timestamp: $(date '+%F %T') " | ||
- | echo " ## SARPi64 Project [sarpi64.fatdog.eu] " | + | echo " ## SARPi64 Project [sarpi64.penthux.net] " |
echo " ############################################" | echo " ############################################" | ||
echo | echo | ||
Line 202: | Line 199: | ||
echo " | echo " | ||
if [[ ! " | if [[ ! " | ||
- | echo " | + | |
- | echo "Use command: | + | |
- | exit | + | |
# echo -e $INSTALL_PATH/ | # echo -e $INSTALL_PATH/ | ||
else | else | ||
- | | + | |
fi | fi | ||
Line 325: | Line 320: | ||
make $PARALLEL_JOBS install-gcc | make $PARALLEL_JOBS install-gcc | ||
- | # create gcc-10.2.0 libsanitizer asan_linux-cpp.patch file | + | # create gcc-10.3.0 libsanitizer asan_linux-cpp.patch file |
cd " | cd " | ||
touch asan_linux-cpp.patch | touch asan_linux-cpp.patch | ||
cat << EOF > asan_linux-cpp.patch | cat << EOF > asan_linux-cpp.patch | ||
- | --- gcc-10.2.0/ | + | --- gcc-10.3.0/ |
- | +++ asan_linux.cpp 2020-12-29 23:20:04.000000000 +0000 | + | +++ asan_linux.cpp.new 2021-04-22 13:26:26.000000000 +0100 |
@@ -76,6 +76,10 @@ | @@ -76,6 +76,10 @@ | ||
| | ||
} | } | ||
- | + | ||
+#ifndef PATH_MAX | +#ifndef PATH_MAX | ||
+#define PATH_MAX 4096 | +#define PATH_MAX 4096 | ||
Line 340: | Line 335: | ||
+ | + | ||
| | ||
- | + | ||
void InitializePlatformInterceptors() {} | void InitializePlatformInterceptors() {} | ||
EOF | EOF | ||
- | # Patch gcc-10.2.x/ | + | # Patch gcc-10.3.x/ |
ASANLINUXCC=$CWD/ | ASANLINUXCC=$CWD/ | ||
if [ ! -f " | if [ ! -f " | ||
Line 418: | Line 413: | ||
===== Configuring the system to use the Aarch64 cross-compiler ===== | ===== Configuring the system to use the Aarch64 cross-compiler ===== | ||
- | Once the cross-compiler has been built and you intend to use it to compile Aarch64 [64bit] binaries, the location of the tool-chains must be exported to your system' | + | Once the cross-compiler has been built and you intend to use it to compile Aarch64 [64bit] binaries, the location of the tool-chains must be exported to your system' |
< | < | ||
Line 425: | Line 420: | ||
This is the output of the $PATH on our Slackware ARM system before adding the '/ | This is the output of the $PATH on our Slackware ARM system before adding the '/ | ||
- | If you didn't change the ' | + | If you didn't change the ' |
< | < | ||
- | Obviously, if you did install | + | This is the command to use if it doesn' |
< | < | ||
/ | / | ||
- | The example output above is what you're trying to achieve and all looks good because the cross compile PATH appears first before everything else. | + | The example output above all looks good because the cross compile PATH appears first before everything else. |
===== Aarch64 cross-compiling ' | ===== Aarch64 cross-compiling ' | ||
Line 485: | Line 480: | ||
# | # | ||
- | # Compiler: aarch64-linux-gcc (GCC) 10.2.0 | + | # Compiler: aarch64-linux-gcc (GCC) 10.3.0 |
# | # | ||
CONFIG_CC_IS_GCC=y | CONFIG_CC_IS_GCC=y | ||
- | CONFIG_GCC_VERSION=100200 | + | CONFIG_GCC_VERSION=100300 |
root@slackware:/ | root@slackware:/ | ||
Line 508: | Line 503: | ||
So with everything compiled and built, you just need to copy the ' | So with everything compiled and built, you just need to copy the ' | ||
- | <note important> | + | <note important> |
- | < | + | < |
root@slackware:/ | root@slackware:/ | ||
root@slackware:/ | root@slackware:/ | ||
Line 521: | Line 516: | ||
====== Sources ====== | ====== Sources ====== | ||
- | # If you need to install any of the pre-requisite software here are the links [* check for updates!]: | + | # If you need to install any of the pre-requisite software here are the links [**NB: check for updates!**]: |
- | [[ftp:// | + | [[ftp:// |
- | [[ftp:// | + | [[ftp:// |
- | [[ftp:// | + | [[ftp:// |
- | [[ftp:// | + | [[ftp:// |
[[https:// | [[https:// | ||
[[https:// | [[https:// |