Ubuntu1804编译openwrt遇到的问题

第一个错误

错误信息:

autoreconf: running: /home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host/bin/automake --add-missing
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at /home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host/bin/automake line 4160.
autoreconf: /home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host/bin/automake failed with exit status: 255
(cd /home/li/OS/IBSS/IBSS-openwrt.git/build_dir/host/mklibs-0.1.35/; if [ -x configure ]; then cp -fpR /home/li/OS/IBSS/IBSS-openwrt.git/scripts/config.{guess,sub} /home/li/OS/IBSS/IBSS-openwrt.git/build_dir/host/mklibs-0.1.35// &&  /bin/bash ./configure CC="gcc" CFLAGS="-O2 -I/home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host/include -I/home/li/OS/IBSS/IBSS-openwrt.git/tools/mklibs/include" CPPFLAGS="-I/home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host/include" LDFLAGS="-L/home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host/lib " SHELL="/bin/bash" --target=x86_64-linux-gnu --host=x86_64-linux-gnu --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host --exec-prefix=/home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host --sysconfdir=/home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host/etc --localstatedir=/home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host/var --sbindir=/home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host/bin ; fi )
configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."
Makefile:35: recipe for target '/home/li/OS/IBSS/IBSS-openwrt.git/build_dir/host/mklibs-0.1.35/.configured' failed
make[3]: *** [/home/li/OS/IBSS/IBSS-openwrt.git/build_dir/host/mklibs-0.1.35/.configured] Error 1
make[3]: Leaving directory '/home/li/OS/IBSS/IBSS-openwrt.git/tools/mklibs'
tools/Makefile:157: recipe for target 'tools/mklibs/compile' failed
make[2]: *** [tools/mklibs/compile] Error 2
make[2]: Leaving directory '/home/li/OS/IBSS/IBSS-openwrt.git'
tools/Makefile:156: recipe for target '/home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/target-mipsel_mips32_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyyynyyyyyyyynyyyynnyyynnyynnnyyyy' failed
make[1]: *** [/home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/target-mipsel_mips32_uClibc-0.9.33.2/stamp/.tools_install_yynyynynynyyyyyyyyyynyyyyyyyynyyyynnyyynnyynnnyyyy] Error 2
make[1]: Leaving directory '/home/li/OS/IBSS/IBSS-openwrt.git'
/home/li/OS/IBSS/IBSS-openwrt.git/include/toplevel.mk:171: recipe for target 'world' failed
make: *** [world] Error 2

寻找原因行

Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at /home/li/OS/IBSS/IBSS-openwrt.git/staging_dir/host/bin/automake line 4160.

是staging_dir/host/bin/automake的4160行报错
因为新版的perl不再支持左大括号的使用,
进入

vim staging_dir/host/bin/automake +4160

文件删掉大括号,问题解决。

第二个错误

error: ‘gnu_inline’ attribute present on ‘libc_name_p’

.../gcc/cp/cfns.gperf: error: ‘gnu_inline’ attribute present on ‘libc_name_p’ 
.../gcc/cp/cfns.gperf: error: but not here

解决办法

参考这里
修改GGC编译目录下

./build_dir/toolchain-mipsel_mips32_gcc-4.6-linaro_uClibc-0.9.33.2/gcc-linaro-4.6-2013.05/gcc/cp/cfns.h
把原来的文件备份下
--- gcc/cp/cfns.h.orig  2015-02-13 08:27:46.000000000 +0200
+++ gcc/cp/cfns.h   2015-02-13 10:23:53.000000000 +0200
########参考修改处1##################
@@ -56,6 +56,9 @@
 static unsigned int hash (const char *, unsigned int);
 #ifdef __GNUC__
 __inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
 #endif
 const char * libc_name_p (const char *, unsigned int);
 /* maximum key range = 391, duplicates = 0 */
#########参考修改处2###################
@@ -96,7 +99,7 @@
       400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
       400, 400, 400, 400, 400, 400, 400
     };
-  register int hval = len;
+  register int hval = (int)len;
 
   switch (hval)
     {

如上,第二个问题解决

第三个错误

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

解决办法

修改

./build_dir/host/pkg-config-0.28/glib/glib/gdate.c  
./build_dir/host/glib-2.41.1/glib/gdate.c

参考这里

diff --git a/glib/glib/gdate.c b/glib/glib/gdate.c
index 1978cf7..9be9b97 100644
--- a/glib/glib/gdate.c
+++ b/glib/glib/gdate.c
#第一处:2439行修改
@@ -2439,6 +2439,10 @@ 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"
+
 gsize     
 g_date_strftime (gchar       *s, 
                  gsize        slen, 
#第二处:2549行修改
@@ -2549,3 +2553,5 @@ g_date_strftime (gchar       *s,
   return retval;
 #endif
 }
+
+#pragma GCC diagnostic pop

第四个错误

Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.

这个错误是说应该省略defined().
打开

vim ./build_dir/target-mipsel_mips32_uClibc-0.9.33.2/linux-xburst_canna/linux-3.0.8/kernel/timeconst.pl +373

373行

@val = @{$canned_values{$hz}};
if (!defined(@val)) {
@val = compute_values($hz);
}
output($hz, @val);

if (!defined(@val))

改为

if (!(@val))

就ok了
perl版本升级到了 v5.22.1,官网因为有个BUG,该版本将defined(@array)去掉了。可以直接使用数组判断非空

编完了,没错了~~

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 159,015评论 4 362
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,262评论 1 292
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 108,727评论 0 243
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,986评论 0 205
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,363评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,610评论 1 219
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,871评论 2 312
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,582评论 0 198
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,297评论 1 242
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,551评论 2 246
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,053评论 1 260
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,385评论 2 253
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,035评论 3 236
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,079评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,841评论 0 195
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,648评论 2 274
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,550评论 2 270

推荐阅读更多精彩内容

  • 一、Python简介和环境搭建以及pip的安装 4课时实验课主要内容 【Python简介】: Python 是一个...
    _小老虎_阅读 5,618评论 0 10
  • ORA-00001: 违反唯一约束条件 (.) 错误说明:当在唯一索引所对应的列上键入重复值时,会触发此异常。 O...
    我想起个好名字阅读 4,867评论 0 9
  • 让这个世界因为有我 而有一点点不一样 而我的世界不过就是你的心。
    赵赵赵O_o阅读 124评论 0 0
  • 本人是一名亲子咨询师,同时也是一个四岁孩子的妈妈,在日常生活与工作中对孩子的情绪感受方面培养的比较多,也就...
    贇贇妈说阅读 305评论 2 2
  • 春色满园, 繁花尽入各眼。 众生芸芸, 领风骚十数年。 岁月蹉跎偶感叹, 手捧书卷, 懒坐悠庭, 独享清闲。 野火...
    XXKY阅读 292评论 2 10