问题
TR7628开发板厂商给的openwrt sdk在Ubuntu 20.04下编译提示:
freadahead.c:91:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
分析
make
加参数 V=s
打印详细信息,查看出错前进入的目录:
得知是编译主机脚手架工具m4 lib出的问题,搜索报错信息,在stackoverflow上找到相关问题port gnulib fseeko.c to your platform while building the Alexa Auto SDK on Ubuntu 20.04, 得知是GNU m4库和glibc库的互操作兼容性问题,在GNU m4 1.4.19版本已经修复.
解决办法
因此一种解决办法就是更换库版本;下面另一个回答给出另一种解决办法替换宏定义:
cd build_dir/host/m4-1.4.17/
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h