Ubuntu14.04編譯Allwinner lichee 兩個出錯解決方法
1.host-m4-1.4.15
In file includedfrom 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");
解決方法:參考連結:
找到:host-m4-1.4.15/lib/stdio.h,然後對stdio.h檔案做出如下改動,必要時連同stdio.in.h一起修改:
- <span style="font-family:Arial;font-size:12px;"># Begin patch
- === modified file 'grub-core/gnulib/stdio.in.h'
- --- grub-core/gnulib/stdio.in.h 2010-09-20 10:35:33 +0000
- +++ grub-core/gnulib/stdio.in.h 2012-07-04 15:18:15 +0000
- @@ -140,8 +140,10 @@
- /* It is very rare that the developer ever has full control of stdin,
- so any use of gets warrants an unconditional warning. Assume it is
- always declared, since it is required by C89. */
- +#if defined gets
- #undef gets
- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- +#endif
2.host-autoconf-2.65
conftest.c:14625:must be after `@defmac' to use `@defmacx'
make[3]: ***[autoconf.info] Error 1
make[3]: Leavingdirectory`//opt/Android/a23androidSRC/lichee/out/linux/common/buildroot/build/host-autoconf-2.65/doc'
make[2]: ***[install-recursive] Error 1
make[2]: Leavingdirectory`/opt/Android/a23androidSRC/lichee/out/linux/common/buildroot/build/host-autoconf-2.65'
make[1]: ***[install] Error 2
make[1]: Leavingdirectory`/opt/Android/a23androidSRC/lichee/out/linux/common/buildroot/build/host-autoconf-2.65'
make: ***[/opt/Android/a23androidSRC/lichee/out/linux/common/buildroot/build/host-autoconf-2.65/.stamp_host_installed]Error 2
解決方法如下:
參考連結:
2樓有個補丁檔案:
- --- autoconf-2.65/doc/autoconf.texi 2009-11-05 10:42:15.000000000 +0800
- +++ autoconf-2.65/doc/autoconf.texi.new 2013-05-28 05:41:09.243770263 +0800
- @@ -15,7 +15,7 @@
- @c The ARG is an optional argument. To be used for macro arguments in
- @c their documentation (@defmac).
- @macro ovar{varname}
- [email protected]{[}@var{\varname\}@r{]}@c
- [email protected]{[}@var{\varname\}@r{]}
- @end macro
- @c @dvar(ARG, DEFAULT)
- @@ -23,7 +23,7 @@
- @c The ARG is an optional argument, defaulting to DEFAULT. To be used
- @c for macro arguments in their documentation (@defmac).
- @macro dvar{varname, default}
- [email protected]{[}@var{\varname\} = @samp{\default\}@r{]}@c
- [email protected]{[}@var{\varname\} = @samp{\default\}@r{]}
- @end macro
- @c Handling the indexes with Texinfo yields several different problems.
根據這個補丁檔案修改即可,直接修改原始碼包,下次編譯就不會再提示這個錯誤了。
3.host-makedevs
/opt/Android/a23androidSRC/lichee/out/linux/common/buildroot/build/host-makedevs/makedevs.c:374:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
int ret = EXIT_SUCCESS;
^
cc1: all warnings being treated as errors
直接修改makedevs.c檔案:
最後一行,return 0;
修改為:return ret;
原始碼位置:./buildroot/package/makedevs/makedevs.c