1、unescaped left brace
报错信息:
Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at /home/os/openwrt-sdk/staging_dir/host/bin/automake line 4160.
autoreconf: /home/os/openwrt-sdk/staging_dir/host/bin/automake failed with exit status: 255
解决办法:
错误信息中说的很清楚,在automake文件中的第4160行中有一个左大括号(left brace)是非法的,这个括号删掉就行了
2、recipe for target “world failed
这个是一类问题,需要向上查具体原因,本人是根据下面文章查找,发现是unescaped left brace报错,然后解决的。
ubuntu 18.04 编译openwrt vmdk镜像错误 && 通用错误解决思路_recipe for target 'world' failed-优快云博客
后记
前面只是解决本地编译的问题,automake.in是位于build_dir编译出来的临时文件,别人新拉下来的代码是不包含的,所以每个人编译都会报错,如何根本解决呢?
# 创建补丁文件
vim tools/automake/patches/210_automake_perl_5.26.1_ver.patch
patch内容如下
diff --git a/bin/automake.in b/bin/automake.in
index a3a0aa318..2c8f31e14 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -3878,7 +3878,7 @@ sub substitute_ac_subst_variables_worker
sub substitute_ac_subst_variables
{
my ($text) = @_;
- $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
+ $text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
return $text;
}
其他类似的问题都可以这样修改,哪个目录下的文件报错,就去tools目录下搜索那个文件下的patches目录下创建patch
3、conficting types for copy_file_range
报错信息:
./…/misc/create_inode.c:395:18: error: conflicting types for ‘copy_file_range’
static errcode_t copy_file_range(ext2_filsys fs, int fd, ext2_file_t e2_file,
^
In file included from ./…/misc/create_inode.c:19:0:
/usr/include/unistd.h:1110:9: note: previous declaration of ‘copy_file_range’ was here
ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
————————————————
原因分析:
和本地主机的有冲突
解决办法:
buildroot-2017.02.3/output/build/host-e2fsprogs-1.43.3/misc/create_inode.c
屏蔽掉 #include <unistd.h>
4 scripts/config/mconf
报错信息:
make -s -C scripts/config mconf: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what’s going on
/home/ss/openwrt/openwrt/include/toplevel.mk:108: recipe for target ‘scripts/config/mconf’ failed
make: *** [scripts/config/mconf] Error 1
原因分析:
有些文件是在编译固件之前就编译了的,这些文件在复制后到了另一个电脑,与本机不兼容导致的。
解决方法:
cd scripts/config
make clean & make
openwrt-scripts/config/mconf: Syntax error: “(” unexpected错误解决-优快云博客
参考文档
MT7628学习笔记(29)——ubuntu18.04 OpenWrt编译出错问题解决_error: format not a string literal, format string -优快云博客