最新版OpenWrt/ledeコンパイルチュートリアル、および各種バージョンの違いによるエラーのまとめ、継続的な更新
5238 ワード
git
, to conveniently download the OpenWrt source code, and build tools
to do the cross-compilation process: apt-get update
sudo apt-get install git-core build-essential libssl-dev libncurses5-dev unzip
Some feeds might not available over git but only via subversion
(short: svn
) or mercurial
. If you want to obtain their source-code, you need to install svn and mercurial as well: sudo apt-get install subversion mercurial
make
and build-essential git(7)
svn
and subversion documentation (multiple languages) git
(see Downloading Sources for more options!): git clone https://git.openwrt.org/openwrt/openwrt.git
this creates a directory 'openwrt', which is the OpenWrt Buildroot build-directory the OpenWrt toolchain "OpenWrt Buildroot"is included cd openwrt && ./scripts/feeds update -a && ./scripts/feeds install -a
make defconfig
make prereq
make menuconfig
There you will need to select what you want to compile. その他のバージョンのアドレス:
openwrt: http://git.openwrt.org/
led(openwrtに統合されました):https://git.lede-project.org/
dlディレクトリのダウンロード:http://downloads.openwrt.org.cn/sources/
各システムバージョンopenwrtコンパイルで問題が発生する可能性があります
問題1(libc)-----------------gconvert.c:55:2: error: #error GNU libiconv not in use but included iconv.h is from libiconv####解決:``cd/build_dir/host/pkg-config-0.28/glib ./configure --enable-iconv=no --with-libiconv=gnu make ```
問題2(automake):------------------------``Unescaped left brace in regex is illegal here in regex;marked by###解決:```https://git.lede-project.org/?p=source.git;a=commit;h=92 c 80 f 38 cff 3 c 20388 f 9 ac 13 d 5196 f 2745 aeaf 77パッチ``を追加
問題3(flex):---------------------``make[6]:***[Makefile:1696:stage 1 scan.c]Segmentation fault(core dumped)`###解決:```https://git.lede-project.org/?p=source.git;a=commitdiff;h=0 fb 14 a 2 b 1 ab 2 f 82 ce 63 f 4437 b 062229 d 73 d 90516ディレクトリ実行autoreconf-ivf``
問題4(n 2 nのコンパイルは通らない)------------------------```構造体重再定義`#######解決:``n 2 nパッチ追加:diff-ruN a/n 2 n.c b/n2n.c --- a/n2n.c 2009-07-17 19:43:58.000000000 +0800+++ b/n2n.c 2017-11-11 11:32:39.452257854 +0800 @@ -334,7 +334,7 @@ ¦| }
¦| snprintf(out_buf, sizeof(out_buf), "%s%s", extra_msg, buf); - syslog(LOG_INFO, out_buf); + syslog(LOG_INFO, "%s", out_buf); ¦|} else { ¦| snprintf(out_buf, sizeof(out_buf), "%s [%11s:%4d] %s%s", theDate, file, line, extra_msg, buf); ¦| printf("%s", out_buf); diff -ruN a/n2n.h b/n2n.h --- a/n2n.h 2009-09-06 13:15:29.000000000 +0800+++ b/n2n.h 2017-11-11 11:31:56.641652210 +0800 @@ -65,6 +65,7 @@ #ifdef __linux__ #include #include +#define __n2nlede__ #endif
#ifdef __FreeBSD__
staging_の変更dir/toolchain-mips_24kc_gcc-5.4.0_musl/include/net/ethernet.h #ifndef __n2nlede__ #include #endif ```
質問5(m 4/findutils)----``error"Please port gnulib freadahead.c to your platform!Look at the definition of fflush,fread,ungetc on your system,then report this to bug-gnulib."解決:```エラーディレクトリへのアクセス:sed-i's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c echo "#define _IO_IN_BACKUP 0x100">> lib/stdio-impl.h sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' gl/lib/*.c echo "#define _IO_IN_BACKUP 0x100">> gl/lib/stdio-impl.h sed -i '/unistd/a #include ' gl/lib/mountlist.c ``` ``` undefined reference to `makedev' #include ```
問題6(php添加modコンパイル不合格)-----------------------------------#####解決:``Makefile添加EXTRA_CFLAGS = -fPIC make clean ``` ``` copy_file_range copy_file_chunk ```
問題7(glib/gdate.c)-----------------gdate.c:2497:7: error: format not a string gdate.c:2497:7:error:format not a strinliteral,format string not`####解決:``checked[-Werror=format-nonliteral]+#pragma GCC diagnostic push+#pragma GCC diagnostic ignored"-Wformat-nonliteral"``
質問8(e 2 fsprogs)------------------------``create_inode.c:395:18: error: conflicting types for 'copy_file_解決:``misc/create_inode.c中のヘッダファイルコメントを削除/#include``
質問9(gccバージョン)-----------------error:'const char*libc_name_p(const char*, unsigned int)' redeclared inline with 'gnu_inline'attr`####解決:``https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=ec1cc0263f156f70693a62cf17b254a0029f4852 ```