总结海思 hi3516dv300 020 SDK编译遇到的问题
刚装完工具链可能无法直接执行,因为在64位系统上缺少32位的库,按照下面的步骤安装完依赖的软件后即可使用。
首先按照 sdk 中 osdrv/readme_cn.txt 的描述放置软件包。
然后按照《开发环境用户指南》中的说明安装:
apt install make libc6:i386 lib32z1 lib32stdc++6 zlib1g-dev libncurses5-dev ncurses-term libncursesw5-dev g++ texinfo texlive gawk libssl-dev openssl bc (u-boot-tools:i386)
其中最后一个如果有问题可以不安装。
然后安装某些包中需要的依赖:
apt install u-boot-tools libuuid1:i386 gperf bison
这时候编译还会提示 cannot find uuid library required for mkfs.ubifs,需要按照 osdrv\tools\pc\jffs2_tool\readme_cn.txt 中描述的安装如下依赖即可编译成功:
apt-get install zlib1g-dev liblzo2-dev uuid-dev pkg-config
按照 https://forum.openwrt.org/t/tools-bison-lib-fseterr-c-build-problems-on-18-06-0-due-to-glibc-2-28-changes/18926 这个描述的修改 stdio-impl.h、fseterr.c、fseeko.c 三个文件,并且修改 hi_gzip 里的 makefile 不要更新文件即可。
--- a/lib/stdio-impl.h
+++ b/lib/stdio-impl.h
@@ -18,6 +18,12 @@
the same implementation of stdio extension API, except that some fields
have different naming conventions, or their access requires some casts. */
+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
+ problem by defining it ourselves. FIXME: Do not rely on glibc
+ internals. */
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
+# define _IO_IN_BACKUP 0x100
+#endif
/* BSD stdio derived implementations. */
--- a/lib/fseterr.c
+++ b/lib/fseterr.c
@@ -29,7 +29,7 @@
/* Most systems provide FILE as a struct and the necessary bitmask in
, because they need it for implementing getc() and putc() as
fast macros. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags |= _IO_ERR_SEEN;
#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
fp_->_flags |= __SERR;
下载4.4版本 squashfs,改一下 osdrv/tools/pc/squashfs4.3/mkakefile 里的版本配置
.