[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-13.x_aarch64_cross-compiler [2023/10/15 16:10 (UTC)] – [Sources] timestamp exaga | howtos:hardware:arm:gcc-13.x_aarch64_cross-compiler [2024/02/08 08:04 (UTC)] (current) – [AArch64 cross-compiler script code] changed -j4 to -j$(nproc) exaga | ||
---|---|---|---|
Line 10: | Line 10: | ||
===== Notes ===== | ===== Notes ===== | ||
- | Slackware ARM 15.0 was used on a Raspberry Pi 2 [2GB RAM] to build and install the gcc-13.2.0 aarch64-linux cross-compiler. | + | Slackware ARM 15.0 was used on a Raspberry Pi 3 [1GB RAM] to build and install the gcc-13.2.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 21: | Line 21: | ||
As a pre-requisite, | As a pre-requisite, | ||
- | * a Raspberry Pi 3, 4, 5, (i.e. a 64-bit CPU) running Slackware ARM current | + | * a Raspberry Pi 3, 4, 5, (i.e. a 64-bit CPU) running Slackware ARM 15.0 with as much unused [>= 5GB] storage space on your system as possible. \\ |
- | * [[http:// | + | * [[http:// |
Line 38: | Line 38: | ||
############################################################################## | ############################################################################## | ||
- | # Slackware ARM gcc-13.2.0 | + | # |
+ | # Slackware ARM gcc-13.2.0 | ||
# | # | ||
# SARPi64.SlackBuild-gcc-13.2.0-aarch64-cc [v1.6] - 2023-10-14 | # SARPi64.SlackBuild-gcc-13.2.0-aarch64-cc [v1.6] - 2023-10-14 | ||
Line 55: | Line 56: | ||
# 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 13.2.x aarch64-linux | # and configures, builds, patches, and installs a gcc 13.2.x aarch64-linux | ||
- | # cross-compiler on Slackware ARM current | + | # cross-compiler on Slackware ARM running on a Raspberry Pi 3/4/5. |
# | # | ||
### Installation & Usage ### | ### Installation & Usage ### | ||
+ | # | ||
# You should create a ' | # You should create a ' | ||
# (e.g. / | # (e.g. / | ||
# | # | ||
- | # ~# chmod +x SARPi64.SlackBuild-gcc-13.2.0-aarch64-cc.sh | ||
# ~# ./ | # ~# ./ | ||
# | # | ||
Line 78: | Line 79: | ||
# | # | ||
# If you need to install any of the packages above [* check for updates!]: | # If you need to install any of the packages above [* check for updates!]: | ||
- | # http:// | + | # http:// |
- | # http:// | + | # http:// |
- | # http:// | + | # http:// |
- | # http:// | + | # http:// |
# | # | ||
# NB: The gcc package you compile should match your currently installed gcc | # NB: The gcc package you compile should match your currently installed gcc | ||
Line 87: | Line 88: | ||
# | # | ||
# ~# gcc --version | # ~# gcc --version | ||
+ | # | ||
+ | # Copy the Linux kernel-headers package to /tmp/usr and delete asm directory. | ||
+ | # Then symlink it to asm-armv8 directory: | ||
+ | # | ||
+ | # root@jook:/ | ||
+ | # root@jook:/ | ||
# | # | ||
# More recent gcc packages-versions may exist. You may wish to install them. | # More recent gcc packages-versions may exist. You may wish to install them. | ||
Line 94: | Line 101: | ||
# | # | ||
# binutils - https:// | # binutils - https:// | ||
- | # cloog -https:// | + | # cloog - ftp:// |
# gcc - https:// | # gcc - https:// | ||
# glibc - https:// | # glibc - https:// | ||
# gmp - https:// | # gmp - https:// | ||
- | # isl - https:// | + | # isl - ftp:// |
# mpfr - https:// | # mpfr - https:// | ||
# mpc - https:// | # mpc - https:// | ||
Line 114: | Line 121: | ||
# | # | ||
### Disclaimer ### | ### Disclaimer ### | ||
+ | # | ||
# This script was created on Slackware ARM and intended for development | # This script was created on Slackware ARM and intended for development | ||
# and testing on Slackware AArch64. This script may work on other Linux | # and testing on Slackware AArch64. This script may work on other Linux | ||
Line 121: | Line 129: | ||
# Slackware AArch64. | # Slackware AArch64. | ||
# | # | ||
- | # Copyright 2016-2022 Exaga, sarpi.penthux.net | + | # |
- | # All rights reserved. | + | |
# | # | ||
# | # | ||
# any purpose with or without fee is hereby granted, provided that | # any purpose with or without fee is hereby granted, provided that | ||
- | # the above copyright notice and this permission | + | # the above copyright notice and this disclaimer |
- | # | + | # all copies. All rights reserved. |
# | # | ||
# THIS SOFTWARE IS PROVIDED ``AS IS'' | # THIS SOFTWARE IS PROVIDED ``AS IS'' | ||
Line 154: | Line 161: | ||
############################################################################## | ############################################################################## | ||
- | |||
- | ############################################################################# | ||
- | ## | ||
- | ############################################################################# | ||
# Installation directory - edit INSTALL_PATH as required | # Installation directory - edit INSTALL_PATH as required | ||
INSTALL_PATH=/ | INSTALL_PATH=/ | ||
- | # Required build packages versions [* newer versions may exist] | + | # Required build packages-versions [* newer versions may exist] |
BINUTILS_VERSION=binutils-2.41 | BINUTILS_VERSION=binutils-2.41 | ||
CLOOG_VERSION=cloog-0.18.1 | CLOOG_VERSION=cloog-0.18.1 | ||
GCC_VERSION=gcc-13.2.0 | GCC_VERSION=gcc-13.2.0 | ||
GLIBC_VERSION=glibc-2.38 | GLIBC_VERSION=glibc-2.38 | ||
- | GMP_VERSION=gmp-6.3.0 | + | GMP_VERSION=gmp-6.2.1 |
ISL_VERSION=isl-0.24 | ISL_VERSION=isl-0.24 | ||
- | MPFR_VERSION=mpfr-4.2.1 | + | MPFR_VERSION=mpfr-4.1.0 |
- | MPC_VERSION=mpc-1.3.1 | + | MPC_VERSION=mpc-1.2.1 |
# RPi GitHub Linux source - working branch [e.g. rpi-5.15.y | rpi-5.19.y | rpi-6.1.y | # RPi GitHub Linux source - working branch [e.g. rpi-5.15.y | rpi-5.19.y | rpi-6.1.y | ||
- | DEV_BRANCH=rpi-6.1.y | + | DEV_BRANCH=rpi-6.6.y |
Line 189: | Line 192: | ||
# Build variables | # Build variables | ||
PRGNAM=SARPi64.SlackBuild-aarch64-cc | PRGNAM=SARPi64.SlackBuild-aarch64-cc | ||
- | ARCH_TARGET=aarch64-linux | + | ARCH_TARGET=aarch64-linux |
LINUX_ARCH=arm64 | LINUX_ARCH=arm64 | ||
QUADLET=aarch64-unknown-linux-gnu # aarch64-arm-none-eabi | QUADLET=aarch64-unknown-linux-gnu # aarch64-arm-none-eabi | ||
Line 195: | Line 198: | ||
RPI_GITURL_LINUX=https:// | RPI_GITURL_LINUX=https:// | ||
BUILD_LANGUAGES=" | BUILD_LANGUAGES=" | ||
- | ALT_CONFIG_OPTIONS=" | + | ALT_CONFIG_OPTIONS=" |
+ | BLD_CONFIG_OPTIONS=" | ||
TEST_CONFIG_OPTIONS=" | TEST_CONFIG_OPTIONS=" | ||
- | RPI4_CONFIG_OPTIONS=" | + | RPI_CONFIG_OPTIONS=" |
- | PARALLEL_JOBS=-j4 | + | # https:// |
+ | PARALLEL_JOBS=" | ||
CWD=$(pwd) | CWD=$(pwd) | ||
# Define CONFIG_OPTIONS for build | # Define CONFIG_OPTIONS for build | ||
CONFIG_OPTIONS=$ALT_CONFIG_OPTIONS | CONFIG_OPTIONS=$ALT_CONFIG_OPTIONS | ||
+ | |||
+ | # Set bulletin | ||
+ | set -e | ||
+ | |||
+ | # INSTALL_PATH needs to be at the front of $PATH | ||
+ | # Command: export PATH=/ | ||
+ | echo " | ||
+ | if [[ ! " | ||
+ | export PATH=/" | ||
+ | else | ||
+ | echo "Found $INSTALL_PATH\/ | ||
+ | fi | ||
# Uncomment to log EVERYTHING during build process [** WARNING! HUGE log filesize! **] | # Uncomment to log EVERYTHING during build process [** WARNING! HUGE log filesize! **] | ||
Line 222: | Line 239: | ||
sarpiSP64 | sarpiSP64 | ||
echo " | echo " | ||
- | |||
- | # INSTALL_PATH needs to be at the front of $PATH | ||
- | # Command: export PATH=/ | ||
- | echo " | ||
- | if [[ ! " | ||
- | export PATH=/" | ||
- | # echo -e $INSTALL_PATH/ | ||
- | else | ||
- | echo "Found $INSTALL_PATH\/ | ||
- | fi | ||
# Prerequisite packages | # Prerequisite packages | ||
Line 243: | Line 250: | ||
echo " | echo " | ||
echo " | echo " | ||
- | exit 1 | + | exit 1; |
elif [ ! -e " | elif [ ! -e " | ||
echo " | echo " | ||
echo " | echo " | ||
- | exit 1 | + | exit 1; |
elif [ ! -e " | elif [ ! -e " | ||
echo " | echo " | ||
echo " | echo " | ||
- | exit 1 | + | exit 1; |
elif [ ! -e " | elif [ ! -e " | ||
echo " | echo " | ||
echo " | echo " | ||
- | exit 1 | + | exit 1; |
else | else | ||
echo " | echo " | ||
fi | fi | ||
+ | |||
+ | # Delete build-binutils directory [if it exists] | ||
+ | rm -rf build-binutils | ||
+ | mkdir build-binutils | ||
# Download RPi kernel source ** this may take a while ** | # Download RPi kernel source ** this may take a while ** | ||
Line 265: | Line 276: | ||
if [ ! -e $LINUX_FLAVOUR/ | if [ ! -e $LINUX_FLAVOUR/ | ||
echo " | echo " | ||
- | git clone --depth=1 $RPI_GITURL_LINUX/ | + | git clone --branch $DEV_BRANCH |
fi | fi | ||
cd $LINUX_FLAVOUR | cd $LINUX_FLAVOUR | ||
Line 307: | Line 318: | ||
fi | fi | ||
- | # Create symbolic links so gcc builds these dependencies | + | # Create symbolic links so gcc builds these dependencies. This can be done |
+ | # automagically by using the following command in gcc source dir: | ||
+ | # ./ | ||
+ | # | ||
echo " | echo " | ||
cd " | cd " | ||
+ | ln -sf ../ | ||
ln -sf ../ | ln -sf ../ | ||
- | ln -sf ../ | ||
ln -sf ../ | ln -sf ../ | ||
ln -sf ../ | ln -sf ../ | ||
ln -sf ../ | ln -sf ../ | ||
- | # Create | + | # Create |
echo " | echo " | ||
rm -rf $INSTALL_PATH | rm -rf $INSTALL_PATH | ||
Line 325: | Line 339: | ||
# Build binutils | # Build binutils | ||
echo " | echo " | ||
- | rm -rf build-binutils | ||
- | mkdir build-binutils | ||
cd build-binutils | cd build-binutils | ||
../ | ../ | ||
Line 343: | Line 355: | ||
mkdir -p build-gcc | mkdir -p build-gcc | ||
cd build-gcc | cd build-gcc | ||
- | ../ | + | ../ |
make $PARALLEL_JOBS all-gcc | make $PARALLEL_JOBS all-gcc | ||
echo " | echo " | ||
Line 352: | Line 364: | ||
touch asan_linux-cpp.patch | touch asan_linux-cpp.patch | ||
cat << EOF > asan_linux-cpp.patch | cat << EOF > asan_linux-cpp.patch | ||
- | --- gcc-13.2.0/ | + | --- gcc-13.2.0/ |
- | +++ asan_linux-cpp.new 2023-10-15 14:36:04.000000000 +0100 | + | +++ asan_linux-cpp.new 2023-10-16 08:33:44.000000000 +0100 |
@@ -77,6 +77,10 @@ | @@ -77,6 +77,10 @@ | ||
| | ||
Line 368: | Line 380: | ||
EOF | EOF | ||
- | # Patch gcc-13.2.x/ | + | # Patch gcc-13.2.x/ |
ASANLINUXCC=$CWD/ | ASANLINUXCC=$CWD/ | ||
if [ ! -f " | if [ ! -f " | ||
echo " | echo " | ||
- | patch -b " | + | patch -b " |
sarpiSP64 | sarpiSP64 | ||
echo " | echo " | ||
Line 383: | Line 395: | ||
mkdir -p build-glibc | mkdir -p build-glibc | ||
cd build-glibc | cd build-glibc | ||
- | ../ | + | ../ |
make $PARALLEL_JOBS install-bootstrap-headers=yes install-headers | make $PARALLEL_JOBS install-bootstrap-headers=yes install-headers | ||
make $PARALLEL_JOBS csu/ | make $PARALLEL_JOBS csu/ | ||
Line 401: | Line 413: | ||
echo " | echo " | ||
cd " | cd " | ||
- | make $PARALLEL_JOBS | + | make $PARALLEL_JOBS |
echo " | echo " | ||
make install | make install | ||
Line 408: | Line 420: | ||
echo " | echo " | ||
cd " | cd " | ||
- | make $PARALLEL_JOBS | + | make $PARALLEL_JOBS |
echo " | echo " | ||
make install | make install | ||
cd " | cd " | ||
- | # Check status of aarch64-linux-gcc cross-compiler | + | # Check status of AArch64-linux-gcc cross-compiler |
echo " | echo " | ||
ARCH_TARGET_STATUS=$(which $ARCH_TARGET-gcc) | ARCH_TARGET_STATUS=$(which $ARCH_TARGET-gcc) | ||
Line 422: | Line 434: | ||
sarpiSP64 | sarpiSP64 | ||
echo " | echo " | ||
- | exit 1 | + | exit 1; |
else | else | ||
# Done! | # Done! | ||
Line 432: | Line 444: | ||
fi | fi | ||
- | # Done | + | # |
- | exit 0 | + | exit 0; |
# | # | ||
Line 547: | Line 559: | ||
# If you need to install any of the pre-requisite software here are the links [**NB: check for updates!**]: | # If you need to install any of the pre-requisite software here are the links [**NB: check for updates!**]: | ||
- | [[ftp:// | + | [[http:// |
- | [[ftp:// | + | [[http:// |
- | [[ftp:// | + | [[http:// |
- | [[ftp:// | + | [[http:// |
[[https:// | [[https:// | ||
[[https:// | [[https:// | ||
- | [[ftp:// | + | [[https:// |
# Documentation which assisted in this guide: | # Documentation which assisted in this guide: | ||
Line 567: | Line 579: | ||
<!-- * Contributions by [[wiki: | <!-- * Contributions by [[wiki: | ||
- | * Originally written by [[wiki: | + | * Originally written by [[wiki: |
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> |