编译旧版本OpenWrt时遭遇gnulib freadahead.c移植错误及后续标识符未定义问题求助
编译旧版本OpenWrt时遭遇gnulib freadahead.c移植错误及后续标识符未定义问题求助
我最近在尝试编译一个旧版本的OpenWrt,但一直卡在gnulib的freadahead.c移植错误上,折腾了好几个Ubuntu版本都没解决,想请教下大家有没有类似的经验或者解决方案。
最初遇到的错误
在Ubuntu 14.04、16.04、18.04上编译时,都会弹出这个错误:
#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."
我已经尝试过的操作
- 按照网上的建议从源码编译安装了新版m4(GNU M4 1.4.19),但错误依然存在;
- 参考其他软件的patch思路,修改了
freadahead.c里的条件判断代码:
原代码片段:
我把#elif defined _IO_ftrylockfile /* users can define this */ abort (); return 0; #else #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." #endif_IO_ftrylockfile替换成了_IO_EOF_SEEN,但这又引发了新的错误:freadahead.c:32:26: error: '_IO_IN_BACKUP' undeclared (first use in this function) 32 | + (fp->_flags & _IO_IN_BACKUP ? fp->_IO_save_end - fp->_IO_save_base : | ^~~~~~~~~~~~~
现在的问题
现在我卡在了_IO_IN_BACKUP这个未定义的标识符上,想请教下:我应该用哪个标识符来替换_IO_IN_BACKUP才能解决这个编译错误?
内容来源于stack exchange
相关产品推荐
相关产品推荐

