Build arm linux gnueabihf

Кросскомпиляция под ARM

Достаточно давно хотел освоить сабж, но всё были другие более приоритетные дела. И вот настала очередь кросскомпиляции.

В данном посте будут описаны:

  1. Инструменты
  2. Элементарная технология кросскомпиляции
  3. И, собственно, HOW2

Кому это интересно, прошу под кат.

Вводная

Одно из развивающихся направлений в современном IT это IoT. Развивается это направление достаточно быстро, всё время выходят всякие крутые штуки (типа кроссовок со встроенным трекером или кроссовки, которые могут указывать направление, куда идти (специально для слепых людей)). Основная масса этих устройств представляют собой что-то типа «блютуз лампочки», но оставшаяся часть являет собой сложные процессорные системы, которые собирают данные и управляют этим огромным разнообразием всяких умных штучек. Эти сложные системы, как правило, представляют собой одноплатные компьютеры, такие как Raspberry Pi, Odroid, Orange Pi и т.п. На них запускается Linux и пишется прикладной софт. В основном, используют скриптовые языки и Java. Но бывают приложения, когда необходима высокая производительность, и здесь, естественно, требуются C и C++. К примеру, может потребоваться добавить что-то специфичное в ядро или, как можно быстрее, высчитать БПФ. Вот тут-то и нужна кросскомпиляция.

Если проект не очень большой, то его можно собирать и отлаживать прямо на целевой платформе. А если проект достаточно велик, то компиляция на целевой платформе будет затруднительна из-за временных издержек. К примеру, попробуйте собрать Boost на Raspberry Pi. Думаю, ожидание сборки будет продолжительным, а если ещё и ошибки какие всплывут, то это может занять ох как много времени.

Поэтому лучше собирать на хосте. В моём случае, это i5 с 4ГБ ОЗУ, Fedora 24.

Инструменты

Для кросскомпиляции под ARM требуются toolchain и эмулятор платформы либо реальная целевая платформа.

Т.к. меня интересует компиляция для ARM, то использоваться будет и соответствующий toolchain.

Toolchain’ы делятся на несколько типов или триплетов. Триплет обычно состоит из трёх частей: целевой процессор, vendor и OS, vendor зачастую опускается.

  • *-none-eabi — это toolchain для компиляции проекта работающего в bare metal.
  • *eabi — это toolchain для компиляции проекта работающего в какой-либо ОС. В моём случае, это Linux.
  • *eabihf — это почти то же самое, что и eabi, с разницей в реализации ABI вызова функций с плавающей точкой. hf — расшифровывается как hard float.

Описанное выше справедливо для gcc и сделанных на его базе toolchain’ах.

Сперва я пытался использовать toolchain’ы, которые лежат в репах Fedora 24. Но был неприятно удивлён этим:

Поискав, наткнулся на toolchain от компании Linaro. И он меня вполне устроил.

Второй инструмент- это QEMU. Я буду использовать его, т.к. мой Odroid-C1+ пал смертью храбрых (нагнулся контроллер SD карты). Но я таки успел с ним чуток поработать, что не может не радовать.

Элементарная технология кросскомпиляции

Собственно, ничего необычного в этом нет. Просто используется toolchain в роли компилятора. А стандартные библиотеки поставляются вместе с toolchain’ом.

Выглядит это так:

Какие ключи у toolchain’а можно посмотреть на сайте gnu, в соответствующем разделе.

Для начала нужно запустить эмуляцию с интересующей платформой. Я решил съэмулировать Cortex-A9.

После нескольких неудачных попыток наткнулся на этот how2, который оказался вполне вменяемым, на мой взгляд.

Ну сперва, само собою, нужно заиметь QEMU. Установил я его из стандартных репов Fedor’ы.

Далее создаём образ жёсткого диска, на который будет установлен Debian.

По этой ссылке скачал vmlinuz и initrd и запустил их в эмуляции.

