出于对Ubuntu新版本系统的体验,将系统更新到了ubuntu22.04了。然后在编译rv1109 sdk时出现了一些异常的错误。但是已经不回去了,只能硬着头皮一路走下去了。并将错误记录以下,以便下次有类似错误,做个参考。
buildroot 报错:c-stack.c:55:26:error:missing binary operator before token “(“55
在buildroot目录中找到c-stack.c文件,并更改c-stack.c文件中,SIGSTKSZ的宏定义。
find -name c-stack.c
gedit c-stack.c
将以下内容:
#ifndef SIGSTKSZ
# define SIGSTKSZ 16384
#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
/* libsigsegv 2.6 through 2.8 have a bug where some architectures use
more than the Linux default of an 8k alternate stack when deciding
if a fault was caused by stack overflow. */
# undef SIGSTKSZ
# define SIGSTKSZ 16384
#endif
更改为:
#ifndef SIGSTKSZ
# define SIGSTKSZ 16384
#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
/* libsigsegv 2.6 through 2.8 have a bug where some architectures use
more than the Linux default of an 8k alternate stack when deciding
if a fault was caused by stack overflow. */
# undef SIGSTKSZ
# define SIGSTKSZ 16384
#endif
libfakeroot.c:99:40: error: ‘_STAT_VER’ undeclared
更改libfakeroot.c文件,添加宏定义
find -name libfakeroot.c
gedit libfakeroot.c
添加内容:
#ifndef _STAT_VER
#if defined (__aarch64__)
#define _STAT_VER 0
#elif defined (__x86_64__)
#define _STAT_VER 1
#else
#define _STAT_VER 3
#endif
#endif
read_fs.o:(.bss+0x0): multiple definition of `fwriter_buffer’; mksquashfs.o:(.bss+0x400be8):
更改mksquashfs相关文件,去掉bwriter_buffer,与fwriter_buffer的定义,改为‘extern’。
find -name “mksquashfs*”
gedit mksquashfs.h
将:struct cache *bwriter_buffer, *fwriter_buffer;
改为: extern struct cache *bwriter_buffer, *fwriter_buffer;
gedit mksquashfs.c
将: struct cache *bwriter_buffer, *fwriter_buffer;
改为: //struct cache *bwriter_buffer, *fwriter_buffer;
qfloat16.h: numeric_limits’ is not a class template
修改 Src/qtbase/src/corelib/global/qglobal.h
将:
#ifdef __cplusplus
# include
# include
# include
#endif
#ifndef __ASSEMBLER__
# include
# include
#endif
改为:
#ifdef __cplusplus
# include
# include
# include
# include
#endif
#ifndef __ASSEMBLER__
# include
# include
#endif
makedevs: line 27: can’t create node /dev/console: Operation not permitted
经查找错误信息,是fakeroot执行fakeroot.fs时报的错。因为是升级了ubuntu系统,可能存在fakeroot版本过低导致。于是将fakeroot版本从1.20.2更新到了1.32.1.操作如下: