Ins*_*der 0 linux assembly gcc cross-compiling u-boot
我刚刚从 github 克隆了 u-boot
https://github.com/u-boot/u-boot.git
Run Code Online (Sandbox Code Playgroud)
并尝试使用随机选择的 defconfig(特别是hikyy_defconfig)来构建它。
export ARCH=arm
export CROSS_COMPILE=/opt/linaro-7.2.1-2017.11/bin/arm-linux-gnueabi-
make hikey_defconfig
make all
Run Code Online (Sandbox Code Playgroud)
一段时间后,这给了我以下错误:
{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
Run Code Online (Sandbox Code Playgroud)
看起来像一个汇编错误。我究竟做错了什么?
Hikey 96Boards 使用 Kirin 920/Kirin 960 SoC:两者都实现了 ARMv8-A 64 位架构(Cortex-A73+Cortex-A53)或 Cortex-A53 - 见这里和这里
因此,您应该使用 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
Run Code Online (Sandbox Code Playgroud)
您可以通过查看以下行中 configs/hikey_defconfig 中引用的 DTS 文件来检查您必须编译的体系结构:
CONFIG_DEFAULT_DEVICE_TREE="hi6220-hikey"
Run Code Online (Sandbox Code Playgroud)
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";
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1262 次 |
| 最近记录: |