iperf工具移植

移植:
(1)下载源码:http://sourceforge.net/projects/iperf/
(2)在iperf根目录中运行“./configure --host=mips-linux-uclibc”, 或者其他的交叉编译器
(3)在其根目录中运行“make”, 在src/下生成iperf程序(arm平台的)
    编译过程可能报错“ undefined reference to `rpl_malloc'”,解决的方法只要将iperf根目录下config.h中的“#define malloc rpl_malloc”注释掉即可
mips-linux-uclibc-g++ bug fix
 /gcc-4.3.3/build_mips/staging_dir/usr/include/bits/socket.h:271: error: expected initializer before 'throw'
gcc version: 4.3.3

bug fix information:

Index: libc/sysdeps/linux/mips/bits/socket.h

===================================================================
--- libc/sysdeps/linux/mips/bits/socket.h (revision 24233)
+++ libc/sysdeps/linux/mips/bits/socket.h (working copy)
@@ -268,8 +268,8 @@
  + CMSG_ALIGN (sizeof (struct cmsghdr)))
 #define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
 
 /*--------------------主要是修改下面这个函数--------------------------*/
-extern struct cmsghdr * __NTH (__cmsg_nxthdr (struct msghdr *__mhdr,
-      struct cmsghdr *__cmsg)) __THROW;
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+      struct cmsghdr *__cmsg) __THROW;
/*-----------------------------------------------*/
 libc_hidden_proto(__cmsg_nxthdr)
 #ifdef __USE_EXTERN_INLINES
 # ifndef _EXTERN_INLINE
 
 还有错误是'int*' 'socklen_t*',使用(socklen_t *)强制转换下即可。
 需要下载库文件libstdc++.so.6
 
 pc端使用途径界面的jperf
 http://sourceforge.net/projects/iperf/files/jperf/jperf%202.0.0/
 jperf是图形界面的,安装jre(java runtime)后运行jperf.bat就可以运行。

你可能感兴趣的:(工具)