标题 HISI3516DV300之 osdrv编译
环境 ubuntu22 —就是因为高版本,后面给我带来了不少麻烦
材料: 选用 Hi3516CV500_SDK_V2.0.2.0.tgz (之前选了一个自己使用过的版本,带进了不少奇怪的问题,建议大家用原始版本)
下载参见
https://blog.csdn.net/edsam49/article/details/124653286
步骤: 把Hi3516CV500_SDK_V2.0.2.0.tgz 放到ubuntu 自己的目录上(切入到root权限)—开始
进入 Hi3516CV500_SDK_V2.0.2.0/osdrv 目录下
1> 设置好 arm-himix200-linux 这个交叉编译器的环境变量
2> 输入基础命令
make OSDRV_CROSS=arm-himix200-linux clean
make OSDRV_CROSS=arm-himix200-linux distclean
make all
上面的动作会一直重复,解决各种问题,最先开始的是缺少资源
如: linux-4.9.37.tar.gz 等一些资源包,这个按照文档路径下载,放入相关的路径就好,这个比较简单,不需要赘述
直接上问题:
1> 编译错误: /bin/sh: 1: pushd: not found的问题
原因: 在某些平台SDK编译中LINUX 脚本需要改为/bin/bash ,由于ubuntu 系统模式的脚本是sh ,安装SDK之后
编译过程一定会出现错误,所以必须先更改默认的bash 才行
进入/bin 目录
输入 ls -lh sh
更改命令 sudo dpkg-reconfigure dash 将dash 设置为no
2> 问题
eterr.c:78:3: error: #error “Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib.”
78 | #error “Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib.”
| ^~~~~
CC vasnprintf.o
make[5]: *** [Makefile:1696: fseterr.o] Error 1
make[5]: *** Waiting for unfinished jobs…
CC vfprintf.o
fseeko.c: In function ‘rpl_fseeko’:
fseeko.c:110:4: error: #error “Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib.”
110 | #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib.
解决:下载gzip-1.10.tar.gz并存放到osdrv/tools/pc/hi_gzip目录中,然后修改名称为gzip-1.10.tgz,最后将Makefile中所有“gzip-1.8”修改为“gzip-1.10”
3> 问题
cp: cannot stat ‘/home/zhangy/mpp_3516v300/osdrv/opensource/kernel/linux-4.9.y-smp/arch/arm/boot/uImage’: No such file or directory
原因: mkimage 工具未安装
解决办法
apt-get install bc
apt-get install u-boot-tools
4> 问题
/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
解决办法
修改 E:\HISI\3516v200\020\Hi3516CV500R001C02SPC020\01.software\board\Hi3516CV500_SDK_V2.0.2.0\package\osdrv\opensource\kernel\linux-4.9.37\scripts\dtc\dtc-lexer.lex.c_shipped 文件
在编译源码根目录下的scripts/dtc/dtc-lexer.lex.c 文件中,找到YYLTYPE yylloc定义的地方,前面加上extern外部变量声明
5> 问题
configure: error: missing one or more dependencies
安装完sudo apt-get install uuid-dev
apt-get install zlib1g-dev liblzo2-dev uuid-dev pkg-config
6 >问题
mksquashfs.c编译问题:called object ‘major’ is not a function or function pointer
增加头文件 #include <sys/sysmacros.h>
unsquashfs.c undefined reference to `makedev’
增加头文件#include <sys/sysmacros.h>
7> 问题
/usr/bin/ld: read_fs.o:(.bss+0x0): multiple definition of fwriter_buffer'; mksquashfs.o:(.bss+0x400be8): first defined here /usr/bin/ld: read_fs.o:(.bss+0x8): multiple definition of
bwriter_buffer’; mksquashfs.o:(.bss+0x400bf0): first defined here
/usr/bin/ld: action.o:(.bss+0x0): multiple definition of fwriter_buffer'; mksquashfs.o:(.bss+0x400be8): first defined here /usr/bin/ld: action.o:(.bss+0x8): multiple definition of
bwriter_buffer’; mksquashfs.o:(.bss+0x400bf0): first defined here
/usr/bin/ld: sort.o:(.bss+0x100000): multiple definition of fwriter_buffer'; mksquashfs.o:(.bss+0x400be8): first defined here /usr/bin/ld: sort.o:(.bss+0x100008): multiple definition of
bwriter_buffer’; mksquashfs.o:(.bss+0x400bf0): first defined here
/usr/bin/ld: info.o:(.bss+0x10): multiple definition of bwriter_buffer'; mksquashfs.o:(.bss+0x400bf0): first defined here /usr/bin/ld: info.o:(.bss+0x8): multiple definition of
fwriter_buffer’; mksquashfs.o:(.bss+0x400be8): first defined here
/usr/bin/ld: restore.o:(.bss+0x0): multiple definition of fwriter_buffer'; mksquashfs.o:(.bss+0x400be8): first defined here /usr/bin/ld: restore.o:(.bss+0x8): multiple definition of
bwriter_buffer’; mksquashfs.o:(.bss+0x400bf0): first defined here
/usr/bin/ld: process_fragments.o:(.bss+0x0): multiple definition of fwriter_buffer'; mksquashfs.o:(.bss+0x400be8): first defined here /usr/bin/ld: process_fragments.o:(.bss+0x8): multiple definition of
bwriter_buffer’; mksquashfs.o:(.bss+0x400bf0): first defined here
/usr/bin/ld: xattr.o:(.bss+0x8): multiple definition of fwriter_buffer'; mksquashfs.o:(.bss+0x400be8): first defined here /usr/bin/ld: xattr.o:(.bss+0x10): multiple definition of
bwriter_buffer’; mksquashfs.o:(.bss+0x400bf0): first defined here
修改办法
mksquashfs.h 文件中 bwriter_buffer 和 fwriter_buffer 为 extern 变量
8> 问题
/home/zhangy/Hi3516CV500_SDK_V2.0.2.0/osdrv/tools/board/e2fsprogs/e2fsprogs-1.42.13 /home/zhangy/Hi3516CV500_SDK_V2.0.2.0/osdrv/tools/board/e2fsprogs
configure: WARNING: using cross tools not prefixed with host triplet
make[3]: texi2dvi: No such file or directory
make[3]: [Makefile:333: libext2fs.dvi] Error 127 (ignored)
/usr/bin/install: cannot stat ‘libext2fs.info*’: No such file or directory
make[3]: [Makefile:317: install-doc-libs] Error 1 (ignored)
gzip: /home/zhangy/Hi3516CV500_SDK_V2.0.2.0/osdrv/tools/board/e2fsprogs/e2fsprogs-1.42.13/bin/share/info/libext2fs.info*: No such file or directory
make[3]: [Makefile:319: install-doc-libs] Error 1 (ignored)
/home/zhangy/Hi3516CV500_SDK_V2.0.2.0/osdrv/tools/board/e2fsprogs
make[1]: Leaving directory ‘/home/zhangy/Hi3516CV500_SDK_V2.0.2.0/osdrv/tools/board/e2fsprogs’
注意: 这个问题可以被忽略。
9> 问题
osdrv/tools/board/eudev-3.2.7/tmp/eudev-3.2.7/udevd] Error 1
解决办法 sudo apt-get install gperf
10> 问题
cp: cannot stat ‘/home/zhangy/Hi3516CV500_SDK_V2.0.2.0/osdrv/tools/board/gdb/gdb-7.9.1/gdb/gdb’: No such file or directory
解决办法 sudo apt-get install bison
以上问题基于一些大佬的相关文档,我这里没有贴出来,直接上了解决方法。