Makefile:1279:目标配方' clean-temp.o'失败

时间:2015-05-28 14:28:39

标签: openwrt

我在使用"编译Openwrt SDK时使用V = 99":

Making all in examples
make[6]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/examples'
make[6]: Nothing to be done for 'all'.
make[6]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/examples'
Making all in lib
make[6]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
make  all-am
make[7]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
x86_64-linux-gnu-gcc -std=gnu99  -I.   -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include  -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT gl_avltree_oset.o -MD -MP -MF .deps/gl_avltree_oset.Tpo -c -o gl_avltree_oset.o gl_avltree_oset.c
mv -f .deps/gl_avltree_oset.Tpo .deps/gl_avltree_oset.Po
x86_64-linux-gnu-gcc -std=gnu99  -I.   -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include  -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT c-stack.o -MD -MP -MF .deps/c-stack.Tpo -c -o c-stack.o c-stack.c
mv -f .deps/c-stack.Tpo .deps/c-stack.Po
x86_64-linux-gnu-gcc -std=gnu99  -I.   -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include  -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT clean-temp.o -MD -MP -MF .deps/clean-temp.Tpo -c -o clean-temp.o clean-temp.c
In file included from clean-temp.h:22:0,
                 from clean-temp.c:23:
./stdio.h:456:1: error: 'gets' undeclared here (not in a function)
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 ^
Makefile:1279: recipe for target 'clean-temp.o' failed
make[7]: *** [clean-temp.o] Error 1
make[7]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
Makefile:1083: recipe for target 'all' failed
make[6]: *** [all] Error 2
make[6]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
Makefile:1023: recipe for target 'all-recursive' failed
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Makefile:976: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Makefile:32: recipe for target '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/.built' failed
make[3]: *** [/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/.built] Error 2
make[3]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/tools/m4'
tools/Makefile:112: recipe for target 'tools/m4/compile' failed
make[2]: *** [tools/m4/compile] Error 2
make[2]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt'
tools/Makefile:111: recipe for target '/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32/stamp/.tools_install_nnynn' failed
make[1]: *** [/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32/stamp/.tools_install_nnynn] Error 2
make[1]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt'
/home/ghanem/Documents/openwrtsdk/openwrt/include/toplevel.mk:138: recipe for target 'world' failed
make: *** [world] Error 2
ghanem@ghanem-VGN-BZ31XT:~/Documents/openwrtsdk/openwrt$ clear
ghanem@ghanem-VGN-BZ31XT:~/Documents/openwrtsdk/openwrt$ make V=99
make[1]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt'
make[2]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt'
+ mkdir -p /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32
+ cd /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32
+ mkdir -p bin lib include stamp
mkdir -p /home/ghanem/Documents/openwrtsdk/openwrt/build_dir/target-mipsel_r2_uClibc-0.9.32/stamp
touch /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32/.prepared
+ mkdir -p /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host
+ cd /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host
+ mkdir -p bin lib include stamp
mkdir -p /home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/stamp
install -m0644 /home/ghanem/Documents/openwrtsdk/openwrt/tools/include/*.h /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include/
touch /home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/.prepared
make[3]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/tools/m4'
make -C /home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15
make[4]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
make  all-recursive
make[5]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Making all in .
make[6]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
make[6]: Nothing to be done for 'all-am'.
make[6]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Making all in examples
make[6]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/examples'
make[6]: Nothing to be done for 'all'.
make[6]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/examples'
Making all in lib
make[6]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
make  all-am
make[7]: Entering directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
x86_64-linux-gnu-gcc -std=gnu99  -I.   -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include  -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT gl_avltree_oset.o -MD -MP -MF .deps/gl_avltree_oset.Tpo -c -o gl_avltree_oset.o gl_avltree_oset.c
mv -f .deps/gl_avltree_oset.Tpo .deps/gl_avltree_oset.Po
x86_64-linux-gnu-gcc -std=gnu99  -I.   -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include  -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT c-stack.o -MD -MP -MF .deps/c-stack.Tpo -c -o c-stack.o c-stack.c
mv -f .deps/c-stack.Tpo .deps/c-stack.Po
x86_64-linux-gnu-gcc -std=gnu99  -I.   -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include  -O2 -I/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/host/include -MT clean-temp.o -MD -MP -MF .deps/clean-temp.Tpo -c -o clean-temp.o clean-temp.c
In file included from clean-temp.h:22:0,
                 from clean-temp.c:23:
./stdio.h:456:1: error: 'gets' undeclared here (not in a function)
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 ^
Makefile:1279: recipe for target 'clean-temp.o' failed
make[7]: *** [clean-temp.o] Error 1
make[7]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
Makefile:1083: recipe for target 'all' failed
make[6]: *** [all] Error 2
make[6]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/lib'
Makefile:1023: recipe for target 'all-recursive' failed
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Makefile:976: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15'
Makefile:32: recipe for target '/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/.built' failed
make[3]: *** [/home/ghanem/Documents/openwrtsdk/openwrt/build_dir/host/m4-1.4.15/.built] Error 2
make[3]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt/tools/m4'
tools/Makefile:112: recipe for target 'tools/m4/compile' failed
make[2]: *** [tools/m4/compile] Error 2
make[2]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt'
tools/Makefile:111: recipe for target '/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32/stamp/.tools_install_nnynn' failed
make[1]: *** [/home/ghanem/Documents/openwrtsdk/openwrt/staging_dir/target-mipsel_r2_uClibc-0.9.32/stamp/.tools_install_nnynn] Error 2
make[1]: Leaving directory '/home/ghanem/Documents/openwrtsdk/openwrt'
/home/ghanem/Documents/openwrtsdk/openwrt/include/toplevel.mk:138: recipe for target 'world' failed
make: *** [world] Error 2

任何人都知道这是否经常发生?如果是这样,我怎么能超越它呢?我已经阅读过"修复程序",就像这样:https://dev.openwrt.org/attachment/ticket/12005/stdio.patch但是我怎样才能使用此修复程序,我应该在哪里复制粘贴它?

2 个答案:

答案 0 :(得分:2)

好吧,我能够克服这个错误,但我受到了一大堆其他人的欢迎。无论如何,这是你如何克服它:

在文本编辑器中打开文件“build_dir / host / m4-1.4.16 / lib / stdio.h”,然后搜索“_GL_WARN_ON_USE(获取,”获取是一个安全漏洞 - 改为使用fgets“);”并用以下行替换它。

#define gets(a) fgets( a, sizeof(*(a)), stdin);

保存并关闭。

您现在在build_dir / host中有另一个名为bison-2.4.3的文件夹。转到/build_dir/host/bison-2.4.3/lib/stdio.h并执行相同的操作。那就是它。

答案 1 :(得分:0)

在此之后,您将遇到一个" elf.cpp:静态成员函数'静态Elf :: file * Elf :: file :: open(const char *)& #39;"

要解决此错误,您需要做的就是打开文件" elf.cpp"在/ build_dir / host / mklibs / src / mklibs-readelf并添加:

#include <unistd.h> 

那应该让你超越它。