前言:编译所用gcc版本: gcc version 5.5.0

book@100ask ~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.5.0-12ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1)
book@100ask ~$

问题1:Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/${ <-- HERE ([^ \t=:+{}]+)}/ at ./bin/automake.tmp line 3938.

编译报错提示:

make[3]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya/tools/xz'
make[3]: Entering directory '/home/book/hi-wooya/openwrt-hiwooya/tools/automake'
(cd /home/book/hi-wooya/openwrt-hiwooya/build_dir/host/automake-1.15; AUTOM4TE=/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/bin/autom4te AUTOCONF=/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/bin/autoconf AUTOMAKE=/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/bin/automake ACLOCAL=/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/bin/aclocal AUTOHEADER=/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/bin/autoheader LIBTOOLIZE=/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/bin/libtoolize LIBTOOL=/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/bin/libtool M4=/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/bin/m4 AUTOPOINT=true STAGING_DIR="" ./bootstrap.sh)
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at ./bin/automake.tmp line 3938.
Makefile:50: recipe for target '/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/automake-1.15/.configured' failed
make[3]: *** [/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/automake-1.15/.configured] Error 255
make[3]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya/tools/automake'
tools/Makefile:122: recipe for target 'tools/automake/compile' failed
make[2]: *** [tools/automake/compile] Error 2
make[2]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya'
tools/Makefile:121: recipe for target '/home/book/hi-wooya/openwrt-hiwooya/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy' failed
make[1]: *** [/home/book/hi-wooya/openwrt-hiwooya/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy] Error 2
make[1]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya'
/home/book/hi-wooya/openwrt-hiwooya/include/toplevel.mk:181: recipe for target 'world' failed
make: *** [world] Error 2
book@100ask ~/hi-wooya/openwrt-hiwooya [master]$

原因:Perl版本更新后对语法规范进行了变更,若左花括号作为文本则应当进行转义
修改:找到automake源码进行修改,automake源码压缩包预先下载在dl文件夹,源码解压后的位于openwrt安装目录的子目录build_dir/host下边:
/home/book/hi-wooya/openwrt-hiwooya/build_dir/host
进入automake源码目录automake-1.15/binautomake.in文件进行修改
找到报错位置,如下:

3868 # Helper function for 'substitute_ac_subst_variables'.
3869 sub substitute_ac_subst_variables_worker
3870 {3871   my ($token) = @_;
3872   return "\@$token\@" if var $token;
3873   return "\${$token\}";
3874 }
3875
3876 # substitute_ac_subst_variables ($TEXT)
3877 # -------------------------------------
3878 # Replace any occurrence of ${FOO} in $TEXT by @FOO@ if FOO is an AC_SUBST
3879 # variable.
3880 sub substitute_ac_subst_variables
3881 {3882   my ($text) = @_;
3883   $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
3884   return $text;
3885 }

对3883行进行修改,如下:

3876 # substitute_ac_subst_variables ($TEXT)
3877 # -------------------------------------
3878 # Replace any occurrence of ${FOO} in $TEXT by @FOO@ if FOO is an AC_SUBST
3879 # variable.
3880 sub substitute_ac_subst_variables
3881 {3882   my ($text) = @_;
3883  #$text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
3884   $text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
3885   return $text;
3886 }

重新编译即可。

问题2:gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral]

编译报错提示如下:

