对于新版本Ubuntu系统来编译SDK,尤其是buildroot ,是一个巨大考验,发现问题如下:
1. c-stack.c的SIGSTKSZ错误
buildroot 报错:c-stack.c:55:26:error:missing binary operator before token "("55
在buildroot目录中找到c-stack.c文件,并更改c-stack.c文件中,SIGSTKSZ的宏定义
解决办法:
修改c-stack.c文件,如下
cpp
#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. */
// 注释下面2行
//# undef SIGSTKSZ
//# define SIGSTKSZ 16384
#endif
2. ibfakeroot.c:99:40: error: '_STAT_VER' undeclared
解决办法:更改libfakeroot.c文件,添加宏定义:
cpp
#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
3. read_fs.o:(.bss+0x0): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400be8):
解决办法:更改mksquashfs相关文件,去掉bwriter_buffer,与fwriter_buffer的定义,改为'extern',涉及到.h .c文件,如下
cpp
// mksquashfs.h
struct cache *bwriter_buffer, *fwriter_buffer;
=》 extern struct cache *bwriter_buffer, *fwriter_buffer;
// mksquashfs.c
struct cache *bwriter_buffer, *fwriter_buffer;
=》
//struct cache *bwriter_buffer, *fwriter_buffer;
4. makedevs: line 27: can't create node
fakeroot执行fakeroot.fs时报的错。因为是升级了ubuntu系统,可能存在fakeroot版本过低导致。于是将fakeroot版本从1.20.2更新到1.26。
解决办法:
cpp
cd buildroot/package/fakeroot
rm -rf *.patch *.hash
vim fakeroot.mk
//改为如下内容,同时把1.26版本包放入dl文件夹下
FAKEROOT_VERSION = 1.26
FAKEROOT_SOURCE = fakeroot_$(FAKEROOT_VERSION).orig.tar.gz