如何在Debian上为armv8 cortex-a53安装aarch64工具链?

nat*_*ore 6 gcc arm toolchain

我想在ARM芯片上启动低级编程.我已经安装QEMU和遵循的hello world类型的东西几个示例程序,但现在我要定位的最新树莓派,它具有ARMv8 cortex-a53neon-fp-armv8FPU.我目前正在运行Debian:

$ lsb_release -a
    No LSB modules are available.
    Distributor ID: BunsenLabs
    Description:    BunsenLabs GNU/Linux 8.5 (Hydrogen)
    Release:    8.5
    Codename:   bunsen-hydrogen

$ cat /etc/debian_version
    8.5
Run Code Online (Sandbox Code Playgroud)

我目前安装了以下工具链:

binutils-arm-none-eabi
gcc-arm-none-eabi
gdb-arm-none-eabi
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试编译时-mcpu=cortex-a53,我收到以下错误:

arm-none-eabi-gcc: error: unrecognized argument in option '-mcpu=cortex-a53'

$ arm-none-eabi-gcc --version
    arm-none-eabi-gcc (4.8.4-1+11-1) 4.8.4 20141219 (release)
Run Code Online (Sandbox Code Playgroud)

我认为我有一个更老的GCC不含有该目标的CPU,所以我试图下载的binutils,GCC和gdb的源代码,但我无法建立的binutils.尝试时总是失败make all.

binutils配置:

$../../src/binutils-2.26.51/configure \
 --target=arm-none-eabi \
 --disable-nls
Run Code Online (Sandbox Code Playgroud)

构建错误:

$make -j4
    checking for bison... /home/nathan/development/tools/arm/src/binutils-2.26.51/missing bison -y
    checking for flex... /home/nathan/development/tools/arm/src/binutils-2.26.51/missing flex
    checking lex output file root... configure: error: cannot find output from /home/nathan/development/tools/arm/src/binutils-2.26.51/missing flex; giving up
    Makefile:3545: recipe for target 'configure-binutils' failed
    make[1]: *** [configure-binutils] Error 1
    no
    checking for bison... /home/nathan/development/tools/arm/src/binutils-2.26.51/missing bison -y
    checking for flex... /home/nathan/development/tools/arm/src/binutils-2.26.51/missing flex
    checking lex output file root... configure: error: cannot find output from /home/nathan/development/tools/arm/src/binutils-2.26.51/missing flex; giving up
    Makefile:4834: recipe for target 'configure-gas' failed
    make[1]: *** [configure-gas] Error 1
    make[1]: Leaving directory '/home/nathan/development/tools/arm/build/binutils-2.26.51'
    Makefile:844: recipe for target 'all' failed
    make: *** [all] Error 2
Run Code Online (Sandbox Code Playgroud)

为了获得一个工具链设置来编译aarch64 cortex-a53架构,我需要采取哪些正确的步骤?

编辑1

通过评论发现,我需要安装aarch64工具链,而不是arm工具链.还是一无所知.

Cir*_*四事件 8

从 Ubuntu 18.04 开始,您可以执行以下操作:

sudo apt-get install gcc-aarch64-linux-gnu
aarch64-linux-gnu-gcc -mcpu=cortex-a53 hello_world.c
Run Code Online (Sandbox Code Playgroud)

gcc-aarch64-linux-gnu是在版本4:7.3.0-3ubuntu2

但是,对于 Raspberry Pi,您应该只从https://github.com/raspberrypi/tools下载官方二进制文件,这是更可靠的方法,如:https : //raspberrypi.stackexchange.com/questions/ 64273/安装树莓派交叉编译器/83215#83215

最后,对于裸机,我找不到 的类似物arm-none-eabi-gcc,我想知道为什么:https : //github.com/cirosantilli/cirosantilli.github.io/issues/68