编译itop4412 uboot失败,提示multiple definition of `yylloc‘; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first

[oct1158@oct1158-fedora u-boot]$ ls
build.sh  clean.sh  E4412_N.bl1.bin  env.bin  mkuboot.sh  tools
[oct1158@oct1158-fedora u-boot]$ ./build.sh
#
# configuration written to .config
#
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  UPD     include/config.h
  CFG     u-boot.cfg
  GEN     include/autoconf.mk.dep
  CFG     spl/u-boot.cfg
  GEN     include/autoconf.mk
  GEN     spl/include/autoconf.mk
  CHK     include/config/uboot.release
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  UPD     include/config/uboot.release
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  CHK     include/config.h
  HOSTCC  scripts/dtc/treesource.o
  CFG     u-boot.cfg
  HOSTCC  scripts/dtc/srcpos.o
  CHK     include/generated/version_autogenerated.h
  UPD     include/generated/version_autogenerated.h
  CC      lib/asm-offsets.s
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  CC      arch/arm/lib/asm-offsets.s
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  CHK     include/generated/generic-asm-offsets.h
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  UPD     include/generated/generic-asm-offsets.h
  CHK     include/generated/asm-offsets.h
  UPD     include/generated/asm-offsets.h
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  LDS     u-boot.lds
  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:108: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:425: scripts/dtc] Error 2
make: *** [Makefile:493: scripts] Error 2
cp: cannot stat 'u-boot.bin': No such file or directory
copy u-boot.bin done.
notice: not found itop4412-spl.bin !

解决办法

修改顶层Makefile文件(u-boot-2017.11-itop4412-2.0.0/u-boot-2017.11/Makefile),添加:

HOSTCFLAGS  += -fcommon

笔者用的交叉编译器是gcc-arm-10.2-2020.11-x86_64-arm-none-eabi

最后uboot编译成功了,烧写进SD卡:

dd iflag=dsync oflag=dsync if=u-boot-iTOP-4412.bin of=/dev/sdb seek=1

可以运行:

  • 9
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论
config-dtc是一个用于配置DTC(Device Tree Compiler,设备树编译器)的工具。根据引用中提供的信息,通过运行"./sc-dtc-client --genconfig"命令,可以生成一个配置文件。您可以根据需要对配置文件进行修改。然后,通过运行"./sc-dtc-client"命令重新编译协议缓冲区,并使用"./scripts/protoc_compile.sh"脚本来创建、更新或恢复DTCProtocol.pb.go文件。这个文件包含了编译后的协议缓冲区的定义。这样,您就可以使用这个生成的文件来进行后续的开发工作。引用 另外,根据引用中的信息,如果您想要编译一个DTS(Device Tree Source,设备树源文件)并将结果文件放置在正确的目录中,您可以使用以下命令:"sudo dtc -@ -I dts -O dtb -o /boot/overlays/pitft28-keys.dtbo pitft28-keys.dts"。在执行这个命令之前,您可能需要根据需要更改.dts文件以调整按钮的数量等参数。引用 最后,根据引用中提供的命令示例,如果您想要将u-boot-iTOP-4412.bin文件写入/dev/sdb设备的特定位置,您可以使用以下命令:"dd if=u-boot-iTOP-4412.bin of=/dev/sdb seek=1 iflag=dsync oflag=dsync"。这个命令将会将u-boot-iTOP-4412.bin文件的内容写入到/dev/sdb设备的指定位置,并使用dsync标志来确保数据同步。引用 综上所述,config-dtc是一个用于配置DTC的工具,通过合适的命令和参数,您可以生成配置文件、编译DTS文件,以及将文件写入指定设备的特定位置。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [sc-dtc-client:适用于DTCProtocol服务器的Golang客户端](https://download.csdn.net/download/weixin_42115003/16263635)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [pitft28-agent:Adafruit PiTFT 2,8“电容屏的实验](https://download.csdn.net/download/weixin_42169674/15275665)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [编译itop4412 uboot失败提示multiple definition of `... scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first](https://blog.csdn.net/ZLK1214/article/details/113729027)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

巨大八爪鱼

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值