monlor / Monlor-Tools

小米路由器Shell工具箱,本人自用,主要参考了小米的Misstar Tools制作,仅学习之用!Telegram群组:https://t.me/joinchat/FMraA0lwzH9fzEW1wXdCFA
GNU General Public License v3.0
692 stars 135 forks source link

请问能提供工具链吗? #92

Closed abcfy2 closed 6 years ago

abcfy2 commented 6 years ago

发现您编译的apps/下的软件是使用自制的工具链,可以在小米路由器上运行。小米路由器的工具链太老旧了,gcc版本太低,很多软件都无法编译。

我之前尝试过使用crosstool ng自制工具链,结果版本实在太新了,R2D的运行环境太旧,交叉编译之后一些程序跑不起来。试过编译aria2,自制工具链缺失的依赖太多了,很多依赖又难以编译(比如openssl),编译无果。用小米官方提供的R2D工具链,自行编译libexpat之后,总算是成功编译aria2了,但是编译出来的容量居然有70MB这么大,放到小米路由器上运行直接hang死。但是看到大大编译的就只有1MB左右。

所以想问问您的编译参数是什么?或者能否提供下您的工具链呢?或者告知您是如何自制小米路由器的工具链的经验也行。不胜感激

祝好。

monlor commented 6 years ago

推荐使用小米的工具链,兼容性和稳定性比较好。openssl官方SDK里应该是有的,也是我最近才发现。之所以我的程序都很小,是因为都使用了UPX来压缩程序。

abcfy2 commented 6 years ago
# /etc/misstar/applications/aria2/bin/aria2c --version
aria2 version 1.34.0
Copyright (C) 2006, 2017 Tatsuhiro Tsujikawa

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

** Configuration **
Enabled Features: Async DNS, BitTorrent, Firefox3 Cookie, GZip, HTTPS, Message Digest, Metalink, XML-RPC, SFTP
Hash Algorithms: sha-1, sha-224, sha-256, sha-384, sha-512, md5, adler32
Libraries: zlib/1.2.11 expat/2.2.5 sqlite3/3.22.0 OpenSSL/1.0.2o c-ares/1.14.0 libssh2/1.8.1_DEV
Compiler: gcc 4.9.4
  built by  x86_64-by_lonee-linux-gnu
  targeting arm-buildroot-linux-uclibcgnueabi
  on        May 16 2018 00:48:35
System: Linux 2.6.36 #3 MiWiFi-R2D-2.25.204 SMP PREEMPT Fri Sep 14 12:11:54 UTC 2018 armv7l

Report bugs to https://github.com/aria2/aria2/issues
Visit https://aria2.github.io/

我用了你编译的aria2c,发现是用自制工具链编译的(targeting显示arm-buildroot-linux-uclibcgnueabi,而不是小米工具链arm-xiaomi-linux-uclibcgnueabi),所以想问问这个工具链是哪来的?或者是怎么自制的?现在好多软件编译要求gcc至少4.8,个别都5.x以上了,小米的工具链版本实在太低了(比如mini的工具链的gcc才4.6.x)。upx确实可以试试。

就是发现编译出来容量差异太大了,而且运行不了,直接hang死,所以想请教下编译经验。或者能否提供编译参数的参考呢?你用了不是小米的工具链编译出来了aria2,而且aria2的功能几乎全开(features基本全满),那些lib都是一个个自己编译进去的么?

monlor commented 6 years ago

这个工具链你可以在百度找找,其实我都懒得编译程序的,直接用的KoolShare大佬编译的程序。

abcfy2 commented 6 years ago

好的,多谢解答