0
点赞
收藏
分享

微信扫一扫

ubuntu 卸载 软件包 libfdt-dev


编译环境

  • Win10 64位
  • ubuntu 20.04
  • 虚拟机 VMware® Workstation 16 Pro
  • NUC980 bsp 自带的编译工具链: nuc980bsp.tar.gz,版本 gcc version 4.8.4 (GCC)
  • NUC980 uboot : https://gitee.com/OpenNuvoton/NUC970_U-Boot_v2016.11

目标

  • 手动编译 NUC980 的 uboot 源码

问题描述

  • 最近在搭建 新唐NUC980 uboot 编译环境的时候,编译失败,编译错误信息如下

In file included from tools/../include/libfdt.h:54,
                 from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
/usr/include/libfdt_env.h:27:30: error: conflicting types for ‘fdt64_t’
   27 | typedef uint64_t FDT_BITWISE fdt64_t;
      |                              ^~~~~~~
In file included from <command-line>:
././include/libfdt_env.h:19:16: note: previous declaration of ‘fdt64_t’ was here
   19 | typedef __be64 fdt64_t;
      |                ^~~~~~~
In file included from ././include/libfdt_env.h:12,
                 from <command-line>:
/usr/include/libfdt_env.h:47:24: error: expected ‘)’ before ‘x’
   47 | static inline uint32_t fdt32_to_cpu(fdt32_t x)
      |                        ^~~~~~~~~~~~
././include/compiler.h:68:9: error: expected ‘)’ before ‘&’ token
   68 |  ((((x) & 0xff000000) >> 24) | \
      |         ^
././include/compiler.h:68:23: error: expected ‘)’ before ‘>>’ token
   68 |  ((((x) & 0xff000000) >> 24) | \
      |                       ^~
././include/compiler.h:68:30: error: expected ‘)’ before ‘|’ token
   68 |  ((((x) & 0xff000000) >> 24) | \
      |                              ^
/usr/include/libfdt_env.h:51:23: error: expected ‘)’ before ‘x’
   51 | static inline fdt32_t cpu_to_fdt32(uint32_t x)
      |                       ^~~~~~~~~~~~
././include/compiler.h:68:9: error: expected ‘)’ before ‘&’ token
   68 |  ((((x) & 0xff000000) >> 24) | \
      |         ^
././include/compiler.h:68:23: error: expected ‘)’ before ‘>>’ token
   68 |  ((((x) & 0xff000000) >> 24) | \
      |                       ^~
././include/compiler.h:68:30: error: expected ‘)’ before ‘|’ token
   68 |  ((((x) & 0xff000000) >> 24) | \
      |                              ^
/usr/include/libfdt_env.h:56:24: error: expected ‘)’ before ‘x’
   56 | static inline uint64_t fdt64_to_cpu(fdt64_t x)
      |                        ^~~~~~~~~~~~
././include/compiler.h:73:9: error: expected ‘)’ before ‘&’ token
   73 |  ((((x) & 0xff00000000000000##sfx) >> 56) | \

... ...

  • 应该是与 ubuntu 上的 libfdt 相关的定义冲突了,/usr/include/libfdt_env.h:27:30: error: conflicting types for ‘fdt64_t’
  • 那这个 /usr/include/libfdt_env.h 应该是后来安装其他的软件包时安装的,所以打算先卸载掉 libfdt

ubuntu 卸载 软件包 libfdt-dev_工具链

卸载 ubuntu 中的 libfdt 软件包

  • ubuntu 环境一般用于 交叉编译工具链,所以 ubuntu 本身不需要 libfdt,可能是安装 dtc 这样的工具引入的。
  • 可以使用 ubuntu 上 apt 或者 aptitude 卸载软件包,我这里使用 aptitude
  • 卸载命令 $ sudo aptitude remove libfdt-dev
  • 卸载后,再次编译,发现编译通过了

ubuntu 卸载 软件包 libfdt-dev_编译环境_02

  • 我再尝试重新安装 dtc 工具,这个工具可以手动 编译 Linux 设备树文件,更新完,发现没有默认安装libfdt-dev ,说明 卸载掉 libfdt-dev 不会带来什么问题(暂时没有发现做什么用)

ubuntu 卸载 软件包 libfdt-dev_编译环境_03

小结

  • 新唐NUC980 属于 ARM9 系列,跟 三星 2440 属于同一个级别的,所以 uboot 与 Linux 编译工具链使用的比较老版本的 32 位的工具链 gcc version 4.8.4 ,使用最新的工具链,可能无法正常编译通过。

ubuntu 卸载 软件包 libfdt-dev_编译环境_04


举报

相关推荐

0 条评论