编译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
问题依然
findutils-4.6.0替换findutils-4.4.2
切换到dl目录
cd dl
下载findutils-4.6.0
wgethttps://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
9936aa8009438ce185bea2694a997fc1findutils-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
重新编译,此问题消除
审核编辑:刘清
-
OpenWrt
+关注
关注
10文章
126浏览量
39240
原文标题:【openwrt】编译OpenWRT 出错m4和findutils库 freadahead.c文件错误
文章出处:【微信号:嵌入式加油站,微信公众号:嵌入式加油站】欢迎添加关注!文章转载请注明出处。
发布评论请先 登录
相关推荐
评论