Далее просто устанавливаем Debian на наш образ жёсткого диска (у меня ушло

После установки нужно вынуть из образа жёсткого диска vmlinuz и initrd. Делал я это по описанию отсюда.

Сперва узнаём смещение, где расположен раздел с нужными нам файлами:

Теперь по этому смещению примонтируем нужный нам раздел.

Копируем файлы vmlinuz и initrd и размонтируем жёсткий диск.

Теперь можно запустить эмуляцию.

И вот заветное приглашение:

Теперь с хоста по SSH можно подцепиться к симуляции.

Теперь можно и собрать программку. По Makefile’у ясно, что будет калькулятор. Простенький.

Собираем на хосте исполняемый файл.

Отмечу, что проще собрать с ключом -static, если нет особого желания предаваться плотским утехам с библиотеками на целевой платформе.

Копируем исполняемый файл на таргет и проверяем.

Собственно, вот такая она, эта кросскомпиляция.

UPD: Подправил информацию по toolchain’ам по комментарию grossws.

Источник

Заводим GNU/Linux на ARM-плате с нуля (на примере Kali и iMX.6)

tl;dr: собираю образ Kali Linux для ARM-компьютера, в программе debootstrap , linux и u-boot .

Если вы покупали какой-нибудь не очень популярный одноплатник, то могли столкнуться с отсутствием для него образа любимого дистрибутива. Приблизительно то же самое случилось с планируемым Flipper One. Kali Linux под IMX6 просто нету (я готовлю), поэтому собирать приходится самостоятельно.

Процесс загрузки достаточно простой:

  1. Инициализируется железо.
  2. Из некоторой области на запоминающем устройства (SD-карта/eMMC/etc) считывается и выполняется загрузчик.
  3. Загрузчик ищет ядро операционной системы и загружает его в некоторую область памяти и выполняет.
  4. Ядро загружает всю остальную ОС.
Читайте также:  Windows server 2016 активация mak ключом

Для моей задачи хватает такого уровня детализации, подробности можете прочесть в другой статье. Упомянутые выше «некоторые» области отличаются от платы к плате, что и создаёт некоторые сложности с установкой. Загрузку серверных ARM-платформ пытаются стандартизовать с помощью UEFI, но покуда это доступно не для всех, придётся собирать всё по отдельности.

Сборка корневой файловой системы

Для начала нужно подготовить разделы. Das U-Boot поддерживает разные ФС, я выбрал FAT32 для /boot и ext3 для корня, это стандартная разметка образов для Kali под ARM. Я воспользуюсь GNU Parted, но вы можете сделать то же самое более привычным fdisk . Также понадобятся dosfstools и e2fsprogs для создания ФС: apt install parted dosfstools e2fsprogs .

  1. Отмечаем SD-карту как использующую MBR-разметку: parted -s /dev/mmcblk0 mklabel msdos
  2. Создаём раздел под /boot на 128 мегабайт: parted -s /dev/mmcblk0 mkpart primary fat32 1MiB 128MiB . Первый пропущенный мегабайт необходимо оставить под саму разметку и под загрузчик.
  3. Создаём корневую ФС на всю оставшуюся ёмкость: parted -s /dev/mmcblk0 mkpart primary ext4 128MiB 100%
  4. Если вдруг у вас не создались или не изменились файлы разделов, надо выполнить `partprobe`, тогда таблица разделов будет перечитана.
  5. Создаём файловую систему загрузочного раздела с меткой BOOT : mkfs.vfat -n BOOT -F 32 -v /dev/mmcblk0p1
  6. Создаём корневую ФС с меткой ROOTFS : mkfs.ext3 -L ROOTFS /dev/mmcblk0p2

Отлично, теперь можно её заполнять. Для этого дополнительно потребуется debootstrap , утилита для создания корневых ФС Debian-подобных операционных систем: apt install debootstrap .

  1. Монтируем раздел в /mnt/ (используйте более удобную для себя точку монтирования): mount /dev/mmcblk0p2 /mnt
  2. Собственно заполняем файловую систему: debootstrap —foreign —include=qemu-user-static —arch armhf kali-rolling /mnt/ http://http.kali.org/kali . Параметр —include указывает дополнительно установить некоторые пакеты, я указал статически собранный эмулятор QEMU. Он позволяет выполнять chroot в ARM-окружение. Смысл остальных опций можно посмотреть в man debootstrap . Не забудьте, что не любая ARM-плата поддерживает архитектуру armhf .
  3. Из-за разницы архитектур debootstrap выполняется в два этапа, второй выполняется так: chroot /mnt/ /debootstrap/debootstrap —second-stage
  4. Теперь нужно зачрутиться: chroot /mnt /bin/bash
  5. Заполняем /etc/hosts и /etc/hostname целевой ФС. Заполните по аналогии с содержимым на вашем локальном компьютере, не забудьте только заменить имя хоста.
  6. Можно донастроить всё остальное. В частности я доустанавливаю locales (ключи репозитория), перенастраиваю локали и часовой пояс ( dpkg-reconfigure locales tzdata ). Не забудьте задать пароль командой passwd .
  7. Задаём пароль для root командой passwd .
  8. Приготовления образа для меня завершаются заполнением /etc/fstab внутри /mnt/ .

Загружать буду в соответствии с созданными ранее метками, поэтому содержимое будет таким:

LABEL=ROOTFS / auto errors=remount-ro 0 1
LABEL=BOOT /boot auto defaults 0 0

Наконец, можно примонтировать загрузочный раздел, он нам понадобится для ядра: `mount /dev/mmcblk0p1 /mnt/boot/`

Сборка Linux

Для сборки ядра (и загрузчика потом) на Debian Testing надо установить стандартный набор из GCC, GNU Make и заголовочных файлов GNU C Library для целевой архитектуры (у меня armhf ), а также заголовки OpenSSL, консольный калькулятор bc , bison и flex : apt install crossbuild-essential-armhf bison flex libssl-dev bc . Так как загрузчик по умолчанию ищет файл zImage на файловой системе загрузочного раздела, пора разбивать флешку.

  1. Клонировать ядро слишком долго, поэтому просто скачаю: wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.9.1.tar.xz . Распакуем и перейдём в директорию с исходниками: tar -xf linux-5.9.1.tar.xz && cd linux-5.9.1
  2. Конфигурируем перед компиляцией: make ARCH=arm KBUILD_DEFCONFIG=imx_v6_v7_defconfig defconfig . Конфиг находится в директории arch/arm/configs/ . Если такового нет, вы можете попробовать найти и скачать готовый и передать название файла в этой директории в параметр KBUILD_DEFCONFIG . В крайнем случае сразу переходите к следующему пункту.
  3. Опционально можно докрутить настройки: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
  4. И кроскомпилируем образ: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
  5. Теперь можно скопировать файлик с ядром: cp arch/arm/boot/zImage /mnt/boot/
  6. И файлы с DeviceTree (описание имеющегося на плате железа): cp arch/arm/boot/dts/*.dtb /mnt/boot/
  7. И доустановить собранные в виде отдельных файлов модули: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=/mnt/ modules_install

Ядро готово. Можно всё отмонтировать: umount /mnt/boot/ /mnt/

Das U-Boot

Так как загрузчик интерактивный, для проверки его работы достаточно самой платы, запоминающего устройства и опционально устройства USB-to-UART. То есть, можно ядро и ОС отложить на потом.

Абсолютное большинство производителей предлагают использовать Das U-Boot для первичной загрузки. Полноценная поддержка обычно обеспечивается в собственном форке, но и в апстрим контрибьютить не забывают. В моём случае плата поддерживается в мейнлайне, поэтому форк я проигнорировал.

Cобираем сам загрузчик:

  1. Клонируем стабильную ветку репозитория: git clone https://gitlab.denx.de/u-boot/u-boot.git -b v2020.10
  2. Переходим в саму директорию: cd u-boot
  3. Готовим конфигурацию сборки: make mx6ull_14x14_evk_defconfig . Это работает только если конфигурация есть в самом Das U-Boot, в ином случае вам потребуется найти конфиг производителя и положить его в корень репозитория в файл .config , или собрать иным рекомендованным производителем образом.
  4. Собираем сам образ загрузчика кросс-компилятором armhf : make CROSS_COMPILE=arm-linux-gnueabihf- u-boot.imx

В результате мы получаем файл u-boot.imx , это готовый образ, который можно записывать на флешку. Записываем на SD-карту, пропустив первые 1024 байта. Почему я выбрал таргет u-boot.imx ? Почему пропустил именно 1024 байта? Так предлагают сделать в документации. Для других плат процесс сборки образа и записи может немного отличаться.

Готово, можно загрузиться. Загрузчик должен сообщить собственную версию, некоторую информацию о плате и попытаться найти образ ядра на разделе. В случае неудачи будет пытаться загрузиться по сети. В целом вывод довольно подробный, можно найти ошибку в случае проблемы.

Вместо заключения

А вы знали, что лоб у дельфина не костистый? Это буквально третий глаз, жировая линза для эхолокации!

Источник

Build arm linux gnueabihf

GCC Version: 10.3.0
Build: MacBook Air with m1
Host: arm64-apple-darwin20.4.0
Target: ARMv7/Cortex-A15(hardware float)
Language: c/c++

Using built-in specs. COLLECT_GCC=/opt/arm-mac-linux-gnueabihf/bin/arm-mac-linux-gnueabihf-gcc COLLECT_LTO_WRAPPER=/opt/arm-mac-linux-gnueabihf/bin/../libexec/gcc/arm-mac-linux-gnueabihf/10.3.0/lto-wrapper Target: arm-mac-linux-gnueabihf Configured with: /Volumes/Develop/.build/arm-mac-linux-gnueabihf/src/gcc/configure —build=aarch64-build_apple-darwin20.4.0 —host=aarch64-build_apple-darwin20.4.0 —target=arm-mac-linux-gnueabihf —prefix=/Volumes/Develop/x-tools/arm-mac-linux-gnueabihf —exec_prefix=/Volumes/Develop/x-tools/arm-mac-linux-gnueabihf —with-sysroot=/Volumes/Develop/x-tools/arm-mac-linux-gnueabihf/arm-mac-linux-gnueabihf/sysroot —enable-languages=c,c++ —with-cpu=cortex-a9 —with-fpu=neon-vfpv4 —with-float=hard —with-pkgversion=’crosstool-NG 1.24.0.349_6d00833′ —enable-__cxa_atexit —disable-libmudflap —disable-libgomp —disable-libssp —disable-libquadmath —disable-libquadmath-support —disable-libsanitizer —disable-libmpx —with-gmp=/Volumes/Develop/.build/arm-mac-linux-gnueabihf/buildtools —with-mpfr=/Volumes/Develop/.build/arm-mac-linux-gnueabihf/buildtools —with-mpc=/Volumes/Develop/.build/arm-mac-linux-gnueabihf/buildtools —with-isl=/Volumes/Develop/.build/arm-mac-linux-gnueabihf/buildtools —enable-lto —enable-threads=posix —enable-target-optspace —enable-plugin —enable-gold —disable-nls —disable-multilib —with-local-prefix=/Volumes/Develop/x-tools/arm-mac-linux-gnueabihf/arm-mac-linux-gnueabihf/sysroot —enable-long-long Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.3.0 (crosstool-NG 1.24.0.349_6d00833)

Источник

GNU-A Downloads

October 19-21, 2021

Learn to write fast and run fast on Arm

Downloads

The GNU Toolchain for the Cortex-A Family is a ready-to-use, open source suite of tools for C, C++ and Assembly programming. This toolchain targets processors from the Arm Cortex-A family and implements the Arm A-profile architecture.

Читайте также:  Системные требования для дистрибутивов linux

The toolchain includes the GNU Compiler (GCC) and is available free of charge directly for Windows and Linux operating systems. Follow the links on this page to download the correct version for your development environment.

See the downloaded package Release Notes, which are linked from this page, for full installation instructions.

GNU Toolchain for the A-profile Architecture

Version 10.3-2021.07

Released: July 29, 2021

What’s new in 10.3-2021.07

We are pleased to announce the Arm release of the pre-built GNU cross-toolchain for the A-profile cores: GCC 10.3-2021.07.

This is the same toolchain that was previously distributed by Linaro.

For more information about the GNU Arm toolchain and download the release packages, please go to the Arm Developer website.

In this release

Windows (mingw-w64-i686) hosted cross compilers

AArch32 bare-metal target (arm-none-eabi)

AArch32 target with hard float (arm-none-linux-gnueabihf)

AArch64 bare-metal target (aarch64-none-elf)

AArch64 GNU/Linux target (aarch64-none-linux-gnu)

x86_64 Linux hosted cross compilers

AArch32 bare-metal target (arm-none-eabi)

AArch32 target with hard float (arm-linux-none-gnueabihf)

AArch64 ELF bare-metal target (aarch64-none-elf)

AArch64 GNU/Linux target (aarch64-none-linux-gnu)

AArch64 GNU/Linux target (aarch64_be-none-linux-gnu)

AArch64 Linux hosted cross compilers

AArch32 bare-metal target (arm-none-eabi)

AArch32 target with hard float (arm-none-linux-gnueabihf)

AArch64 ELF bare-metal target (aarch64-none-elf)

Sources

Release Note for GNU Toolchain for the A-profile Architecture 10.3-2021.07

Description

GNU 10.3 cross-toolchain for the A-profile processors

Features

  • Based on GCC 10.3 (See https://gcc.gnu.org/gcc-10/changes.html for details).
  • Supported targets on Windows(x86_64): AArch64 (bare-metal and Linux), AArch32 (bare-metal, Linux hard-float)
  • Supported targets on Linux(x86_64): AArch64 (bare-metal, Linux, Linux big-endian), AArch32 (bare-metal, Linux hard-float)
  • Supported targets on Linux(AArch64): AArch64 (bare-metal), AArch32 (bare-metal, Linux hard-float)

Changes since Arm release GCC 10.2-2020.11

  • Bumped binutils to version 2.36.1.
  • Bumped glibc to version 2.33.
  • Bumped newlib to a version from May 2021.

The toolchain executables for Windows host are signed with SHA2.

Fixed issue https://sourceware.org/bugzilla/show_bug.cgi?id=25235 where forward-referencing ADR instructions were generating wrong offsets in Thumb code.

Fixed issue https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95253 where the toolchain on Windows host generated incorrect paths in the output dependency file.

Fixed issue https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97236 where wrong code might be generated for Aarch64 targets when using -O3 optimization.

Fixed an issue where files opened in binary mode on AArch64 might be incorrectly handled.

Content

This release includes the following items:

Sources provided in release source tar ball.

GDB-with-python support for Python 2.7.6 (x86_64 builds).

GDB-with-python support for Python 2.7.13 (mingw-w64-i686 builds).

libgmp 4.3.2
libisl 0.15
libmpfr 3.1.6
libmpc 1.0.3
libiconv 1.15

Sources provided in release source tar ball.

Known dependencies

GDB’s Python support requires Python compiled with UCS-4 support (built with —enable-unicode=ucs4) for Linux (x86_64) and Windows hosts

GDB’s Python support requires Python DLL dependencies for Windows host.

Toolchains dedicated for Windows host require mingw-w64 library, a complete runtime environment for GCC.

The following executables in the Windows hosted toolchains:

have additional dependencies on the following dlls:

  • libwinpthread-1.dll
  • libgcc_s_sjlj-1.dll
  • libstdc++-6.dll
  • libgcc_s_dw2-1.dll

You can obtain the required dlls from the MinGW-W64 GCC-8.1.0 packages from SourceForge:

The GNU Toolchains

The package names of the released GNU toolchain binaries have the following naming convention:

Toolchain Package Name Host OS Target Description
gcc-arm-10.3-2021.07-aarch64-aarch64-none-elf.tar.xz AArch64 Linux AArch64 ELF bare-metal target.
gcc-arm-10.3-2021.07-aarch64 -arm-none-eabi.tar.xz AArch64 Linux AArch32 bare-metal target.
gcc-arm-10.3-2021.07-aarch64 -arm-none-linux-gnueabihf.tar.xz AArch64 Linux AArch32 GNU/Linux target with hard float.
gcc-arm-10.3-2021.07- mingw-w64-i686-arm-none-eabi.tar.xz Windows AArch32 bare-metal target.
gcc-arm-10.3-2021.07- mingw-w64-i686-aarch64-none-elf.tar.xz Windows AArch64 ELF bare-metal target.
gcc-arm-10.3-2021.07- mingw-w64-i686- arm-none-linux-gnueabihf.tar.xz Windows AArch32 GNU/Linux target with hard float.
gcc-arm-10.3-2021.07-mingw-w64-i686-aarch64-none-linux-gnu.tar.xz Windows AArch64 GNU/Linux target.
gcc-arm-10.3-2021.07- x86_64-aarch64-none-elf.tar.xz x86_64 Linux AArch64 ELF bare-metal target.
gcc-arm-10.3-2021.07- x86_64-aarch64-none-linux-gnu.tar.xz x86_64 Linux AArch64 GNU/Linux target.
gcc-arm-10.3-2021.07- x86_64-aarch64_be-none-linux-gnu.tar.xz x86_64 Linux AArch64 GNU/Linux big-endian target.
gcc-arm-10.3-2021.07- x86_64-arm-none-eabi.tar.xz x86_64 Linux AArch32 bare-metal target.
gcc-arm-10.3-2021.07- x86_64-arm-none-linux-gnueabihf.tar.xz x86_64 Linux AArch32 GNU/Linux target with hard float.

These toolchains are built on and for Ubuntu 18.04 on AArch64, and will likely also be useable on OS versions:

— later than Ubuntu 18.04

Linux on 64-bit x86 (x86_64)

These toolchains are built on and for RHEL7 on x86_64, and will likely also be useable on OS versions:

— Ubuntu 14.04 or later

Released files

Description Requirement Host OS identifier in the toolchain package name
Linux on 64-bit Arm (AArch64) aarch64
Windows on 64-bit x86 (x86_64) Windows 10 mingw-w64-i686
gcc-arm-*.tar.xz Toolchain binaries
gcc-arm-src-snapshot-*.tar.xz Toolchain sources
gcc-arm-src-snapshot-*-manifest.txt Text manifest file with list of remote repositories for toolchain
gcc-arm-*-abe-manifest.txt Input files for Linaro ABE build system.
*.asc MD5 checksum files for sources and binaries

Installation instructions

Extract XZ compressed release archive using TAR archiving utility:

Compute and check MD5 checksum of XZ compressed release archives using md5sum utility:

The prebuilt binary bundles can be un-tarred and executed in place. Unpack the Linux cross toolchain:

Known issues

When you decompress the windows packages, the decompression requests permission to overwrite certain files. This is because the files have similar names with different case, which are treated as identical names on a Windows host. You can choose to overwrite the files with identical names.

When using the toolchains dedicated for the Windows host, if you invoke the compiler from the installed toolchain’s bin directory and you use the -flto option without using the -c option, then the linker generates this error message:
error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
To avoid this error message, you must invoke the compiler from any directory other than the installed toolchain’s bin directory.

Ask questions

Report bugs

What’s new in 10.2-2020.11

We are pleased to announce the Arm release of the pre-built GNU cross-toolchain for the A-profile cores: GCC 10.2-2020.11.

This is the same toolchain that was previously distributed by Linaro.

For more information about the GNU Arm toolchain and download the release packages, please go to the Arm Developer website.

In this release

Windows (mingw-w64-i686) hosted cross compilers

AArch32 bare-metal target (arm-none-eabi)

AArch32 target with hard float (arm-none-linux-gnueabihf)

AArch64 bare-metal target (aarch64-none-elf)

AArch64 GNU/Linux target (aarch64-none-linux-gnu)

x86_64 Linux hosted cross compilers

AArch32 bare-metal target (arm-none-eabi)

AArch32 target with hard float (arm-linux-none-gnueabihf)

AArch64 ELF bare-metal target (aarch64-none-elf)

AArch64 GNU/Linux target (aarch64-none-linux-gnu)

AArch64 GNU/Linux target (aarch64_be-none-linux-gnu)

AArch64 Linux hosted cross compilers

AArch32 bare-metal target (arm-none-eabi)

AArch32 target with hard float (arm-none-linux-gnueabihf)

AArch64 ELF bare-metal target (aarch64-none-elf)

Sources

Linaro ABE example manifest files for x86_64 hosted cross compilers

Release Note for GNU Toolchain for the A-profile Architecture 10.2-2020.11

Description

GNU 10.2 cross-toolchain for the A-profile processors

Features

  • Based on GCC 10.2 (See https://gcc.gnu.org/gcc-10/changes.html for details).
  • Supported targets on Windows(x86_64): AArch64 (bare-metal and Linux), AArch32 (bare-metal, Linux hard-float).
  • Supported targets on Linux(x86_64): AArch64 (bare-metal, Linux, Linux big-endian), AArch32 (bare-metal, Linux hard-float).
  • Supported targets on Linux(AArch64): AArch64 (bare-metal), AArch32 (bare-metal, Linux hard-float).

Changes since Arm release GCC 9.2-2019.12

  • Added support for Arm Neoverse V1.
  • Fixed issue where the compiler was generating a conditional branch in Thumb2, which was too far for b to handle.
  • Fixed issue where assembling code containing the UDF instruction results in «unknown mnemonic error» when targeting the AArch64 platform.
  • Fixed issue https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96191, where the -fstack-protector option was leaving the canary value in a temporary register on return from the function.

Content

This release includes the following items:

GCC 10.2.1 Repository: git://gcc.gnu.org/git/gcc.git
Revision: 3b91aab15443ee150b2ba314a4b26645ce8d713b
Release note
Sources provided in release source tar ball.
glibc 2.31 Repository: git://sourceware.org/git/glibc.git
Revision: 8dc76056654f8013a54678461fb023e988a17256
Release note
binutils 2.35.1 Repository: git://sourceware.org/git/binutils-gdb.git
Revision: d9a444bca66bf4b0d328acb547ca114081f3fd87
Release note
GDB 10.1 Repository: git://sourceware.org/git/binutils-gdb.git
Revision: f3fb4a77f29a99ffa2e1460dfa652081cdbd38be
GDB-with-python support for Python 2.7.6 (x86_64 builds).
GDB-with-python support for Python 2.7.13 (mingw-w64-i686 builds).
Release note
libexpat 2.2.5 Repository: https://github.com/libexpat/libexpat.git
Revision:
Release note
Linux Kernel Repository: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Revision: v4.20.13
Release Note
libgmp 4.3.2
libisl 0.15
libmpfr 3.1.6
libmpc 1.0.3
libiconv 1.15
Sources provided in release source tar ball.

Known dependencies

  • GDB’s Python support requires Python compiled with UCS-4 support (built with —enable-unicode=ucs4) for Linux (x86_64) and Windows hosts.
  • GDB’s Python support requires Python DLL dependencies for Windows host.
  • Toolchains dedicated for Windows host require mingw-w64 library, a complete runtime environment for GCC.
  • The following executables in the Windows hosted toolchains:
    — aarch64-none-linux-gnu-dwp.exe
    — aarch64-none-linux-gnu-ld.gold.exe
    — arm-none-linux-gnueabihf-dwp
    — arm-none-linux-gnueabihf-ld.gold.exe
    have additional dependencies on the following dlls:
    — libwinpthread-1.dll
    — libgcc_s_sjlj-1.dll
    — libstdc++-6.dll
    — libgcc_s_dw2-1.dll
    You can obtain the required dlls from the MinGW-W64 GCC-8.1.0 packages from SourceForge:
    — i686-posix-sjlj
    — i686-posix-dwarf

The GNU Toolchains

The package names of the released GNU toolchain binaries have the following naming convention:

Toolchain Package Name Host OS Target Description
gcc-arm-10.2-2020.11-aarch64-aarch64-none-elf.tar.xz AArch64 Linux AArch64 ELF bare-metal target.
gcc-arm-10.2-2020.11-aarch64-arm-none-eabi.tar.xz AArch64 Linux AArch32 bare-metal target.
gcc-arm-10.2-2020.11-aarch64-arm-none-linux-gnueabihf.tar.xz AArch64 Linux AArch32 target with hard float.
gcc-arm-10.2-2020.11-mingw-w64-i686-arm-none-eabi.tar.xz Windows AArch32 bare-metal target.
gcc-arm-10.2-2020.11-mingw-w64-i686-aarch64-none-elf.tar.xz Windows AArch64 ELF bare-metal target.
gcc-arm-10.2-2020.11-mingw-w64-i686-arm-none-linux-gnueabihf.tar.xz Windows AArch32 target with hard float.
gcc-arm-10.2-2020.11-mingw-w64-i686-aarch64-none-linux-gnu.tar.xz Windows AArch64 GNU/Linux target.
gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz x86_64 Linux AArch64 ELF bare-metal target.
gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu.tar.xz x86_64 Linux AArch64 GNU/Linux target.
gcc-arm-10.2-2020.11-x86_64-aarch64_be-none-linux-gnu.tar.xz x86_64 Linux AArch64 GNU/Linux big-endian target.
gcc-arm-10.2-2020.11-x86_64-arm-none-eabi.tar.xz x86_64 Linux AArch32 bare-metal target.
gcc-arm-10.2-2020.11-x86_64-arm-none-linux-gnueabihf.tar.xz x86_64 Linux AArch32 target with hard float.

Host requirements

Description Requirement Host OS identifier in the toolchain package name
Linux on 64-bit Arm (AArch64) Ubuntu 18.04 LTS or later RHEL 8 or later

aarch64 Windows on 64-bit x86 (x86_64) Windows 10 mingw-w64-i686 Linux on 64-bit x86 (x86_64) Ubuntu 16.04 LTS or later RHEL 7 or later x86_64

Released files

gcc-arm-*.tar.xz Toolchain binaries
gcc-arm-src-snapshot-*.tar.xz Toolchain sources
gcc-arm-src-snapshot-*-manifest.txt Text manifest file with list of remote repositories for toolchain
gcc-arm-*-abe-manifest.txt Input files for Linaro ABE build system.
*.asc MD5 checksum files for sources and binaries

Installation instructions

Extract XZ compressed release archive using TAR archiving utility:

Example for Linux(x86_64) hosted for AArch64 Linux target

Compute and check MD5 checksum of XZ compressed release archives using md5sum utility:

The prebuilt binary bundles can be un-tarred and executed in place. Unpack the Linux cross toolchain:

How to build the toolchain from sources

You can build GNU cross-toolchain for the A-profile from sources using Linaro ABE (Advanced Build Environment) and provided ABE manifest files.

Below example shows how to build gcc-arm-aarch64-linux-gnu toolchain from sources using Linaro ABE build system.

Instructions

ABE has a dependency on git-new-workdir and needs this tool to be installed in /usr/local/bin directory:

Clone ABE from the URL below and checkout the stable branch (see Getting ABE):

Create the build directory and change to it. Any name for the directory will work:

Configure ABE (from the build directory):

Download the toolchain manifest file from the GNU Arm toolchain page on developer.arm.com, for example: gcc-arm-aarch64-none-elf-abe-manifest.txt.

Build toolchain (from the build directory):

The built toolchain will be installed and available for use in the builds/destdir/x86_64-unknown-linux-gnu/bin/ directory.

Known issues

  • When you decompress the windows packages, the decompression requests permission to overwrite certain files. This is because the files have similar names with different case, which are treated as identical names on a Windows host. You can choose to overwrite the files with identical names.
  • When using the toolchains dedicated for the Windows host, if you invoke the compiler from the installed toolchain’s bin directory and you use the -flto option without using the -c option, then the linker generates this error message: To avoid this error message, you must invoke the compiler from any directory other than the installed toolchain’s bin directory.

Ask questions

For any questions, please use the Arm Communities forums.

Report bugs

Please report any bugs via the Linaro Bugzilla.

Источник

Читайте также:  Tiny core linux packages
Оцените статью