从3.1.0开始,udns换成了libc-ares
fedora 26上试验编译crosstool-ng 1.21.0
放弃,还是用更老的系统吧
lz用了travis的ubuntu docker镜像
那就按他说的装2.69好了, 因为repo里只有2.68,可以用apt-cache policy autoconf查询
因为lz懒得一步一步试验需要装哪些,所以直接用了编译tomato固件时候需要的那些依赖,在此省略(其实就是把tomato-ci
repo里的 .travis.sh 里的pre_build_prep运行了一下,装了一堆automake, autoconf,
libtool等)
文件下载:
http://oglopss.github.io/ctng-ss-jekyll/
3.1.0之前的下载见repo的download文件夹,或者上面github pages页面底部的之前一遍blog里的mega网盘
参考:
Issue during make #39
Repositories on Docker Hub
fedora 26上试验编译crosstool-ng 1.21.0
-
这是由于gperf太新导致,需要3.0.4,所以最好还是在docker镜像或者虚拟机里搞好,或者脑残法,直接装个旧版12345678910
Infileincluded from zconf.tab.c:213:0:zconf.hash.c:170:1: error: conflicting typesfor‘kconf_id_lookup’kconf_id_lookup (register const char *str, register size_t len)^~~~~~~~~~~~~~~zconf.hash.c:41:25: note: previous declaration of ‘kconf_id_lookup’ was herestatic struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);^~~~~~~~~~~~~~~make[2]: *** [Makefile:96: zconf.tab.o] Error 1make[1]: *** [Makefile:166: build-lib-kconfig] Error 2make: *** [Makefile:126: build] Error 2
123456wget https://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gztarxvf gperf-3.0.4cdgperf-3.0.4./configure--prefix=/usrmakemakeinstall -
装12345678910111213141516171819
INFO ] Performing some trivial sanity checks[INFO ] Build started 20170924.112011[INFO ] Building environment variables[ERROR] collect2: error: ld returned 1exitstatus[ERROR][ERROR] >>[ERROR] >> Build failedinstep'Checking that gcc can compile a trivial statically linked program (CT_WANTS_STATIC_LINK)'[ERROR] >> calledinstep'(top-level)'[ERROR] >>[ERROR] >> Error happenedin: CT_DoExecLog[scripts/functions@257][ERROR] >> called from: main[scripts/crosstool-NG.sh@546][ERROR] >>[ERROR] >> Formoreinfo on this error,lookat thefile:'build.log'[ERROR] >> There is a list of known issues, some with workarounds,in:[ERROR] >>'/usr/local/share/doc/crosstool-ng/ct-ng.1.21.0/B - Known issues.txt'[ERROR][ERROR] (elapsed: 0:01.23)[00:01] / gmake[1]: *** [/usr/local/bin/ct-ng:147: build] Error 1gmake: *** [/usr/local/bin/ct-ng:150: build.4] Error 2
12dnf groupinstall"Development Tools"dnfinstallglibc-devel glibc-static libstdc++-static -
这是因为gcc6以上编译旧版gcc 5.1.0,需要上游的patch, 虽然crosstool-ng有在新版本中带这个patch,可是需要的老版本的uclibc又没有了,123456789
[INFO ] Installing final compiler[ERROR] cfns.gperf:101:1: error:'const char* libc_name_p(const char*, unsigned int)'redeclared inline with'gnu_inline'attribute[ERROR] gmake[4]: *** [Makefile:1058:cp/except.o] Error 1[ERROR] gmake[3]: *** [Makefile:4118: all-gcc] Error 2[ERROR] gmake[2]: *** [Makefile:874: all] Error 2[ERROR][ERROR] >>[ERROR] >> Build failedinstep'Installing final compiler'[ERROR] >> calledinstep'(top-level)'所以还不如不要在自己系统里编译,用docker开个旧版系统应该方便些
update 10/14/2017: lz试了下gcc 5.5.0,似乎不会出错,只需要改一下ctng.config文件里的gcc版本号即可,见这里
fedora 25 on docker
官方镜像里有25
1
2
3
4
5
6
7
8
9
| sudo docker run -it --name fedora docker.io/fedora:25 /bin/bashdnf groupinstall "Development Tools"dnf install automake gperf bison flex texinfo wget bzip2 libtool ncurses-develgit clone https://github.com/crosstool-ng/crosstool-ng.gitcd crosstool-nggit checkout tags/crosstool-ng-1.21.0./bootstrap./configure |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| # make GEN 'config/configure.in' GEN 'paths.mk' GEN 'paths.sh' CC 'zconf.tab.o'zconf.tab.c: In function 'zconfparse':zconf.tab.c:1508:42: error: 'kconf_id_strings' undeclared (first use in this function) zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[-2].id)->name); ^~~~~~~~~~~~~~~~zconf.tab.c:1508:42: note: each undeclared identifier is reported only once for each function it appears inzconf.tab.c:1629:24: warning: implicit declaration of function 'kconf_id_lookup' [-Wimplicit-function-declaration] struct kconf_id *id = kconf_id_lookup((yyvsp[-1].string), strlen((yyvsp[-1].string))); ^~~~~~~~~~~~~~~zconf.tab.c:1629:24: warning: initialization makes pointer from integer without a cast [-Wint-conversion]zconf.tab.c: In function 'zconf_endtoken':zconf.tab.c:2237:4: error: 'kconf_id_strings' undeclared (first use in this function) kconf_id_strings + id->name, zconf_tokenname(starttoken)); ^~~~~~~~~~~~~~~~In file included from zconf.tab.c:2429:0:lex.zconf.c: In function 'zconflex':lex.zconf.c:1117:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion] struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); ^~~~~~~~~~~~~~~lex.zconf.c:1192:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion] struct kconf_id *id = kconf_id_lookup(zconftext, zconfleng); ^~~~~~~~~~~~~~~Makefile:95: recipe for target 'zconf.tab.o' failedmake[2]: *** [zconf.tab.o] Error 1Makefile:166: recipe for target 'build-lib-kconfig' failedmake[1]: *** [build-lib-kconfig] Error 2Makefile:126: recipe for target 'build' failedmake: *** [build] Error 2 |
lz用了travis的ubuntu docker镜像
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| make[5]: Entering directory `/home/travis/builds/tomato-arm/release/src-rt-6.x.4708/router/nano'CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/travis/builds/tomato-arm/release/src-rt-6.x.4708/router/nano/missing aclocal-1.15 -I m4configure.ac:27: error: Autoconf version 2.69 or higher is requiredconfigure.ac:27: the top levelautom4te: /usr/bin/m4 failed with exit status: 63aclocal-1.15: error: echo failed with exit status: 63WARNING: 'aclocal-1.15' is probably too old. You should only need it if you modified 'acinclude.m4' or 'configure.ac' or m4 files included by 'configure.ac'. The 'aclocal' program is part of the GNU Automake package: It also requires GNU Autoconf, GNU m4 and Perl in order to run: make[5]: *** [aclocal.m4] Error 63make[5]: Leaving directory `/home/travis/builds/tomato-arm/release/src-rt-6.x.4708/router/nano'make[4]: *** [nano] Error 2 |
1
2
3
4
5
6
7
| cd ~wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz tar xf autoconf-2.69.tar.gzcd autoconf-2.69sh configure --prefix /usrmakesudo make install |
编译crosstool-ng 1.21工具链
准备工作,添加如下配置文件,不然wget没法从https网站下载文件
1
| check_certificate = off |
1
2
3
4
5
6
7
8
| sudo apt-get install gperf texinfomkdir -p /home/travis/src# edit .config, modify uclibc config file pathct-ng menuconfigct-ng build.4 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| export PATH=/home/travis/x-tools/mipsel-unknown-linux-uclibc/bin:$PATHsudo apt-get install asciidoc. ./travis.sh# then build install all dependenciesgit clone git@github.com:oglops/shadowsocks-libev.gitcd shadowsocks-libevgit submodule update --init --recursive./autogen.shCPPFLAGS="-I$HOME/cares-install/include -I$HOME/libev-install/include -I$HOME/zlib-install/include" LDFLAGS="-Wl,-rpath,/jffs/lib -L$HOME/cares-install/lib -L$HOME/libev-install/lib -L$HOME/zlib-install/lib" CC=mipsel-unknown-linux-uclibc-gcc CXX=mipsel-unknown-linux-uclibc-g++ AR=mipsel-unknown-linux-uclibc-ar RANLIB=mipsel-unknown-linux-uclibc-ranlib ./configure --disable-ssp --prefix=$HOME/ss-install --with-pcre=$HOME/pcre-install --with-sodium=$HOME/libsodium-install --with-mbedtls=$HOME/mbedtls-install --host=mipsel-uclibc-linuxmakemake install# Then possibly strip and upx the executable files |
http://oglopss.github.io/ctng-ss-jekyll/
3.1.0之前的下载见repo的download文件夹,或者上面github pages页面底部的之前一遍blog里的mega网盘
参考:
Issue during make #39
Repositories on Docker Hub