找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 8240|回复: 15

Gcc6.1编译Openwrt出错,找到解决办法,但是不会打补丁,求详细操作步骤

[复制链接]
悬赏10恩山币已解决
报错Log文件如下:
  1. libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../glib -I../glib -I.. -DG_LOG_DOMAIN="GLib" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION -DPCRE_STATIC -I/home/fire/openwrt/staging_dir/host/include -I/home/fire/openwrt/staging_dir/host/usr/include -pthread -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format=2 -fvisibility=hidden -O2 -I/home/fire/openwrt/staging_dir/host/include -I/home/fire/openwrt/staging_dir/host/usr/include -MT libglib_2_0_la-gdate.lo -MD -MP -MF .deps/libglib_2_0_la-gdate.Tpo -c gdate.c -o libglib_2_0_la-gdate.o
  2. gdate.c: In function 'g_date_strftime':
  3. gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral]
  4.        tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm);
  5.        ^~~~~~
  6. cc1: some warnings being treated as errors
  7. make[10]: *** [Makefile:1386: libglib_2_0_la-gdate.lo] Error 1
  8. make[10]: Leaving directory '/home/fire/openwrt/build_dir/host/pkg-config-0.29/glib/glib'
  9. make[9]: *** [Makefile:1933: all-recursive] Error 1
  10. make[9]: Leaving directory '/home/fire/openwrt/build_dir/host/pkg-config-0.29/glib/glib'
  11. make[8]: *** [Makefile:952: all] Error 2
  12. make[8]: Leaving directory '/home/fire/openwrt/build_dir/host/pkg-config-0.29/glib/glib'
  13. make[7]: *** [Makefile:1045: all-recursive] Error 1
  14. make[7]: Leaving directory '/home/fire/openwrt/build_dir/host/pkg-config-0.29/glib'
  15. make[6]: *** [Makefile:769: all] Error 2
  16. make[6]: Leaving directory '/home/fire/openwrt/build_dir/host/pkg-config-0.29/glib'
  17. make[5]: *** [Makefile:697: all-recursive] Error 1
  18. make[5]: Leaving directory '/home/fire/openwrt/build_dir/host/pkg-config-0.29'
  19. make[4]: *** [Makefile:456: all] Error 2
  20. make[4]: Leaving directory '/home/fire/openwrt/build_dir/host/pkg-config-0.29'
  21. make[3]: *** [Makefile:40: /home/fire/openwrt/build_dir/host/pkg-config-0.29/.built] Error 2
  22. make[3]: Leaving directory '/home/fire/openwrt/tools/pkg-config'
  23. make[2]: *** [tools/Makefile:123: tools/pkg-config/compile] Error 2
  24. make[2]: Leaving directory '/home/fire/openwrt'
  25. make[1]: *** [tools/Makefile:121: /home/fire/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy] Error 2
  26. make[1]: Leaving directory '/home/fire/openwrt'
  27. make: *** [/home/fire/openwrt/include/toplevel.mk:183: world] Error 2
  28. Arch%

  29. Arch% gcc -v
  30. Using built-in specs.
  31. COLLECT_GCC=gcc
  32. COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/6.1.1/lto-wrapper
  33. Target: i686-pc-linux-gnu
  34. Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release
  35. Thread model: posix
  36. gcc version 6.1.1 20160802 (GCC)
  37. Arch%
复制代码
在此博客http://blog.sxx1314.com/openwrt/416.html
找到解决办法,但是要应用补丁,然而我并不会,请万能的论坛大神指点操作步骤。


最佳答案

查看完整内容

