找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 10111|回复: 17

s-s 1.4.1 OpenSSL PolarSSL 动态/静态编译全版

[复制链接]
静态版全部已经在 asus ac66u/n16, belkin f7d4302 裸体 Shibby's Tomato 112/114 上测试通过。

静态版 packed 目录内为 upx 压缩过的执行文件,压缩后 PolarSSL 的静态版几乎和 OpenSSL 动态版文件大小类似~



下载: http://pan.baidu.com/s/1j9spp

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
请教怎么编译 静态编译
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
haxc 发表于 2013-11-17 22:51
请教怎么编译 静态编译

#整理s-s一下编译过程

wget http://www.dd-wrt.com/dd-wrtv2/downloads/others/sourcecode/toolchains/current-toolchains.tar.bz2
tar jxf current-toolchains.tar.bz2

export PATH=/root/toolchain-mipsel_gcc4.1.2/bin/:$PATH
export CC=mipsel-linux-gcc

wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
tar zxf openssl-1.0.1e.tar.gz
./config no-asm --prefix=/usr/src/openssl

vi Makefile

#查找-m64参数全部删掉

make && make install

git clone https://github.com/madeye/s-s-libev.git
vi configure
#注释掉
$as_echo “#define malloc rpl_malloc" >>confdefs.h

vi libev/ev.c

#修改
#elif defined __mips__
#define ECB_MEMORY_FENCE __asm__ __volatile__ (“.set mips2; sync; .set mips0″: : :"memory")

./configure --host=mipsel-linux --with-openssl-include=/usr/src/openssl/include --with-openssl-lib=/usr/src/openssl/lib LDFLAGS=-ldl
make



#我使用的是tomato的toolchains,编译过程差不多,其中openssl参数为:

./config --prefix=/opt/usr/openssl --cross-compile-prefix=/opt/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/mipsel-linux-shared no-asm

#s-s参数为:

./configure --host=mipsel-linux --target=mipsel-linux --prefix=/opt/usr --with-openssl-lib=/opt/usr/openssl/lib --with-openssl-include=/opt/usr/openssl/include --cache-file=linux.cache LDFLAGS="-ldl -Wl,-rpath,/opt/usr/lib"

#修改的地方差不多,只不过我是通过cache欺骗来修改的`rpl_malloc’错误,其次编译时引入了rpath,指定so文件。同时我也做了一个将openssl静态编译进去的版本,能正常工作,缺点是比较大。




#上面是 V2EX 上面整理的

#下面是我自己成功编译使用的参数


#polarssl version
git clone https://github.com/polarssl/polarssl.git
cd polarssl
./configure --prefix=/opt
make && make install

./configure --with-crypto-library=polarssl --with-polarssl=/opt/include/polarssl LDFLAGS="-Wl,-static -static -static-libgcc"

#openssl version
./configure --host=mipsel-linux --target=mipsel-linux --prefix=/opt/usr --with-openssl-lib=/opt/usr/openssl/lib --with-openssl-include=/opt/usr/openssl/include --cache-file=linux.cache LDFLAGS="-ldl -Wl,-rpath,/opt/usr/lib"





我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
另外,我是直接在 AC66U 上面编译的。。。缺什么补什么现在OPT目录打包150多M了。。。基础编译工具包用的是:

https://www.lancethepants.com/files/index.php?dir=Tomatoware/
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

感谢分享,我回去试试
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

SZPUNK 发表于 2013-11-18 19:03
#整理s-s一下编译过程wget http://www.dd[/ba ...

看了下,感情第一个Tomato环境下的s-s还是我编译出来的。
我看了你共享的盘里,非常丰富,借鉴不少,感谢。
red---socks最近更新了,麻烦编译一下,我的虚拟机已经删除了。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

至此,我也分享一下之前编译s-s的记录,可以参考一下,同时希望以后有网友能编译出更多更好的软件来。
1.配置交叉编译环境:

nano /root/.profile
在最后一行处加入
if [ -d "/opt/brcm" ] ; then
    PATH=/opt/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin:/opt/brcm/K26/hndtools-mipsel-uclibc-4.2.4/mipsel-linux-uclibc/binPATH
export PATH
fi
按ctrl+x y 保存退出, 以便每次启动linux时能找到编译器.

ref:

https://www.right.com.cn/forum/thread-53623-1-1.html

http://digiland.tw/viewtopic.php?pid=9177

2.编译openssl:

参数配置:

./config --prefix=/opt/usr/openssl --cross-compile-prefix=/opt/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/mipsel-linux- shared no-asm
3.编译s-s-libev:

参数配置:

./configure --host=mipsel-linux --target=mipsel-linux --prefix=/opt/usr  --with-openssl-lib=/opt/usr/openssl/lib --with-openssl-include=/opt/usr/openssl/include --cache-file=linux.cache LDFLAGS="-ldl -Wl,-rpath,/opt/usr/lib"

1.error:

undefined reference to `rpl_malloc'

then:

  echo "ac_cv_func_malloc_0_nonnull=yes" >linux.cache

2.error:

opcode not supported on this processor: mips1 (mips1) `sync'

then:

修改 /libev/ev.c 文件,如下:

#define ECB_MEMORY_FENCE         __asm__ __volatile__ ("sync"     : : : "memory")

修改为:

#define ECB_MEMORY_FENCE         __asm__ __volatile__ (".set mips2; sync; .set mips0": : :"memory")

4.制作ipkg:

./ipkg-build -c -o root -g root  /opt/s-s-libev

ref:

http://digiland.tw/viewtopic.php?id=1804
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
trob 发表于 2013-11-19 22:50
看了下,感情第一个Tomato环境下的s-s还是我编译出来的。
我看了你共享的盘里,非常丰富, ...

http://pan.baidu.com/s/1AEeOt
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报


请教一下,我在tomato里搭建了s-s和red---socks。但是在实际使用过程中发现red---socks+ss-local配合iptables的效果很不好,速度慢且有时还连不上;而直接使用rr-redir配合iptables的效果却非常好,不知什么原因,搞了两天,郁闷。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
rs+ss-local 需要处理好 dns 污染的问题,而且用 auto 方式判定,效率肯定不如直接把被X网站转向ss-redir;但是用ss-redir需要维护被X网站列表太痛苦了。

目前我还是用 rs+ss-local,没有感觉特别慢,实际上rs本身有缓存,只要访问过的站点,不会慢多少的,timeout 设置为 5 秒。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

大神,能搞个教程出来,直接在tt里用吗?帐号已经有了。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

SZPUNK 发表于 2013-11-22 17:10
rs+ss-local 需要处理好 dns 污染的问题,而且用 auto 方式判定,效率肯定不如直接把被X网站转向ss-redir; ...

我之前已解决dns的问题,前端使用了pdnsd+dnscrypt。我再试试local+rs的模式,感觉是不是rs什么参数没有设置好。
感谢回复。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

jmhjl 发表于 2013-11-24 02:51
大神,能搞个教程出来,直接在tt里用吗?帐号已经有了。

这个就不好说了啊,起码你应该知道以下几点:
1、dns设置,比如dnscrypt、pdnsd什么的
2、ss的使用
3、rs的使用及工作原理
4、iptables的使用
我告诉你一个可以学习的地方,请查看RA-MOD的源码,虽然是openwrt的,但是原理基本是一样的。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

trob 发表于 2013-11-28 21:09
这个就不好说了啊,起码你应该知道以下几点:
1、dns设置,比如dnscrypt、pdnsd什么的
2、ss的使用

好的。谢谢哈
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

对了,问下,这个动态版在tt里怎么安装进去呢?不是ipk文件啊?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-27 07:24

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表