【问题标题】:u-boot cross compile, fatal error: stdint.hu-boot 交叉编译,致命错误:stdint.h
【发布时间】:2015-08-14 05:16:11
【问题描述】:

这里有一个奇怪的错误,试图在 Linux Mint 上交叉编译 ARM。我用过:

make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_config
make ARCH=arm CROSS_COMPILE=${CC}


    make[1]: Leaving directory `/root/bbb/u-boot/arch/arm/cpu/armv7'
    make[1]: Entering directory `/root/bbb/u-boot/board/ti/am335x'
    make[1]: Nothing to be done for `_depend'.
    make[1]: Leaving directory `/root/bbb/u-boot/board/ti/am335x'
    make -C tools all
    make[1]: Entering directory `/root/bbb/u-boot/tools'
    gcc -g -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -include /root/bbb/u-boot/include/libfdt_env.h -idirafter /root/bbb/u-boot/include -idirafter /root/bbb/u-boot/include2 -idirafter /root/bbb/u-boot/include -I /root/bbb/u-boot/lib/libfdt -I /root/bbb/u-boot/tools -DCONFIG_SYS_TEXT_BASE=0x80800000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -D_GNU_SOURCE -pedantic -c -o crc32.o /root/bbb/u-boot/lib/crc32.c
    In file included from /root/bbb/u-boot/include/compiler.h:19:0,
                     from /root/bbb/u-boot/include/libfdt_env.h:12,
                     from <command-line>:0:
    /usr/lib/gcc/i686-linux-gnu/4.8/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
     # include_next <stdint.h>
                              ^
    compilation terminated.

我也导出了 ARCH 和 CROSS_COMPILE,但上周我在其他机器上编译 u_boot 时没有问题似乎是交叉编译器问题,但在某些位置它是相同的 Linaro un-tar-ed。

有什么想法吗?非常感谢。

【问题讨论】:

  • 您导出 CC 了吗?您的命令有 CROSS_COMPILE=${CC},这将踩到以前的 CROSS_COMPILE 导出。
  • 尝试打印CC看看。看到那行/usr/lib/gcc/i686-linux-gnu/4.8/include/stdint.h:9:26,我认为您没有使用正确的编译器...?另外,我建议您编辑 .bashrc 文件(位于 ~/),这样您就不需要每次编译时都重新定义 CROSS_COMPILE 变量。

标签: u-boot


【解决方案1】:

为什么你的 u-boot 源代码树在 /root/ ?执行make 时是否以root 身份登录? 您确定要以 root 身份编译 u-boot 吗?因为你不需要。

当我试图了解这里出了什么问题时,我在http://eewiki.net/display/linuxonarm/BeagleBone#BeagleBone-ARMCrossCompiler:GCC 认出了一些行 我希望您理解您执行的每一行,因为您需要一个接一个地执行它们才能使编译工作。 关于wiki,试试这种方式:

export CROSS_COMPILE=/path/to/the/directory/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-

那么你就可以了:

make ARCH=arm distclean
make ARCH=arm am335x_evm_config
make ARCH=arm 

请注意,每次打开新控制台时都必须导出 CROSS_COMPILE 变量。

希望对你有所帮助。

【讨论】:

    【解决方案2】:

    尝试安装所有依赖项的 libc6-dev。它为我解决了这个问题。

    $ sudo apt-get install libc6-dev
    

    【讨论】:

      【解决方案3】:

      sudo apt-get install libnewlib-arm-none-eabi

      【讨论】:

        猜你喜欢
        • 2018-12-08
        • 1970-01-01
        • 1970-01-01
        • 2020-04-26
        • 1970-01-01
        • 2020-06-10
        • 1970-01-01
        • 2013-12-09
        • 1970-01-01
        相关资源
        最近更新 更多