编译 buildroot 错误录

2024-08-24 08:12
文章标签 编译 错误 buildroot

本文主要是介绍编译 buildroot 错误录,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

编译 buildroot 错误录

为什么要记录编译过程的错误?

  1. 问题定位和诊断
    明确错误来源:编译错误记录提供了错误发生的位置和性质,使工程师能够迅速定位到问题的源头。日志通常会包含文件名、行号以及错误消息,帮助工程师确定出错的代码段。
    历史追踪:记录的错误信息可以帮助追踪错误的历史,从而识别是否是由于最近的代码修改引入的问题。
  2. 改进开发效率
    迅速修复:准确的错误记录可以减少调试时间,让开发人员更快地修复问题,而不必手动查找每个可能的错误点。
    减少重复错误:通过分析错误记录,开发人员可以识别出常见的错误模式,从而采取措施避免类似问题的再次出现。
  3. 代码质量提高
    代码审查:编译错误记录可以用作代码审查的依据,帮助团队识别和改正代码中的缺陷。
    学习和改进:记录的错误信息为工程师提供了学习的机会,尤其是新手工程师可以通过分析这些错误,了解常见问题及其解决方法,从而提升编程技能。
  4. 沟通和协作
    错误记录可以帮助其他人,有效的沟通。如果一个错误难以解决,别人可以将错误日志分享给需要寻求帮助的人。

作者:炭烤毛蛋 ,点击博主了解更多。


提示: 编译日志信息提示比较全面,要耐心仔细查看。

文章目录

  • 编译 buildroot 错误录
  • 1. 内核编译错 错误
    • 错误一
    • 错误二
  • builtroot 编译错误
    • 错误一
    • 错误二
    • 错误三
    • 错误四
    • 错误五
    • 错误六
  • Tips
  • 结语


1. 内核编译错 错误

错误一

scripts/kconfig/conf --syncconfig Kconfig
HOSTLD scripts/dtc/dtc
/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [scripts/Makefile.host:99: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:637: scripts/dtc] Error 2
make: *** [Makefile:1187: scripts] Error 2
ERROR: Running build_kernel failed!
ERROR: exit code 2 from line 501:
make ARCH=$RK_ARCH $RK_KERNEL_DTS.img -j$RK_JOBS

检查 gcc 编译版本。开发环境 22.04,gcc version 11.4.0 符合要求。

gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

根据提示 修改 scripts/dtc/dtc-lexer.lex.c 中错误位置进行屏蔽,或者增加外部变量引用。

-YYLTYPE yylloc;
+extern YYLTYPE yylloc;

错误二

config=/home/1126/buildroot/output/rv1126/.rockchipconfig Config.in
#
# configuration written to /home/1126/buildroot/output/rv1126/.config
#
make: Leaving directory '/home/1126/buildroot'
====Start build rv1126====
2022-07-17T17:13:30 >>> host-m4 1.4.18 Building
Done in 7s (error code: 2)
Command exited with non-zero status 2
you take 0:08.57 to build ramboot
ERROR: Running build_ramboot failed!
ERROR: exit code 2 from line 565:
/usr/bin/time -f "you take %E to build ramboot" $COMMON_DIR/mk-ramdisk.sh ramboot.img $RK_CFG_RAMBOOT

builtroot 编译错误

错误一

Done in 8s (error code: 2)
Failed to build rockchip_rv1126_evb_tb:
# 2022-07-17 11:31:242022-07-17T11:31:24 make: Entering directory '/home/rv1126/buildroot'
2022-07-17T11:31:31 /usr/bin/make -j1 O=/home/rv1126/buildroot/output/rockchip_rv1126_evb_tb HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" syncconfig
2022-07-17T11:31:31 make[1]: Entering directory '/home/rv1126/buildroot'
2022-07-17T11:31:31 GEN /home/rv1126/buildroot/output/rockchip_rv1126_evb_tb/Makefile
2022-07-17T11:31:32 make[1]: Leaving directory '/home/rv1126/buildroot'
2022-07-17T11:31:32
2022-07-17T11:31:32 Your PATH contains spaces, TABs, and/or newline (n) characters.
2022-07-17T11:31:32 This doesn't work. Fix you PATH.
2022-07-17T11:31:32 make: *** [support/dependencies/dependencies.mk:27: dependencies] Error 1
2022-07-17T11:31:32 make: Leaving directory '/home/rv1126/buildroot'
Please check details in /home/rv1126/output/log/2022-07-17_11-29-18/br-rockchip_rv1126_evb_tb_2022-07-17_11-31-24.log
Command exited with non-zero status 1
you take 0:17.37 to build buildroot
ERROR: Running /home/rv1126/device/rockchip/common/scripts/mk-rootfs.sh - build_buildroot failed!
ERROR: exit code 1 from line 13:
/usr/bin/time -f "you take %E to build buildroot" "$SCRIPTS_DIR/mk-buildroot.sh" $RK_BUILDROOT_CFG "$ROOTFS_DIR"

