linux - 无法使用 hikey_defconfig 编译 u-boot

标签 linux gcc assembly cross-compiling u-boot

我刚从github上克隆了u-boot

https://github.com/u-boot/u-boot.git

并尝试使用随机选择的 defconfig(特别是 hikey_defconfig)构建它。

export ARCH=arm
export CROSS_COMPILE=/opt/linaro-7.2.1-2017.11/bin/arm-linux-gnueabi-
make hikey_defconfig
make all

一段时间后,这给了我以下错误:

{standard input}: Assembler messages:
{standard input}:36: Error: unexpected character `n' in type specifier
{standard input}:36: Error: bad instruction `b.ne 1b'
scripts/Makefile.build:280: recipe for target 'arch/arm/cpu/armv8/cpu.o' failed
make[1]: *** [arch/arm/cpu/armv8/cpu.o] Error 1
Makefile:1320: recipe for target 'arch/arm/cpu/armv8' failed
make: *** [arch/arm/cpu/armv8] Error 2

看起来像是一个汇编错误。我做错了什么?

最佳答案

Hikey 96Boards 使用 Kirin 920/Kirin 960 SoC:两者都实现了 ARMv8-A 64 位架构(Cortex-A73+Cortex-A53)或 Cortex-A53 - 参见 herehere

因此,您应该使用 Linaro aarch64-linux-gnu 或 aarch64-elf 工具链,而不是您使用的 32 位工具链。

一个工作命令将是:

make CROSS_COMPILE=/opt/linaro/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-elf/bin/aarch64-elf- mrproper hikey_defconfig all

您可以通过在以下行查看 configs/hikey_defconfig 中引用的 DTS 文件来检查必须编译的架构:

CONFIG_DEFAULT_DEVICE_TREE="hi6220-hikey"

arch/arm/dts/hi6220-hikey.dts 确实包含 arch/arm/dts/hi6220.dtsi,其中包含说明 Hikey Soc 中包含的内核与哪个架构兼容的语句:
   cpu0: cpu@0 {
        compatible = "arm,cortex-a53", "arm,armv8";
        device_type = "cpu";
        reg = <0x0 0x0>;
        enable-method = "psci";
    };

    cpu1: cpu@1 {
        compatible = "arm,cortex-a53", "arm,armv8";
        device_type = "cpu";
        reg = <0x0 0x1>;
        enable-method = "psci";
    };

    cpu2: cpu@2 {
        compatible = "arm,cortex-a53", "arm,armv8";
        device_type = "cpu";
        reg = <0x0 0x2>;
        enable-method = "psci";
    };

    cpu3: cpu@3 {
        compatible = "arm,cortex-a53", "arm,armv8";
        device_type = "cpu";
        reg = <0x0 0x3>;
        enable-method = "psci";
    };

    cpu4: cpu@100 {
        compatible = "arm,cortex-a53", "arm,armv8";
        device_type = "cpu";
        reg = <0x0 0x100>;
        enable-method = "psci";
    };

    cpu5: cpu@101 {
        compatible = "arm,cortex-a53", "arm,armv8";
        device_type = "cpu";
        reg = <0x0 0x101>;
        enable-method = "psci";
    };

    cpu6: cpu@102 {
        compatible = "arm,cortex-a53", "arm,armv8";
        device_type = "cpu";
        reg = <0x0 0x102>;
        enable-method = "psci";
    };

    cpu7: cpu@103 {
        compatible = "arm,cortex-a53", "arm,armv8";
        device_type = "cpu";
        reg = <0x0 0x103>;
        enable-method = "psci";
    };

在您选择用于为 Hikey 板编译 u-boot 的 Linaro 工具链时,这可能会指导您。

关于linux - 无法使用 hikey_defconfig 编译 u-boot,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48994690/

相关文章:

gcc - 函数序言中的 sub esp、eax 的作用是什么?

c - 将 C 程序输出保存到文本文件

php - 从 php 文件执行 Powershell 脚本

c++ - 在 Windows 上运行 Linux Makefile(.so 文件)

C 堆栈帧跟踪

c++ - 紧凑型 AVX2 寄存器,因此所选整数根据掩码是连续的

linux - syslog-ng 是否支持消息中的换行控制字符?

gcc - 将Intel风格的汇编代码重写为GCC内联汇编

c - _beginthreadex() 返回有效句柄,并在使用 Codeblocks/Mingw 和 GNU GCC 编译器执行线程时崩溃

linux - (宏语言处理器 m4)如何运行 resp。在 Ubuntu 13.4 上编译 .m4 程序?