AFFGT
点滴价值

Hi3516DV300 SDK编译遇到的问题

1.前置条件

1).使用的SDK版本为:Hi3516CV500_SDK_V2.0.2.0

2).编译所使用系统:Ubuntu 20.04.2 LTS

3).已经配置好arm-himix200-linux-交叉编译器

2问题:

1).报Makefile:1696: fseeko.o] Error 1

fseterr.c: In function 'fseterr':
fseterr.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       printf-args.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."
      |    ^~~~~
make[5]: *** [Makefile:1696: fseterr.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: *** [Makefile:1696: fseeko.o] Error 1

解决办法:

修改:osdrv/tools/pc/hi_gzip/Makefile:
pushd gzip-1.8;./configure;make -j12;popd
改为:
pushd gzip-1.8;patch -p1 < ../hi_gzip.patch;sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c;echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h;./configure;make -j12;popd

2).编译 squashfs4.3 报错

mksquashfs.c: In function ‘create_inode’:
mksquashfs.c:987:24: error: called object ‘major’ is not a function or function pointer
  987 |   unsigned int major = major(buf->st_rdev);
      |                        ^~~~~
mksquashfs.c:987:16: note: declared here
  987 |   unsigned int major = major(buf->st_rdev);
      |                ^~~~~
mksquashfs.c:988:24: error: called object ‘minor’ is not a function or function pointer
  988 |   unsigned int minor = minor(buf->st_rdev);
      |                        ^~~~~
mksquashfs.c:988:16: note: declared here
  988 |   unsigned int minor = minor(buf->st_rdev);
      |                ^~~~~
mksquashfs.c:1011:24: error: called object ‘major’ is not a function or function pointer
 1011 |   unsigned int major = major(buf->st_rdev);
      |                        ^~~~~
mksquashfs.c:1011:16: note: declared here
 1011 |   unsigned int major = major(buf->st_rdev);
      |                ^~~~~
mksquashfs.c:1012:24: error: called object ‘minor’ is not a function or function pointer
 1012 |   unsigned int minor = minor(buf->st_rdev);
      |                        ^~~~~
mksquashfs.c:1012:16: note: declared here
 1012 |   unsigned int minor = minor(buf->st_rdev);

解决方法:

下载squashfs4.4的版本到文件夹:tools/pc/squashfs4.3/
squashfs4.4.tar.gz

vim tools/pc/squashfs4.3/Makefile 
修改squashfs4.3改为squashfs4.4,如下:
SQUASHFS       := squashfs4.4

3).报fatal error: selinux/selinux.h: No such file or directory

make[3]: 进入目录“/home/payton/imx/Hi3516CV500R001C02SPC020/Hi3516CV500_SDK_V2.0.2.0/osdrv/tools/board/eudev-3.2.7/tmp/eudev-3.2.7/src/shared”
CC selinux-util.lo
selinux-util.c:26:29: fatal error: selinux/selinux.h: No such file or directory
#include <selinux/selinux.h>
^
compilation terminated.
make[3]: *** [Makefile:516:selinux-util.lo] 错误 1
make[3]: 离开目录“/home/hi/Hi3516CV500R001C02SPC020/Hi3516CV500_SDK_V2.0.2.0/osdrv/tools/board/eudev-3.2.7/tmp/eudev-3.2.7/src/shared”
make[2]: *** [Makefile:400:all-recursive] 错误 1
make[2]: 离开目录“/home/hi/Hi3516CV500R001C02SPC020/Hi3516CV500_SDK_V2.0.2.0/osdrv/tools/board/eudev-3.2.7/tmp/eudev-3.2.7/src”

解决方法:

vim tools/board/eudev-3.2.7/Makefile
在./configure后面添加--disable-selinux
如下:
 cd $(BUILD_DIR)/$(UDEV) && ./configure --disable-selinux --disable-blkid --prefix=/ --host=$(HOST) CFLAGS="$(OSDRV_CROSS_CFLAGS)

4).报fatal error: blkid/blkid.h: No such file or directory

udev-builtin-blkid.c:30:25: fatal error: blkid/blkid.h: No such file or directory
#include <blkid/blkid.h>
^
compilation terminated.
make[4]: *** [Makefile:795:libudev_core_la-udev-builtin-blkid.lo] 错误 1
make[4]: 离开目录“/home/hi/Hi3516CV500R001C02SPC020/Hi3516CV500_SDK_V2.0.2.0/osdrv/tools/board/eudev-3.2.7/tmp/eudev-3.2.7/src/udev”

解决方法:

vim tools/board/eudev-3.2.7/Makefile 
在./configure后面添加--disable-blki 如下: 
cd $(BUILD_DIR)/$(UDEV) && ./configure --disable-selinux --disable-blkid --prefix=/ --host=$(HOST) CFLAGS="$(OSDRV_CROSS_CFLAGS)

注意:3、4点为编译同一个工具报错,其实可以去掉Makefile的&>/dev/null查看编译输出。以往的报.h错误很大可能是缺库的,但是这两个问题我差不到缺什么。或者有网友留言告诉我其他解决方法。Ubuntu 20.04.2 LTS会报这些错误,Ubuntu 18是可以直接编译通过的。总的来说开发环境建议不要用太新的Ubuntu

 

赞(1) 打赏
未经允许不得转载:EngineerSharing » Hi3516DV300 SDK编译遇到的问题

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