摘取关键错误信息如下:

2022-07-17T11:31:32 Your PATH contains spaces, TABs, and/or newline (n) characters. 
2022-07-17T11:31:32 This doesn't work. Fix you PATH. 
2022-07-17T11:31:32 make: *** [support/dependencies/dependencies.mk:27: dependencies] Error 1

our PATH contains spaces, TABs, and/or newline (n) characters. 错误提示表明你的操作系统中的环境变量 PATH 包含了空格、制表符或换行符等非法字符,这可能导致编译时出现问题。
错误原因: WSL默认引入 windows 环境参量
修改方法:重置 PATH 环境变量。

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
make

错误二

warning: Python 3 support is currently experimental. YMMV.
Please use Python 2.6 - 2.7 instead.
rv1126/.repo/repo/main.py:19: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
import imp
Traceback (most recent call last):
File "rv1126/.repo/repo/main.py", line 46, in <module>
from subcmds.version import Version
File "rv1126/.repo/repo/subcmds/__init__.py", line 33, in <module>
mod = __import__(__name__,

尝试将 repo 脚本解释器,修改 #!/usr/bin/env python#!/usr/bin/env python2,经过测试问题解决。

vi .repo/repo/repo
-#!/usr/bin/env python
-#!/usr/bin/env python2

错误三

2022-07-24T13:34:41 g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.

查阅相关信息后,认为是虚拟机内存不足造成。参照《Android 编译报错记录篇》增加服务器交换分区内存可以解决此问题。

错误四

2022-07-24T09:44:05 g++: fatal error: Killed signal terminated program cc1plus
2022-07-24T09:44:05 compilation terminated.
2022-07-24T09:44:05 make[1]: *** [Makefile:182: cmGeneratorTarget.o] Error 1
2022-07-24T09:44:05 make[1]: *** Waiting for unfinished jobs....
2022-07-24T09:44:09 make[1]: Leaving directory '/home/rv1126/buildroot/output/rockchip_rv1126_evb_tb/build/host-cmake-3.22.3/Bootstrap.cmk'

错误三 原因相同,日志体现略有不同。解决方法嘛,就不用细说咯。

错误五

ERROR: Running build_buildroot failed!
ERROR: exit code 1 from line 556:
/usr/bin/time -f "you take %E to build builroot" $COMMON_DIR/mk-buildroot.sh $BOARD_CONFIG

问题原因:buildroot 环境变量发生变迁,无法正常执行。
解决方案:清除当前编译缓存 ./build.sh cleanall,然后重新编译 ./build.sh

错误六

2022-07-24T15:28:07 >>> camera_engine_rkaiq 1.0 Building
Done in 10min 17s (error code: 2)
Command exited with non-zero status 2
you take 10:18.63 to build ramboot
ERROR: Running build_ramboot failed!
ERROR: exit code 2 from line 565:

查看 br.log 发现是文件缺失。

2022-07-24T15:28:07 ### conver iqfile: /home/1126/buildroot/output/rv1126/build/camera_engine_rkaiq-1.0/iqfiles/os04c10_DW-RV04C_2G2P650IR-F21.xml
2022-07-24T15:28:07 /bin/bash: /home/1126/buildroot/output/rv1126/host/bin/rkisp_parser: No such file or directory
2022-07-24T15:28:07 make[1]: *** [package/pkg-generic.mk:258: /home/1126/buildroot/output/rv1126/build/camera_engine_rkaiq-1.0/.stamp_built] Error 127
2022-07-24T15:28:07 make: *** [/home/1126/buildroot/output/rv1126/Makefile:16: _all] Error 2

日志提示 rkisp_parser 命令无法正常执行,手动验证确实存在问题。

/home/1126/buildroot/output/rv1126/host/bin/rkisp_parser
No such file or directory

解决方法:更替 rkisp_parser 为当前系统可执行文件。

Tips

编译错误日志内容很详细。

结语

不枉博主详细讲解,欢迎订阅博主–炭烤毛蛋 。

这篇关于编译 buildroot 错误录的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1101930

相关文章

深度解析Java @Serial 注解及常见错误案例

《深度解析Java@Serial注解及常见错误案例》Java14引入@Serial注解,用于编译时校验序列化成员,替代传统方式解决运行时错误,适用于Serializable类的方法/字段,需注意签... 目录Java @Serial 注解深度解析1. 注解本质2. 核心作用(1) 主要用途(2) 适用位置3

Debian 13升级后网络转发等功能异常怎么办? 并非错误而是管理机制变更

《Debian13升级后网络转发等功能异常怎么办?并非错误而是管理机制变更》很多朋友反馈,更新到Debian13后网络转发等功能异常,这并非BUG而是Debian13Trixie调整... 日前 Debian 13 Trixie 发布后已经有众多网友升级到新版本,只不过升级后发现某些功能存在异常,例如网络转

SpringBoot3匹配Mybatis3的错误与解决方案

《SpringBoot3匹配Mybatis3的错误与解决方案》文章指出SpringBoot3与MyBatis3兼容性问题,因未更新MyBatis-Plus依赖至SpringBoot3专用坐标,导致类冲... 目录SpringBoot3匹配MyBATis3的错误与解决mybatis在SpringBoot3如果

nginx配置错误日志的实现步骤

《nginx配置错误日志的实现步骤》配置nginx代理过程中,如果出现错误,需要看日志,可以把nginx日志配置出来,以便快速定位日志问题,下面就来介绍一下nginx配置错误日志的实现步骤,感兴趣的可... 目录前言nginx配置错误日志总结前言在配置nginx代理过程中,如果出现错误,需要看日志,可以把

Go语言编译环境设置教程

《Go语言编译环境设置教程》Go语言支持高并发(goroutine)、自动垃圾回收,编译为跨平台二进制文件,云原生兼容且社区活跃,开发便捷,内置测试与vet工具辅助检测错误,依赖模块化管理,提升开发效... 目录Go语言优势下载 Go  配置编译环境配置 GOPROXYIDE 设置(VS Code)一些基本

Python错误AttributeError: 'NoneType' object has no attribute问题的彻底解决方法

《Python错误AttributeError:NoneTypeobjecthasnoattribute问题的彻底解决方法》在Python项目开发和调试过程中,经常会碰到这样一个异常信息... 目录问题背景与概述错误解读:AttributeError: 'NoneType' object has no at

java使用protobuf-maven-plugin的插件编译proto文件详解

《java使用protobuf-maven-plugin的插件编译proto文件详解》:本文主要介绍java使用protobuf-maven-plugin的插件编译proto文件,具有很好的参考价... 目录protobuf文件作为数据传输和存储的协议主要介绍在Java使用maven编译proto文件的插件

SpringBoot+Docker+Graylog 如何让错误自动报警

《SpringBoot+Docker+Graylog如何让错误自动报警》SpringBoot默认使用SLF4J与Logback,支持多日志级别和配置方式,可输出到控制台、文件及远程服务器,集成ELK... 目录01 Spring Boot 默认日志框架解析02 Spring Boot 日志级别详解03 Sp

Visual Studio 2022 编译C++20代码的图文步骤

《VisualStudio2022编译C++20代码的图文步骤》在VisualStudio中启用C++20import功能,需设置语言标准为ISOC++20,开启扫描源查找模块依赖及实验性标... 默认创建Visual Studio桌面控制台项目代码包含C++20的import方法。右键项目的属性:

SpringBoot排查和解决JSON解析错误(400 Bad Request)的方法

《SpringBoot排查和解决JSON解析错误(400BadRequest)的方法》在开发SpringBootRESTfulAPI时,客户端与服务端的数据交互通常使用JSON格式,然而,JSON... 目录问题背景1. 问题描述2. 错误分析解决方案1. 手动重新输入jsON2. 使用工具清理JSON3.