一半君的总结纸

听话只听一半君

shadowsocks-libev 3.1.0 with libc-ares on travis ci

从3.1.0开始,udns换成了libc-ares

fedora 26上试验编译crosstool-ng 1.21.0

  • In file included from zconf.tab.c:213:0:
    zconf.hash.c:170:1: error: conflicting types for ‘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 here
     static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len);
                             ^~~~~~~~~~~~~~~
    make[2]: *** [Makefile:96: zconf.tab.o] Error 1
    make[1]: *** [Makefile:166: build-lib-kconfig] Error 2
    make: *** [Makefile:126: build] Error 2
    

    这是由于gperf太新导致,需要3.0.4,所以最好还是在docker镜像或者虚拟机里搞好,或者脑残法,直接装个旧版

    wget https://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz
    tar xvf gperf-3.0.4
    cd gperf-3.0.4
    ./configure --prefix=/usr
    make
    make install
    
  • INFO ]  Performing some trivial sanity checks
    [INFO ]  Build started 20170924.112011
    [INFO ]  Building environment variables
    [ERROR]    collect2: error: ld returned 1 exit status
    [ERROR]   
    [ERROR]  >>
    [ERROR]  >>  Build failed in step 'Checking that gcc can compile a trivial statically linked program (CT_WANTS_STATIC_LINK)'
    [ERROR]  >>        called in step '(top-level)'
    [ERROR]  >>
    [ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@257]
    [ERROR]  >>        called from: main[scripts/crosstool-NG.sh@546]
    [ERROR]  >>
    [ERROR]  >>  For more info on this error, look at the file: '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 1
    gmake: *** [/usr/local/bin/ct-ng:150: build.4] Error 2
    

    dnf groupinstall "Development Tools"
    dnf install glibc-devel glibc-static libstdc++-static
    
  • [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 failed in step 'Installing final compiler'
    [ERROR]  >>        called in step '(top-level)'
    

    这是因为gcc6以上编译旧版gcc 5.1.0,需要上游的patch, 虽然crosstool-ng有在新版本中带这个patch,可是需要的老版本的uclibc又没有了,所以还不如不要在自己系统里编译,用docker开个旧版系统应该方便些

    update 10/14/2017: lz试了下gcc 5.5.0,似乎不会出错,只需要改一下ctng.config文件里的gcc版本号即可,见这里

fedora 25 on docker

官方镜像里有25

sudo docker run -it --name fedora  docker.io/fedora:25 /bin/bash
dnf groupinstall "Development Tools"
dnf install automake gperf bison flex texinfo wget bzip2 libtool ncurses-devel

git clone https://github.com/crosstool-ng/crosstool-ng.git
cd crosstool-ng
git checkout tags/crosstool-ng-1.21.0
./bootstrap
./configure
# 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 in
zconf.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' failed
make[2]: *** [zconf.tab.o] Error 1
Makefile:166: recipe for target 'build-lib-kconfig' failed
make[1]: *** [build-lib-kconfig] Error 2
Makefile:126: recipe for target 'build' failed
make: *** [build] Error 2

放弃,还是用更老的系统吧

lz用了travis的ubuntu docker镜像

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 m4
configure.ac:27: error: Autoconf version 2.69 or higher is required
configure.ac:27: the top level
autom4te: /usr/bin/m4 failed with exit status: 63
aclocal-1.15: error: echo failed with exit status: 63
WARNING: '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:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make[5]: *** [aclocal.m4] Error 63
make[5]: Leaving directory `/home/travis/builds/tomato-arm/release/src-rt-6.x.4708/router/nano'
make[4]: *** [nano] Error 2

那就按他说的装2.69好了, 因为repo里只有2.68,可以用apt-cache policy autoconf查询

cd ~
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz 
tar xf autoconf-2.69.tar.gz
cd autoconf-2.69
sh configure --prefix /usr
make
sudo  make install

因为lz懒得一步一步试验需要装哪些,所以直接用了编译tomato固件时候需要的那些依赖,在此省略(其实就是把tomato-ci repo里的 .travis.sh 里的pre_build_prep运行了一下,装了一堆automake, autoconf, libtool等)

编译crosstool-ng 1.21工具链

准备工作,添加如下配置文件,不然wget没法从https网站下载文件

check_certificate = off
sudo apt-get install gperf texinfo

mkdir -p /home/travis/src

# edit .config, modify uclibc config file path
ct-ng menuconfig

ct-ng build.4

export PATH=/home/travis/x-tools/mipsel-unknown-linux-uclibc/bin:$PATH

sudo apt-get install asciidoc

. ./travis.sh
# then build install all dependencies

git clone git@github.com:oglops/shadowsocks-libev.git

cd shadowsocks-libev
git submodule update --init --recursive

./autogen.sh

CPPFLAGS="-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-linux

make 
make 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

Advertisements

6 responses to “shadowsocks-libev 3.1.0 with libc-ares on travis ci

  1. lodestar 十月 11, 2017 @ 10:25 下午

    看了一下,发现没看懂。。。这么说吧,我刷了您的HG320 64K的版本,想上ss最新版,我需要做什么??

    • 一半君 十月 11, 2017 @ 11:45 下午

      把ss复制到路由器的jffs里,部分so文件(看少哪些)放到/jffs/lib即可,.json配置文件可参考ss libev github repo, 也可以用右上角的搜索框,大部分ss blog里都会提到几句具体要拷到哪里(比如你想用我的懒人包,可以参考更新磊科q3和烽火hg320自定义版tomato shibby到v140)

      • lodestar 十月 12, 2017 @ 5:45 下午

        好的,今晚我试试

      • lodestar 十月 12, 2017 @ 11:23 下午

        潜水了3个小时,总算是把ss-redir启动了,依赖库也搞定了。把你的blog搜索了数次,发现作为网关用,好像还缺了一些东西,后来我搜到了这个文章:https://www.zfl9.com/ss-redir.html,写的就全面一些了,考虑到dns的查询比对要用tunnel封装,转发的时候还区分国内外流量,恩,雅蠛蝶。。

      • lodestar 十月 12, 2017 @ 11:29 下午

        明晚再看一下gfwlist模式该怎么 配

      • 一半君 十月 12, 2017 @ 11:41 下午

        我没有用gfwlist,因为里面大部分都是h网站,我总共也就那么十几个网站需要上的,所以直接放dnsmasq设置里了(直接放tt web ui里了),另是的,某些地区需要ss-tunnel,想不起在哪篇blog里记录了

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google+ photo

You are commenting using your Google+ account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s

%d 博主赞过: