This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

building iperf (2.0.5) cross compiling for ARM

Hello

i try to build iperf (https://iperf.fr/) for my ARM based platform :

i did the following :

export CROSS_COMPILE=/home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-gcc-
export CC=${CROSS_COMPILE}gcc
export CPP=${CROSS_COMPILE}cpp
export CXX=${CROSS_COMPILE}g++
export LD=${CROSS_COMPILE}ld
export AR=${CROSS_COMPILE}ar

export ac_cv_func_malloc_0_nonnull=yes

./configure --build=/home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-gcc- --host=arm-arago-linux

and i get the following errors :

pengwyn@pengwyn-desktop:~$ cd '/home/pengwyn/iperf-2.0.5'
pengwyn@pengwyn-desktop:~/iperf-2.0.5$ ./configure --build=/home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-gcc- --host=arm-arago-linux
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for arm-arago-linux-strip... no
checking for strip... strip
configure: WARNING: using cross tools not prefixed with host triplet
checking whether the C++ compiler works... no
configure: error: in `/home/pengwyn/iperf-2.0.5':
configure: error: C++ compiler cannot create executables
See `config.log' for more details.

Then make gives :

pengwyn@pengwyn-desktop:~/iperf-2.0.5$ make CFLAGS=-static CXXFLAGS=-static
make  all-recursive
make[1]: Entering directory `/home/pengwyn/iperf-2.0.5'
Making all in compat
make[2]: Entering directory `/home/pengwyn/iperf-2.0.5/compat'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/pengwyn/iperf-2.0.5/compat'
Making all in doc
make[2]: Entering directory `/home/pengwyn/iperf-2.0.5/doc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/pengwyn/iperf-2.0.5/doc'
Making all in include
make[2]: Entering directory `/home/pengwyn/iperf-2.0.5/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/pengwyn/iperf-2.0.5/include'
Making all in src
make[2]: Entering directory `/home/pengwyn/iperf-2.0.5/src'
g++ -Wall -static   -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
SocketAddr.o: In function `SockAddr_setHostname':
SocketAddr.c:(.text+0x1ae): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
ReportCSV.o: In function `CSV_peer':
ReportCSV.c:(.text+0x286): undefined reference to `rpl_malloc'
Reporter.o: In function `InitMulti':
Reporter.c:(.text+0x5a): undefined reference to `rpl_malloc'
Reporter.c:(.text+0x6b): undefined reference to `rpl_malloc'
Reporter.o: In function `InitReport':
Reporter.c:(.text+0x541): undefined reference to `rpl_malloc'
Reporter.c:(.text+0x732): undefined reference to `rpl_malloc'
Reporter.o:Reporter.c:(.text+0xbd9): more undefined references to `rpl_malloc' follow
collect2: ld returned 1 exit status
make[2]: *** [iperf] Error 1
make[2]: Leaving directory `/home/pengwyn/iperf-2.0.5/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pengwyn/iperf-2.0.5'
make: *** [all] Error 2

As anyone any idea of how to build iperf ?

Thank for any suggestion

Best regards

Thank

  • Hello

    Now i get the following error (with the good export : export CROSS_COMPILE=/home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-)
    :

    Relocations in generic ELF (EM: 3)
    gnu_getopt.o: could not read symbols: File in wrong format

    any idea ?

    pengwyn@pengwyn-desktop:~/iperf-2.0.5$ ./configure --build=arm-arago-linux-gnueabi --host=arm-arago-linux
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking for arm-arago-linux-strip... no
    checking for strip... strip
    configure: WARNING: using cross tools not prefixed with host triplet
    checking whether the C++ compiler works... yes
    checking for C++ compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... yes
    checking for suffix of object files... o
    checking whether we are using the GNU C++ compiler... yes
    checking whether /home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-g++ accepts -g... yes
    checking for style of include used by make... GNU
    checking dependency style of /home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-g++... gcc3
    checking for arm-arago-linux-gcc... /home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-gcc
    checking whether we are using the GNU C compiler... yes
    checking whether /home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-gcc accepts -g... yes
    checking for /home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-gcc option to accept ISO C89... none needed
    checking dependency style of /home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-gcc... gcc3
    checking for library containing strerror... none required
    checking whether make sets $(MAKE)... (cached) yes
    checking for arm-arago-linux-ranlib... no
    checking for ranlib... ranlib
    checking build system type... arm-arago-linux-gnueabi
    checking host system type... arm-arago-linux-gnu
    checking for the pthreads library -lpthreads... no
    checking whether pthreads work without any flags... no
    checking whether pthreads work with -Kthread... no
    checking whether pthreads work with -kthread... no
    checking for the pthreads library -llthread... no
    checking whether pthreads work with -pthread... yes
    checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
    checking if more special flags are required for pthreads... no
    checking for cc_r... /home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-gcc
    checking for gethostbyname... yes
    checking for socket... yes
    checking how to run the C preprocessor... /home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-cpp
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking arpa/inet.h usability... yes
    checking arpa/inet.h presence... yes
    checking for arpa/inet.h... yes
    checking libintl.h usability... yes
    checking libintl.h presence... yes
    checking for libintl.h... yes
    checking netdb.h usability... yes
    checking netdb.h presence... yes
    checking for netdb.h... yes
    checking netinet/in.h usability... yes
    checking netinet/in.h presence... yes
    checking for netinet/in.h... yes
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking for strings.h... (cached) yes
    checking sys/socket.h usability... yes
    checking sys/socket.h presence... yes
    checking for sys/socket.h... yes
    checking sys/time.h usability... yes
    checking sys/time.h presence... yes
    checking for sys/time.h... yes
    checking syslog.h usability... yes
    checking syslog.h presence... yes
    checking for syslog.h... yes
    checking for unistd.h... (cached) yes
    checking for an ANSI C-conforming const... yes
    checking for size_t... yes
    checking for ssize_t... yes
    checking whether time.h and sys/time.h may both be included... yes
    checking whether struct tm is in sys/time.h or time.h... time.h
    checking for stdint types... stdint.h (shortcircuit)
    make use of stdint.h in include/iperf-int.h (assuming C99 compatible system)
    checking 3rd argument of accept... socklen_t
    checking for pid_t... yes
    checking vfork.h usability... no
    checking vfork.h presence... no
    checking for vfork.h... no
    checking for fork... yes
    checking for vfork... yes
    checking for working fork... cross
    configure: WARNING: result yes guessed because of cross compilation
    checking for working vfork... (cached) yes
    checking for stdlib.h... (cached) yes
    checking for GNU libc compatible malloc... (cached) yes
    checking for working memcmp... no
    checking sys/select.h usability... yes
    checking sys/select.h presence... yes
    checking for sys/select.h... yes
    checking for sys/socket.h... (cached) yes
    checking types of arguments for select... int,fd_set *,struct timeval *
    checking return type of signal handlers... void
    checking for strftime... yes
    checking for vprintf... yes
    checking for _doprnt... no
    checking for atexit... yes
    checking for gettimeofday... yes
    checking for memset... yes
    checking for pthread_cancel... no
    checking for select... yes
    checking for strchr... yes
    checking for strerror... yes
    checking for strtol... yes
    checking for usleep... yes
    checking for snprintf... yes
    checking for inet_pton... yes
    checking for inet_ntop... yes
    checking for gettimeofday... (cached) yes
    checking *printf() support for %lld... checking *printf() support for %qd... checking size of bool... 0
    checking if true is defined... yes
    checking whether byte ordering is bigendian... no
    checking for struct ip_mreq... yes
    checking whether IP_ADD_MEMBERSHIP is declared... yes
    checking for multicast support... yes
    checking for struct sockaddr_storage... yes
    checking for struct sockaddr_in6... yes
    checking whether AF_INET6 is declared... yes
    checking for IPv6 headers and structures... yes
    checking for struct ipv6_mreq... yes
    checking whether IPV6_ADD_MEMBERSHIP is declared... yes
    checking whether IPV6_MULTICAST_HOPS is declared... yes
    checking for IPv6 multicast support... yes
    checking whether make is GNU make... yes
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating compat/Makefile
    config.status: creating doc/Makefile
    config.status: creating include/Makefile
    config.status: creating src/Makefile
    config.status: creating man/Makefile
    config.status: creating config.h
    config.status: config.h is unchanged
    config.status: executing depfiles commands
    config.status: executing include/iperf-int.h commands
    config.status: creating include/iperf-int.h : _IPERF_INCLUDE_IPERF_INT_H
    config.status: include/iperf-int.h is unchanged
    pengwyn@pengwyn-desktop:~/iperf-2.0.5$
    pengwyn@pengwyn-desktop:~/iperf-2.0.5$
    pengwyn@pengwyn-desktop:~/iperf-2.0.5$ make CFLAGS=-static CXXFLAGS=-static
    make  all-recursive
    make[1]: Entering directory `/home/pengwyn/iperf-2.0.5'
    Making all in compat
    make[2]: Entering directory `/home/pengwyn/iperf-2.0.5/compat'
    make[2]: Nothing to be done for `all'.
    make[2]: Leaving directory `/home/pengwyn/iperf-2.0.5/compat'
    Making all in doc
    make[2]: Entering directory `/home/pengwyn/iperf-2.0.5/doc'
    make[2]: Nothing to be done for `all'.
    make[2]: Leaving directory `/home/pengwyn/iperf-2.0.5/doc'
    Making all in include
    make[2]: Entering directory `/home/pengwyn/iperf-2.0.5/include'
    make[2]: Nothing to be done for `all'.
    make[2]: Leaving directory `/home/pengwyn/iperf-2.0.5/include'
    Making all in src
    make[2]: Entering directory `/home/pengwyn/iperf-2.0.5/src'
    /home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/arm-arago-linux-gnueabi-g++ -Wall -static   -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
    /home/pengwyn/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/bin/../lib/gcc/arm-arago-linux-gnueabi/4.5.3/../../../../arm-arago-linux-gnueabi/bin/ld: gnu_getopt.o: Relocations in generic ELF (EM: 3)
    gnu_getopt.o: could not read symbols: File in wrong format
    collect2: ld returned 1 exit status
    make[2]: *** [iperf] Error 1
    make[2]: Leaving directory `/home/pengwyn/iperf-2.0.5/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/pengwyn/iperf-2.0.5'
    make: *** [all] Error 2