编译m4-1.4.17库时出现关于 freadahead.c中编译错误
现象
出错提示如下 :
freadahead.c: in function 'freadahead':
freadahead.c3: 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.
91 | #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[1]: *** [tools/makefile /home/fan/openwrt_cc_mt76xx_zhuotk_source/staging_dir/target-mipsel_mips32_uclibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy] error 2
make[1]: leaving directory '/home/fan/openwrt_cc_mt76xx_zhuotk_source'
make: *** [/home/fan/openwrt_cc_mt76xx_zhuotk_source/include/toplevel.mk world] error 2
解决方法
进入文件夹
/buildroot/output/build/host-m4-1.4.17
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
#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
编译findutils-4.4.2时 同样有freadahead.c文件错误
现象
出错提示如下:
freadahead.c: in function 'freadahead':
freadahead.c3: error: #error please port gnulib freadahead.c to your platform! look at the definition of fflush, fread on your system, then report this to bug-gnulib.
#error please port gnulib freadahead.c to your platform! look at the definition of fflush, fread on your
^
make[8]: *** [makefile freadahead.o] error 1
make[8]: leaving directory '/home/fan/openwrt_cc_mt76xx_omj_source/build_dir/host/findutils-4.4.2/gnulib/lib'
make[7]: *** [makefile all] error 2
make[7]: leaving directory '/home/fan/openwrt_cc_mt76xx_omj_source/build_dir/host/findutils-4.4.2/gnulib/lib'
make[6]: *** [makefile all-recursive] error 1
make[6]: leaving directory '/home/fan/openwrt_cc_mt76xx_omj_source/build_dir/host/findutils-4.4.2/gnulib'
make[5]: *** [makefile all-recursive] error 1
make[5]: leaving directory '/home/fan/openwrt_cc_mt76xx_omj_source/build_dir/host/findutils-4.4.2'
make[4]: *** [makefile all] error 2
make[4]: leaving directory '/home/fan/openwrt_cc_mt76xx_omj_source/build_dir/host/findutils-4.4.2'
make[3]: *** [makefile /home/fan/openwrt_cc_mt76xx_omj_source/build_dir/host/findutils-4.4.2/.built] error 2
make[3]: leaving directory '/home/fan/openwrt_cc_mt76xx_omj_source/tools/findutils'
make[2]: *** [tools/makefile tools/findutils/compile] error 2
make[2]: leaving directory '/home/fan/openwrt_cc_mt76xx_omj_source'
make[1]: *** [tools/makefile /home/fan/openwrt_cc_mt76xx_omj_source/staging_dir/target-mipsel_24kec+dsp_uclibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy] error 2
make[1]: leaving directory '/home/fan/openwrt_cc_mt76xx_omj_source'
make: *** [/home/fan/openwrt_cc_mt76xx_omj_source/include/toplevel.mk world] error 2
解决方法
cd build_dir/host/findutils-4.4.2
sed -i 's/io_ftrylockfile/io_eof_seen/' lib/*.c
echo #define _io_in_backup 0x100 >> lib/stdio-impl.h
sed -i 's/io_ftrylockfile/io_eof_seen/' gnulib/lib/*.c
echo #define _io_in_backup 0x100 >> gnulib/lib/stdio-impl.h
echo #define _io_ferror_unlocked >> gnulib/lib/stdio-impl.h
sed -i '/unistd/a #include ' gnulib/lib/mountlist.c
问题依然
findutils-4.6.0替换findutils-4.4.2
切换到dl目录
cd dl
下载findutils-4.6.0
wget https://mirrors.aliyun.com/gnu/findutils/findutils-4.6.0.tar.gz
获取findutils-4.6.0.tar.gz的md5码
md5sum findutils-4.6.0.tar.gz
9936aa8009438ce185bea2694a997fc1 findutils-4.6.0.tar.gz
修改makefile
cd ../tools/findutils/
vim makefile
#
# copyright (c) 2006-2013 openwrt.org
...
# vsersion
pkg_version:=4.6.0
.....
# pkg_md5
pkg_md5sum:=9936aa8009438ce185bea2694a997fc1
.....
删除patch
21-fix-time_t-vs-long-int-mismatches.patch(此文件在4.4.x需要, 4.6.x已经修复了此bug所以不需要了)
rm -f patches/21-fix-time_t-vs-long-int-mismatches.patch
切换目录
cd ../../build_dir/host/findutils-4.6.0
维修源码, 运行以下命令:
sed -i 's/io_ftrylockfile/io_eof_seen/' lib/*.c
echo #define _io_in_backup 0x100 >> lib/stdio-impl.h
sed -i 's/io_ftrylockfile/io_eof_seen/' gl/lib/*.c
echo #define _io_in_backup 0x100 >> gl/lib/stdio-impl.h
sed -i '/unistd/a #include ' gl/lib/mountlist.c
重新编译,此问题消除
STM32单片机中RTC的秒中断的原理解析
基于功率晶体管的150W功率放大器电路图
成都兰花果鞋业采集方案
高通:打官司打出的“江山”
谷歌决定退出美国防部高达100亿美元的云计算项目合同,称与价值观不符
编译OpenWRT出错m4如何解决呢?
华为新物种平板M5青春版正式发布
TCP协议栈链接跟踪的工作原理是什么?
如何正确选择气体流量计测量空压机的气体流量
浅谈矩阵切换器的选择与标准
NB-IoT 芯片开发出支持GEO 卫星网络上测试 的功能
台积电持续扩大领先距离 第二梯队厂商发展布局从多方切入
周立功提供符合功能安全的BMS解决方案平台
4G/5G上下行速率如何计算呢?
乾照、晨丰、莱尔新材等led相关企业募资加速
联想推出ThinkPad P70,为专业用户提供最具性价比的解决方案
三相电表怎么看
我国发展机器人产业时机来临
小米5X发布会前瞻:小米5X发布会预热提前送100部小米5X,配置喜人不怕抢不到
ROG游戏手机2京东预约量突破200万