mv -f .deps/libglib_2_0_la-gconvert.Tpo .deps/libglib_2_0_la-gconvert.Plo
/usr/bin/env bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../glib -I../glib -I..  -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DGLIB_COMPILATION -DPCRE_$
TATIC -I/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/include -I/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/usr/include -pthread -Wall -Wstrict-prototypes -Werror=declaration-$
fter-statement -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -fvisibility=hidden -O2 -I/hom$
/book/hi-wooya/openwrt-hiwooya/staging_dir/host/include -I/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/usr/include -MT libglib_2_0_la-gdate.lo -MD -MP -MF .deps/libglib_2_0_la-gdate.T$
o -c -o libglib_2_0_la-gdate.lo `test -f 'gdate.c' || echo './'`gdate.c
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/book/hi-wooya/openwrt-hi$
ooya/staging_dir/host/include -I/home/book/hi-wooya/openwrt-hiwooya/staging_dir/host/usr/include -pthread -Wall -Wstrict-prototypes -Werror=declaration-after-statement -Werror=missing-prototy$
es -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -fvisibility=hidden -O2 -I/home/book/hi-wooya/openwrt-hiwooya/staging$
dir/host/include -I/home/book/hi-wooya/openwrt-hiwooya/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
gdate.c: In function 'g_date_strftime':
gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral]tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm);^~~~~~
cc1: some warnings being treated as errors
Makefile:1386: recipe for target 'libglib_2_0_la-gdate.lo' failed
make[10]: *** [libglib_2_0_la-gdate.lo] Error 1
make[10]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/pkg-config-0.29/glib/glib'
Makefile:1933: recipe for target 'all-recursive' failed
make[9]: *** [all-recursive] Error 1
make[9]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/pkg-config-0.29/glib/glib'
Makefile:952: recipe for target 'all' failed
make[8]: *** [all] Error 2
make[8]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/pkg-config-0.29/glib/glib'
Makefile:1045: recipe for target 'all-recursive' failed
make[7]: *** [all-recursive] Error 1
make[7]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/pkg-config-0.29/glib'
Makefile:769: recipe for target 'all' failed
make[6]: *** [all] Error 2
make[6]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/pkg-config-0.29/glib'
Makefile:697: recipe for target 'all-recursive' failed
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/pkg-config-0.29'
Makefile:456: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/pkg-config-0.29'
Makefile:39: recipe for target '/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/pkg-config-0.29/.built' failed
make[3]: *** [/home/book/hi-wooya/openwrt-hiwooya/build_dir/host/pkg-config-0.29/.built] Error 2
make[3]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya/tools/pkg-config'
tools/Makefile:122: recipe for target 'tools/pkg-config/compile' failed
make[2]: *** [tools/pkg-config/compile] Error 2
make[2]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya'
tools/Makefile:121: recipe for target '/home/book/hi-wooya/openwrt-hiwooya/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynny$
nnnyy' failed
make[1]: *** [/home/book/hi-wooya/openwrt-hiwooya/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyynyyyyyyyyynyyyyynnyyynnyynnnyy] Error 2
make[1]: Leaving directory '/home/book/hi-wooya/openwrt-hiwooya'
/home/book/hi-wooya/openwrt-hiwooya/include/toplevel.mk:181: recipe for target 'world' failed
make: *** [world] Error 2

问题:网上资料说gcc版本大于6导致
解决:添加补丁,在Openwrt安装目录tools/pkg-config下创建一个文件夹patches,如下所示:

book@100ask ~/hi-wooya/openwrt-hiwooya/tools/pkg-config [master]$ ls
files  Makefile  patches
book@100ask ~/hi-wooya/openwrt-hiwooya/tools/pkg-config [master]$

进入patches文件夹,新建一个补丁文件命名为:001-glib-gdate-suppress-string-format-literal-warning.patch

book@100ask ~/hi-wooya/openwrt-hiwooya/tools/pkg-config/patches [master]$ ls
001-glib-gdate-suppress-string-format-literal-warning.patch
book@100ask ~/hi-wooya/openwrt-hiwooya/tools/pkg-config/patches [master]$

在001-glib-gdate-suppress-string-format-literal-warning.patch文件中输入如下内容:

