Toybrick

ToybrickWiki中的内核编译失败

Ablert

新手上路

积分
27
楼主
发表于 2025-8-13 16:38:07    查看: 384|回复: 6 | [复制链接]    打印 | 只看该作者
本帖最后由 Ablert 于 2025-8-13 17:32 编辑

严格按照Wiki中的操作步骤来编译TB_RK3399ProD开发板的内核源码, 编译失败:

Host主机是Ubuntu22.04

stable的分支, ./make.sh linux prod, gcc也是按照wiki中的目录放置

$ ./make.sh linux prod
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
scripts/kconfig/conf  --silentoldconfig Kconfig
  HOSTCC  scripts/basic/fixdep
  WRAP    arch/arm64/include/generated/asm/bug.h
  WRAP    arch/arm64/include/generated/asm/bugs.h
  WRAP    arch/arm64/include/generated/asm/checksum.h
  WRAP    arch/arm64/include/generated/asm/clkdev.h
  WRAP    arch/arm64/include/generated/asm/cputime.h
  WRAP    arch/arm64/include/generated/asm/current.h
  CHK     include/config/kernel.release
  WRAP    arch/arm64/include/generated/asm/delay.h
  WRAP    arch/arm64/include/generated/asm/div64.h
  WRAP    arch/arm64/include/generated/asm/dma.h
  WRAP    arch/arm64/include/generated/asm/dma-contiguous.h
  WRAP    arch/arm64/include/generated/asm/early_ioremap.h
  WRAP    arch/arm64/include/generated/asm/emergency-restart.h
  WRAP    arch/arm64/include/generated/asm/errno.h
  WRAP    arch/arm64/include/generated/asm/ftrace.h
  WRAP    arch/arm64/include/generated/asm/hw_irq.h
  WRAP    arch/arm64/include/generated/asm/ioctl.h
  WRAP    arch/arm64/include/generated/asm/ioctls.h
.
.
.
In file included from scripts/extract-cert.c:24:
/usr/include/openssl/engine.h:450:27: note: declared here
  450 | OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
      |                           ^~~~~~~~~~~~~~~
  CHK     include/generated/asm-offsets.h
  UPD     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  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:100: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:484: scripts/dtc] Error 2
make[1]: *** Waiting for unfinished jobs....
  HOSTLD  scripts/mod/modpost
make: *** [Makefile:590: scripts] Error 2
make: *** Waiting for unfinished jobs....
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     scripts/mod/devicetable-offsets.h
  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:100: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:484: scripts/dtc] Error 2
make: *** [Makefile:590: scripts] Error 2
make: *** Waiting for unfinished jobs....
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     scripts/mod/devicetable-offsets.h
  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:100: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:484: scripts/dtc] Error 2
make: *** [Makefile:590: scripts] Error 2
make: *** Waiting for unfinished jobs....
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
cp: cannot stat 'arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux-u2.dtb': No such file or directory
cp: cannot stat 'arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux-edp.dtb': No such file or directory
cp: cannot stat 'arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux-mipi.dtb': No such file or directory
cp: cannot stat 'arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux-imx258.dtb': No such file or directory
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/utsrelease.h
  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:100: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:484: scripts/dtc] Error 2
make: *** [Makefile:590: scripts] Error 2
make: *** Waiting for unfinished jobs....
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     scripts/mod/devicetable-offsets.h
  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:100: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:484: scripts/dtc] Error 2
  CHK     include/generated/timeconst.h
make: *** [Makefile:590: scripts] Error 2
make: *** Waiting for unfinished jobs....
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
cp: cannot stat 'arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux.dtb': No such file or directory
cp: cannot stat 'arch/arm64/boot/dts/rockchip/rk3399pro-toybrick-prod-linux.dtb': No such file or directory
cp: cannot stat 'arch/arm64/boot/Image': No such file or directory
copying from directory boot_linux







回复

使用道具 举报

Ablert

新手上路

积分
27
沙发
 楼主| 发表于 2025-8-13 23:09:18 | 只看该作者
上面的emoj是什么鬼? Toybrick的Wiki不严谨, 参考Yocto, Yocto每个版本都标明该版本支持哪些发行版, Toybrick Wiki中的方法已经不适合ubuntu22.04这种较新的linux发行版, 得用老一点的ubuntu18.04, 我看firefly的rk33999pro的板子的sdk就是ubuntu18.04原因找到了, 解决办法就好搞了, 有两个办法:
1. 装一个ubuntu18.04的虚拟机, 这个太笨重了, 哪能因为想吃涮羊肉就去养一头羊啊;
2. 使用docker容器, 方案在下面的回帖中;
回复

使用道具 举报

Ablert

新手上路

积分
27
板凳
 楼主| 发表于 2025-8-13 23:21:42 | 只看该作者
我想着使用buildroot做一个sdk看看能不能行, 就去buildroot找看看有没有rk3399pro的配置文件, 没找到, 搜到了firefly的一个rk3399pro的wiki, firefly的rk3399pro的sdk支持的ubuntu发行版是ubunut18.04, 我这才反应过来是不是ubuntu22.04版本太高了, 最后验证果然是这个原因, Toybrick Wiki细节作的一般, 看看Yocto, Yocto的任何一个版本都会明确指出自己支持哪些版本的发行版;
原因找到了, 方案有两个:
1. 使用ubunbu18.04的虚拟机, 这个就有点大可不必了, 投入成本有点高, 只是编译而已, 没必要;
2. 使用docker, 方便快捷;
回复

使用道具 举报

Ablert

新手上路

积分
27
地板
 楼主| 发表于 2025-8-13 23:22:27 | 只看该作者
我想着使用buildroot做一个sdk看看能不能行, 就去buildroot找看看有没有rk3399pro的配置文件, 没找到, 搜到了firefly的一个rk3399pro的wiki, firefly的rk3399pro的sdk支持的ubuntu发行版是ubunut18.04, 我这才反应过来是不是ubuntu22.04版本太高了, 最后验证果然是这个原因, Toybrick Wiki细节作的一般, 看看Yocto, Yocto的任何一个版本都会明确指出自己支持哪些版本的发行版;
原因找到了, 方案有两个:
1. 使用ubunbu18.04的虚拟机, 这个就有点大可不必了, 投入成本有点高, 只是编译而已, 没必要;
2. 使用docker, 方便快捷;
回复

使用道具 举报

Ablert

新手上路

积分
27
5#
 楼主| 发表于 2025-8-13 23:34:51 | 只看该作者
使用Docker的方法如下:
首先的host主机是ubuntu22.04;

创建一个Dockerfile:
$ touch Dockerfile

在Dockerfile文件中添加如下内容:
==========
回复

使用道具 举报

Ablert

新手上路

积分
27
6#
 楼主| 发表于 2025-8-14 09:07:27 | 只看该作者
这个论坛的发帖模式真是比金将军的家法都严, 金将军来了都得拿小本本做笔记, 学习Rockchip旗下的Toybrick论坛人性化的管理方式.
回复

使用道具 举报

Ablert

新手上路

积分
27
7#
 楼主| 发表于 2025-8-14 09:08:28 | 只看该作者
Ablert 发表于 2025-8-13 23:34
使用Docker的方法如下:
首先的host主机是ubuntu22.04;

我写了半天, 最后直接给我截没了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表