iperf 2.0.5

  • configure 沒問題ac_cv_func_malloc_0_nonnull=yes \ ./configure --build=i686-linux --host=mipsel-linux \ CFLAGS=-static CXXFLAGS=-static \ CC=/opt/buildroot-gcc342/bin/mipsel-linux-gcc \ CXX=/opt/buildroot-gcc342/bin/mipsel-linux-g++ \ STRIP=/opt/buildroot-gcc342/bin/mipsel-linux-strip \ RANLIB=/opt/buildroot-gcc342/bin/mipsel-linux-ranlib
  • make 沒問題$make
  • make 出錯是因為少做了 ac_cv_func_malloc_0_nonnull=yes$make make all-recursive make[1]: Entering directory `/home/enos/iperf-2.0.5' Making all in compat .... 略 .... 略 .... 略 /opt/buildroot-gcc342/bin/mipsel-linux-g++ -Wall -O2 -o iperf -O2 -pthread -DHAVE_CONFIG_H Client.o Extractor.o Launch.o List.o Listener.o Locale.o PerfSocket.o ReportCSV.o ReportDefault.o Reporter.o Server.o Settings.o SocketAddr.o gnu_getopt.o gnu_getopt_long.o main.o service.o sockets.o stdio.o tcp_window_size.o ../compat/libcompat.a ReportCSV.o: In function `CSV_peer':ReportCSV.c:(.text+0x28): undefined reference to `rpl_malloc' Reporter.o: In function `InitMulti':Reporter.c:(.text+0x7c): undefined reference to `rpl_malloc' :Reporter.c:(.text+0x128): undefined reference to `rpl_malloc' Reporter.o: In function `InitReport':Reporter.c:(.text+0x834): undefined reference to `rpl_malloc' :Reporter.c:(.text+0xa34): undefined reference to `rpl_malloc' Reporter.o:Reporter.c:(.text+0xe18): more undefined references to `rpl_malloc' follow collect2: ld returned 1 exit status make[2]: *** [iperf] Error 1 make[2]: Leaving directory `/home/enos/iperf-2.0.5/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/enos/iperf-2.0.5' make: *** [all] Error 2

