[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 revision | ||
howtos:hardware:arm:gcc-10.x_aarch64_cross-compiler [2021/04/08 06:49 (UTC)] – [Aarch64 cross-compiler script code] revised script code exaga | howtos:hardware:arm:gcc-10.x_aarch64_cross-compiler [2021/10/01 09:26 (UTC)] (current) – [AArch64 cross-compiling 'HOWTO' example] removed superfluous text 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 ===== | ||
- | Download the ' | + | Download the ' |
- | Make the file executable using 'chmod +x SARPi64.SlackBuild-gcc-10.2-aarch64-cc.sh' | + | Make the file executable using 'chmod +x SARPi64.SlackBuild-gcc-10.3-aarch64-cc.sh' |
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 135: | 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 187: | 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 320: | 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 335: | 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 413: | 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 420: | 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 480: | 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 501: | Line 501: | ||
<note warning> | <note warning> | ||
- | 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:/ |