Ssh 如何为路由器配置交叉编译工具链的交叉工具ng示例?
我想在CentOS 7上为我的路由器(netcore q3,中国制造)交叉编译shadowsocks。所以我得到了crosstools ng,我使用ssh连接到路由器,并获得以下信息(路由器位于shibby提供的番茄固件1.28.0000 MIPSR2-131 K26 Max上),我用作参考Ssh 如何为路由器配置交叉编译工具链的交叉工具ng示例?,ssh,mips,cross-compiling,router,openwrt,Ssh,Mips,Cross Compiling,Router,Openwrt,我想在CentOS 7上为我的路由器(netcore q3,中国制造)交叉编译shadowsocks。所以我得到了crosstools ng,我使用ssh连接到路由器,并获得以下信息(路由器位于shibby提供的番茄固件1.28.0000 MIPSR2-131 K26 Max上),我用作参考 $less /proc/cpuinfo system type : Broadcom BCM53572 chip rev 1 pkg 8 processor
$less /proc/cpuinfo
system type : Broadcom BCM53572 chip rev 1 pkg 8
processor : 0
cpu model : MIPS 74K V4.9
BogoMIPS : 149.50
cpu MHz : 300
wait instruction : no
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : no
hardware watchpoint : yes
ASEs implemented : mips16 dsp
shadow register sets : 1
VCED exceptions : not available
VCEI exceptions : not available
unaligned_instructions : 0
我还从/lib复制了一个.so文件
$ scp root@router:/lib/libc.so.0 .
[oglop@localhost tmp]$ readelf -h libc.so.0
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x6d50
Start of program headers: 52 (bytes into file)
Start of section headers: 260672 (bytes into file)
Flags: 0x50001007, noreorder, pic, cpic, o32, mips32
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 5
Size of section headers: 40 (bytes)
Number of section headers: 18
Section header string table index: 17
路由器上/lib中的文件
root@unknown:/tmp/home/root# ls /lib
ld-uClibc.so.0 libgcc_s.so.1 libutil.so.0
libc.so.0 libm.so.0 modules
libcrypt.so.0 libnsl.so.0 openvpn_plugin_auth_nvram.so
libdl.so.0 libpthread.so.0
我能从这两个人那里得到所有的信息吗?我应该选择哪种样品?
因此,从.So文件:
endianness : little endian
bitness: ?
abi: ?
target os: linux or bare-metal?
c library: glibc, musl or uClibc ?
...
我想我应该从mips unknown linux uclibc
开始,把它改成little-endian
[oglop@localhost tmp]$ ct-ng list-samples | grep mips
[G.X] mips64el-n32-linux-uclibc
[G.X] mips64el-n64-linux-uclibc
[G..] mips-ar2315-linux-gnu
[G..] mipsel-sde-elf
[G..] mipsel-unknown-linux-gnu
[G..] mips-malta-linux-gnu
[G..] mips-unknown-elf
[G..] mips-unknown-linux-uclibc
root@unknown:/tmp/home/root# cat /proc/version
Linux version 2.6.22.19 (root@tomato) (gcc version 4.2.4) #16 Tue Aug 4 00:16:31 CEST 2015
我试图找出番茄使用的libc版本,但是
root@unknown:/tmp/home/root# /lib/libc.so.0
Segmentation fault
root@unknown:/tmp/home/root# ldd --version
-sh: --version: not found
或者我可以从番茄源shibby branch获得我需要的信息吗