--- a/glib/glib/gdate.c
+++ b/glib/glib/gdate.c
@@ -2439,6 +2439,9 @@ win32_strftime_helper (const GDate     *d,** Returns: number of characters written to the buffer, or 0 the buffer was too small*/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+gsizeg_date_strftime (gchar       *s,gsize        slen,
@@ -2549,3 +2552,5 @@ g_date_strftime (gchar       *s,return retval;#endif}
+
+#pragma GCC diagnostic pop

参考:https://github.com/widora/openwrt_widora/issues/12

Ubuntu18.04编译Openwrt 15.05.1 Chaos Calmer版本固件遇到的问题汇总相关推荐

  1. openwrt 15.05 branch (Chaos Calmer)编译出的固件bootargs被覆盖

    编译出的固件 bootargs参数被内核覆盖 内核不使用uboot传来的参数 查看代码发现在 内核代码\linux-3.18.27\arch\mips\ath79\prom.c中 调用prom_ini ...

  2. ubuntu18.04编译4.15内核过程

    内核下载地址:Linux kernel 1.将下载好的内核源码压缩包置于ubuntu18.04虚拟机中(在windows上解压会导致部分文件损坏) 2.解压下载的压缩包,在/usr/src中 tar ...

  3. Ubuntu18.04 编译Android 10源码 并烧录源码到pixel3的避坑指南

    Ubuntu18.04 编译Android 10源码 并烧录源码到pixel3的避坑指南 实验环境 下载Android源码树 在pixel3上安装手机驱动版本 编译Android源码 Android ...

  4. Ubuntu18.04 编译报错 `No package ‘orocos-bfl‘ found` 的解决方法

    写在前面 笔者运行环境Ubuntu18.04,ROS-melodic. 在运行 robot_pose_ekf ,出现了 bfl 的报错. 一.报错提示 No package 'orocos-bfl' ...

  5. OpenCV环境配置:Ubuntu18.04编译OpenCV4.2.0和contrib模块记录

    OpenCV环境配置:Ubuntu18.04编译OpenCV4.2.0和contrib模块记录 1.下载源码和安装依赖包 2.解压源码文件和配置路径 3.配置Cmake并编译OpenCV 4.导入Op ...

  6. android 源码编译core dumped,Ubuntu18.04 编译Android 8.1 源码出现的问题及解决笔记

    Ubuntu18.04 编译Android 8.1 源码出现的问题及解决笔记 经过不断的尝试并经过一晚上的编译终于在ubuntu18.04的虚拟机内编译成功Android 8.1,下面我列举以下在编译 ...

  7. Ubuntu18.04 编译安装 Realtek 8852 无线网卡驱动

    记录一下Ubuntu18.04 编译安装 Realtek 8852 无线网卡驱动全过程 内核版本: Linux 5.6.19-050619-generic 先是一步一步按照这个做的,到make的时候发 ...

  8. Ubuntu18.04 编译 ncnn

    官方文档(https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-linux-x86)上说的是: install g++ cmake p ...

  9. Ubuntu18.04编译Android源码openssl版本过高

    报错:*FAILED:/bin/bash -c "(rm -rf out/target/product/FJDEV061/signed )报错原因:Ubuntu18.04的openssl1. ...

最新文章

  1. 逻辑回归python sigmoid(z)_python实现吴恩达机器学习练习2(逻辑回归)-data1
  2. shiro将session认证改成token认证_Shiro 运行过程
  3. Win8下怎样安装Win7 or Win7下怎样安装win8?
  4. 通过webbrowser实现js与winform的相互调用
  5. 阿里云Kubernetes服务上从零搭建GitLab+Jenkins+GitOps应用发布模型的实践全纪录
  6. oracle sql 查询优化器,基于ORACLE成本优化器的SQL查询优化分析与应用
  7. 获取到的数字证书如何配置在自己的Apache中?
  8. 2017.9.5 DZY Loves Math 失败总结
  9. java 代码块的意义_Java基础(9) - 静态、代码块
  10. 【B/S】java(4)
  11. Extjs4.1.x使用Application动态按需加载MVC各模块
  12. DEBUG模式下,视频丢包严重;RELEASE就好了
  13. 基于机器学习的回归拟合、详细总结
  14. Windows 无法访问指定设备、路径或文件
  15. 隐藏输入法图标的方法
  16. volatile修饰变量java_volatile 关键字(修饰变量)
  17. 将电脑调成护眼色不一定起到护眼的功能
  18. 线程池+jsoup+htmlclient实现微博超话社区自动签到
  19. oracle tovarchar2_oracle to_char() 函数的使用, 数字转换为字符串各种格式总结
  20. upper_bound和lower_bound用法

热门文章

  1. 我的世界服务器神秘修改节点,我的世界NBT指令
  2. [Activeden] slick full website template with cms and 2 skins 中文版
  3. python画三维立体图完整代码_如何用Matplotlib 画三维图的示例代码
  4. Matlab GUI编程技巧(十):ui figure函数创建可视化图窗
  5. 第38.1节 osg加载大tif-编译vpb
  6. 神器必会!“世界上最好的编辑器Source Insight”
  7. 每日一课 | 机器学习入门—如何学习机器学习
  8. CSDN自定义模块高级设置之(2)——设置主页左则及详情页背景(打造节日气氛)
  9. Bounding box regression RCNN系列网络中矩形框的计算
  10. 牛客练习赛51c-勾股定理