iperf 3.0.11

  • 修改 src/Makefile.in--- iperf-3.0.11-old/src/Makefile.in 2015-01-10 01:44:11.000000000 +0800 +++ iperf-3.0.11-new/src/Makefile.in 2015-08-18 11:40:03.619391694 +0800 @@ -593,9 +593,9 @@ iperf3_profile_SOURCES = main.c \ $(libiperf_la_SOURCES) -iperf3_profile_CFLAGS = -pg -g +iperf3_profile_CFLAGS = -g iperf3_profile_LDADD = libiperf.la -iperf3_profile_LDFLAGS = -pg -g +iperf3_profile_LDFLAGS = -g # Specify the sources and various flags for the test cases t_timer_SOURCES = t_timer.c
  • configure 沒問題./configure --build=i686-linux --host=mipsel-linux \ --disable-shared --enable-static \ CC=/opt/buildroot-gcc342/bin/mipsel-linux-gcc \ CXX=/opt/buildroot-gcc342/bin/mipsel-linux-g++ \ STRIP=/opt/buildroot-gcc342/bin/mipsel-linux-strip \ RANLIB=/opt/buildroot-gcc342/bin/mipsel-linux-ranlib \ OBJDUMP=/opt/buildroot-gcc342/bin/mipsel-linux-objdump \ AR=/opt/buildroot-gcc342/bin/mipsel-linux-ar
  • 修改 src/iperf_api.c,由於 Ralink SDK 不支援 affinity,所以直接取消這個功能。--- iperf-3.0.11-old/src/iperf_api.c 2015-01-10 01:44:11.000000000 +0800 +++ iperf-3.0.11-new/src/iperf_api.c 2015-08-18 11:29:33.067193354 +0800 @@ -2614,7 +2614,7 @@ int iperf_setaffinity(int affinity) { -#ifdef linux +#if 0 cpu_set_t cpu_set; CPU_ZERO(&cpu_set); @@ -2633,7 +2633,7 @@ int iperf_clearaffinity(void) { -#ifdef linux +#if 0 cpu_set_t cpu_set; int i;
  • 修改 src/tcp_info.c。--- iperf-3.0.11-old/src/tcp_info.c 2015-01-10 01:44:11.000000000 +0800 +++ iperf-3.0.11-new/src/tcp_info.c 2015-08-18 11:51:54.431410178 +0800 @@ -46,7 +46,6 @@ #include <stdio.h> #include <stdlib.h> #include <sys/param.h> -#include <sys/queue.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/tcp.h>
  • make 沒問題&#36;make
  • make 出錯,請修正 src/iperf_api.c。&#36; make Making all in src make[1]: Entering directory `/home/enos/iperf-3.0.11/src' make all-am make[2]: Entering directory `/home/enos/iperf-3.0.11/src' /bin/sh ../libtool --tag=CC --mode=compile /opt/buildroot-gcc342/bin/mipsel-linux-gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -MT cjson.lo -MD -MP -MF .deps/cjson.Tpo -c -o cjson.lo cjson.c libtool: compile: /opt/buildroot-gcc342/bin/mipsel-linux-gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -MT cjson.lo -MD -MP -MF .deps/cjson.Tpo -c cjson.c -o cjson.o mv -f .deps/cjson.Tpo .deps/cjson.Plo /bin/sh ../libtool --tag=CC --mode=compile /opt/buildroot-gcc342/bin/mipsel-linux-gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -MT iperf_api.lo -MD -MP -MF .deps/iperf_api.Tpo -c -o iperf_api.lo iperf_api.c libtool: compile: /opt/buildroot-gcc342/bin/mipsel-linux-gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -MT iperf_api.lo -MD -MP -MF .deps/iperf_api.Tpo -c iperf_api.c -o iperf_api.o iperf_api.c: In function `iperf_setaffinity': iperf_api.c:2618: error: `cpu_set_t' undeclared (first use in this function) iperf_api.c:2618: error: (Each undeclared identifier is reported only once iperf_api.c:2618: error: for each function it appears in.) iperf_api.c:2618: error: parse error before "cpu_set" iperf_api.c:2620: warning: implicit declaration of function `CPU_ZERO' iperf_api.c:2620: error: `cpu_set' undeclared (first use in this function) iperf_api.c:2621: warning: implicit declaration of function `CPU_SET' iperf_api.c:2622: warning: implicit declaration of function `sched_setaffinity' iperf_api.c: In function `iperf_clearaffinity': iperf_api.c:2637: error: `cpu_set_t' undeclared (first use in this function) iperf_api.c:2637: error: parse error before "cpu_set" iperf_api.c:2640: error: `cpu_set' undeclared (first use in this function) iperf_api.c:2641: error: `CPU_SETSIZE' undeclared (first use in this function) make[2]: *** [iperf_api.lo] Error 1 make[2]: Leaving directory `/home/enos/iperf-3.0.11/src' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/enos/iperf-3.0.11/src' make: *** [all-recursive] Error 1
  • make 出錯,請修正 src/Makefile.in。&#36; make Making all in src make[1]: Entering directory `/home/enos/iperf-3.0.11-new/src' make all-am make[2]: Entering directory `/home/enos/iperf-3.0.11-new/src' .... 略 .... 略 .... 略 libtool: link: /opt/buildroot-gcc342/bin/mipsel-linux-gcc -pg -g -g -O2 -Wall -pg -g -o iperf3_profile iperf3_profile-main.o iperf3_profile-cjson.o iperf3_profile-iperf_api.o iperf3_profile-iperf_error.o iperf3_profile-iperf_client_api.o iperf3_profile-iperf_locale.o iperf3_profile-iperf_server_api.o iperf3_profile-iperf_tcp.o iperf3_profile-iperf_udp.o iperf3_profile-iperf_util.o iperf3_profile-net.o iperf3_profile-tcp_info.o iperf3_profile-tcp_window_size.o iperf3_profile-timer.o iperf3_profile-units.o ./.libs/libiperf.a /opt/buildroot-gcc342/bin/../lib/gcc/mipsel-linux-uclibc/3.4.2/../../../../mipsel-linux-uclibc/bin/ld: gcrt1.o: No such file: No such file or directory collect2: ld returned 1 exit status make[2]: *** [iperf3_profile] Error 1 make[2]: Leaving directory `/home/enos/iperf-3.0.11-new/src' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/enos/iperf-3.0.11-new/src' make: *** [all-recursive] Error 1

參考資料

創作者介紹

邱小新の工作筆記

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()