2013-03-14 65 views
1

编译netcat的为MIPS我是新本,我有点与它搞乱:问题在Ubuntu

我试图编译MIPS netcat的源代码,以便在我的路由器部署,是什么我做的是:

下载MIPS工具链:MIPS-Linux的GCC

下载netcat的来源,它扩展到一个文件夹

cd path/to/netcatsource 

Execute: 
CC=path/to/compiler/mips-linux-gcc ./configure --host=mips-linux 

make 

make命令工作正常,并tryi在编译netcat的文件显示纳克文件命令:

file netcat 
OUTPUT: ELF 32-bit MSB executable, MIPS, MIPS-I version 1 (SYSV), dynamically linked (uses shared libs), not stripped 

对我来说,似乎一切都很好,但如果我在我的Ubuntu框中执行./netcat它的工作原理,一旦我把它上传到路由器它显示了以下错误:

# ./netcat 
Segmentation fault 

这是从我的路由器在/ proc/cpuinfo中:

# cat /proc/cpuinfo 
system type    : 963281T_TEF 
processor    : 0 
cpu model    : Broadcom4350 V7.5 
BogoMIPS    : 319.48 
wait instruction  : yes 
microsecond timers  : yes 
tlb_entries    : 32 
extra interrupt vector : no 
hardware watchpoint  : no 
ASEs implemented  : 
shadow register sets : 1 
core     : 0 
VCED exceptions   : not available 
VCEI exceptions   : not available 

unaligned exceptions   : 1395 

谁能帮助我? 问候

+1

你有一个'gdb'你的路由器上?如果是这样,尝试调试另一方面,你可以尝试'strace'系统调用实际发生的事情。 – KiaMorot 2013-03-14 14:44:47

+0

嗨@KiaMorot,我没有这些工具。我还安装了busybox-mips以获得更多工具,但不包括在内。 – Nucklear 2013-03-14 14:48:19

+0

然后很难说出发生了什么。你可以尝试一些其他工具链:http://ubuntuforums.org/showthread.php?t=637454 – KiaMorot 2013-03-14 14:55:33

回答

1

(我不能因添加评论,我没有足够的积分)

尝试静态编译源代码
,问题可能会发生,因为你不知道在路由器上有必要的库,也许二进制指向ld-linux.so,路由器使用ld-uclibc.so
因此,尝试静电积聚......

UPDATE
我建议的的buildroot工具链,它的方式包括的netcat和许多其他工具,如busybox的