楼主试试打开gdate.c 在相应位置把上面几句代码加进去试试
我的恩山、我的无线 The best wifi forum is right here.
  1. 01
  2. >  +--- glib/gdate.c.orig 2014-12-19 21:49:48.000000000 +0000
  3. 02
  4. >  ++++ glib/gdate.c
  5. 03
  6. >  +@@ -2494,7 +2494,10 @@ g_date_strftime (gchar       *s,
  7. 04
  8. >  +        * recognize whether strftime actually failed or just returned "".
  9. 05
  10. >  +        */
  11. 06
  12. >  +       tmpbuf[0] = '\1';
  13. 07
  14. >  ++      #pragma GCC diagnostic push
  15. 08
  16. >  ++      #pragma GCC diagnostic ignored "-Wformat-nonliteral"
  17. 09
  18. >  +       tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm);
  19. 10
  20. >  ++      #pragma GCC diagnostic pop
  21. 11
  22. >  +
  23. 12
  24. >  +       if (tmplen == 0 && tmpbuf[0] != '\0')
  25. 13
  26. >  +         {
复制代码

楼主试试打开gdate.c   在相应位置把上面几句代码加进去试试

点评

这是个笨方法,当然也是有效的,我试过但我更想明白怎么使用补丁功能,毕竟不能没次遇到要打补丁都逐行手动添加吧。  详情 回复 发表于 2016-8-18 21:44
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

官方GCC不行吗?这个补丁复制为xx.patch。丢到gcc的补丁文件夹就行了

点评

我用的是archlinux 现更新到了gcc6.1.1,编译会出这个错误。  详情 回复 发表于 2016-8-18 20:56
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
血洗刀锋 发表于 2016-8-18 18:03
官方GCC不行吗?这个补丁复制为xx.patch。丢到gcc的补丁文件夹就行了

我用的是archlinux 现更新到了gcc6.1.1,编译会出这个错误。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
名探偵コナン 发表于 2016-8-18 21:19
楼主试试打开gdate.c   在相应位置把上面几句代码加进去试试

这是个笨方法,当然也是有效的,我试过但我更想明白怎么使用补丁功能,毕竟不能没次遇到要打补丁都逐行手动添加吧。

点评

一楼不是说了吗?把上面的内容保存成.patch 放到相应的文件夹里  详情 回复 发表于 2016-8-18 22:19
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

百草郎君 发表于 2016-8-18 21:44
这是个笨方法,当然也是有效的,我试过但我更想明白怎么使用补丁功能,毕竟不能没次遇到要打补丁都逐行 ...

一楼不是说了吗?把上面的内容保存成.patch 放到相应的文件夹里
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

archlinux升级像火箭,所以现在我编译openwrt, buildroot这些,使用的在arch下做个debian jessie rootfs, 在后通过schroot方式运行,其实就是个chroot,只是运行schroot更方便,进到里面以后再挂载指定目录(通知配置目录), mount -o bind方式
以后就不用担心arch软件升级太快的问题

点评

类似debootrap功能吗,求指点  详情 回复 发表于 2016-8-19 12:10
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
axlrose 发表于 2016-8-19 11:49
archlinux升级像火箭,所以现在我编译openwrt, buildroot这些,使用的在arch下做个debian jessie rootfs,  ...

类似debootrap功能吗,求指点

点评

就是通过debootstrap安装到本地的目录,你就可以chroot来用了  详情 回复 发表于 2016-8-21 20:07
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

楼主解决了吗?我也遇到同样的问题,不知道这个补丁要打在哪里。

点评

官方wiki我个门外汉看不到,就是不会用。。  详情 回复 发表于 2016-8-20 11:58
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
arfaWong 发表于 2016-8-20 09:17
楼主解决了吗?我也遇到同样的问题,不知道这个补丁要打在哪里。

官方wiki我个门外汉看不到,就是不会用。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

百草郎君 发表于 2016-8-19 12:10
类似debootrap功能吗,求指点

就是通过debootstrap安装到本地的目录,你就可以chroot来用了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

ye*** 该用户已被删除
提示: 作者被禁止或删除 内容自动屏蔽
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
yelxl 发表于 2017-4-26 12:32
https://dev.openwrt.org/browser/trunk/tools/pkg-config/patches/001-glib-gdate-suppress-string-format ...

已经解决,很感谢回复指导,
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您好,我也遇到这个问题了,要怎样打补丁呢

点评

笨方法,打开gdate.c 在相应位置把上面几句代码加进去。再执行编译  详情 回复 发表于 2018-6-24 19:05
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
cuimh 发表于 2018-6-19 10:17
您好,我也遇到这个问题了,要怎样打补丁呢

笨方法,打开gdate.c 在相应位置把上面几句代码加进去。再执行编译
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-27 02:20

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表