Compilation 在x86上编译U-BOOT引导加载程序

Compilation 在x86上编译U-BOOT引导加载程序,compilation,embedded,cross-compiling,embedded-linux,u-boot,Compilation,Embedded,Cross Compiling,Embedded Linux,U Boot,我已经在Ubuntu Linux上下载并解压缩了u-boot-1.1.6。我只想使用GCC编译源代码(不针对任何嵌入式平台的交叉编译) 我尝试运行提供的MAKEALLmakefile,但出现了“powerpc-linux-gcc:notfound” 我的理解是不管源代码应该编译什么平台 在x86上编译需要做哪些必要的makefile和环境更改 我用了最近的密码。仍然面临一些问题 我按照以下步骤在x86上编译它 清洁 make coreboot-x86\u config /MAKEALL-C x8

我已经在Ubuntu Linux上下载并解压缩了u-boot-1.1.6。我只想使用GCC编译源代码(不针对任何嵌入式平台的交叉编译)

我尝试运行提供的
MAKEALL
makefile,但出现了“powerpc-linux-gcc:notfound”

我的理解是不管源代码应该编译什么平台

在x86上编译需要做哪些必要的makefile和环境更改

我用了最近的密码。仍然面临一些问题

我按照以下步骤在x86上编译它

  • 清洁
  • make coreboot-x86\u config
  • /MAKEALL-C x86
  • 在步骤3中,我观察到以下情况:

    ravitiwari@RAVI-HP-Pavilion-dv2000-GJ175PA-ACJ:~/u-boot-2013.04$ make clean
    ravitiwari@RAVI-HP-Pavilion-dv2000-GJ175PA-ACJ:~/u-boot-2013.04$ make coreboot-x86_config
    Configuring for coreboot-x86 - Board: coreboot, Options: SYS_TEXT_BASE=0x01110000
    ravitiwari@RAVI-HP-Pavilion-dv2000-GJ175PA-ACJ:~/u-boot-2013.04$ ./MAKEALL -C x86
    Configuring for coreboot-x86 - Board: coreboot, Options: SYS_TEXT_BASE=0x01110000
        make[1]: ** [interrupts.o] Error 127
        make: ** [arch/x86/cpu/libx86.o] Error 2
        make[1]: ** [coreboot.o] Error 127
        make: ** [arch/x86/cpu/coreboot/libcoreboot.o] Error 2
        make[1]: ** [bootm.o] Error 127
        make: ** [arch/x86/lib/libx86.o] Error 2
        size: './u-boot': No such file
        /bin/bash: sparse: command not found
        make[1]: ** [interrupts.o] Error 127
        make: ** [arch/x86/cpu/libx86.o] Error 2
        make: ** Waiting for unfinished jobs....
        /bin/bash: sparse: command not found
        make[1]: ** [coreboot.o] Error 127
        make: ** [arch/x86/cpu/coreboot/libcoreboot.o] Error 2
        /bin/bash: sparse: command not found
        make[1]: ** [bootm.o] Error 127
        make: ** [arch/x86/lib/libx86.o] Error 2
        make: INTERNAL: Exiting with 4 jobserver tokens available; should be 3!
    
        --------------------- SUMMARY ----------------------------
    
        Boards compiled: 1
        Boards with errors: 1( coreboot-x86 )
    

    打扫卫生;使coreboot-x86_配置;制作 更有可能对你有用

    根据我的经验,u-boot是为一个特定的嵌入式平台构建的。即使您的主机是x86,这也是事实,因此您已经安装了/usr/bin/gcc

    您偶然发现的(我通过在顶层运行./MAKEALL看到)想要构建所有可用的嵌入式平台。但它仍将构建特定的平台,这是U-Boot任务所固有的。它默认使用powerpc工具链(powerpc linux gcc),而不是x86工具链。我的建议是选择一个特定的基于x86的平台,并构建它。您将在控制台上看到各种编译输出,显示发生了什么

    MAKEALL将首先为多个其他平台构建,然后丢弃构建结果。你可以 .MAKEALL-c x86
    但这隐藏了编译输出。对于其他CPU,您需要安装适当的交叉编译器。

    谢谢Joe,仍然面临一些问题:以下步骤:1)清理2)使coreboot-x86\u配置3)。/MAKEALL-C x86。在步骤1中,bfin elf gcc:未找到命令。在步骤2中make:bfin elf gcc:Command not found make:**No rule to make target`coreboot-x86_config'。在步骤3中,make:bfin-elf-gcc:Command未找到make:**\u-config:没有这样的文件或目录。停止系统未配置-请参阅自述文件制作:**[all]错误1我也尝试过使用其他include/configs,但由于我是引导加载程序新手,因此无法找出错误所在。请解释一下?看起来您可能已经设置了环境变量,以便与blackfin交叉编译。“printenv | grep CROSS_COMPILE”将表明这一点。如果是,请清除它。也可能有用,“哪个gcc”;IIRC我的linux提供了/usr/bin/gcc,x86 u-boot目标构建正常。我检查了环境变量,它没有设置为blackfin,并且“which gcc”的显示方式也与您的:/usr/bin/gcc相同。有两个环境变量需要注意1)ARCH 2)CROSS_COMPILE。1) 取消设置两个环境变量2)从路径环境变量中删除交叉编译工具链链接3)检查在.bashrc文件中导出的这些环境变量“PATH、ARCH和cross_compile”是否存在于主目录下,如果是这样,请评论这些行并尝试构建它。更重要的问题可能是,在没有特定目标的情况下编译这些行,您希望实现什么?