cross-compile iperf from x86_64 for ARM64 target

874 Views Asked by At

I want to cross compile iperf-2.0.5 from my x86_64 ubuntu linux machine for a ARM64 target. Therefore I installed the cross compiler:

sudo apt install gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-aarch64-linux-gnu

then I tried to configure:

./configure --build=aarch64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --enable-static --disable-shared

which gives me this warning: configure: WARNING: unrecognized options: --enable-static, --disable-shared

apart from this warning i'm not getting any errors but I'm not sure how to verify that the build and host parameters are selected correctly. When I run make I get the following error.

make  all-recursive
make[1]: Entering directory '/home/recherma/Documents/iperf-2.0.5'
Making all in compat
make[2]: Entering directory '/home/recherma/Documents/iperf-2.0.5/compat'
if g++ -DHAVE_CONFIG_H -I. -I. -I..  -I../include -I../include  -Wall -O2  -MT delay.o -MD -MP -MF ".deps/delay.Tpo" -c -o delay.o delay.cpp; \
then mv -f ".deps/delay.Tpo" ".deps/delay.Po"; else rm -f ".deps/delay.Tpo"; exit 1; fi
In file included from /usr/include/c++/9/stdlib.h:36,
                 from ../include/headers.h:78,
                 from ../include/Timestamp.hpp:63,
                 from delay.cpp:53:
/usr/include/c++/9/cstdlib:151:11: error: ‘::malloc’ has not been declared
  151 |   using ::malloc;
      |           ^~~~~~
In file included from ../include/headers.h:78,
                 from ../include/Timestamp.hpp:63,
                 from delay.cpp:53:
/usr/include/c++/9/stdlib.h:65:12: error: ‘std::malloc’ has not been declared
   65 | using std::malloc;
      |            ^~~~~~
In file included from /usr/include/c++/9/cmath:42,
                 from /usr/include/c++/9/math.h:36,
                 from ../include/headers.h:85,
                 from ../include/Timestamp.hpp:63,
                 from delay.cpp:53:
/usr/include/c++/9/bits/cpp_type_traits.h:214:12: error: redefinition of ‘struct std::__is_integer<int>’
  214 |     struct __is_integer<int>
      |            ^~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/cpp_type_traits.h:138:12: note: previous definition of ‘struct std::__is_integer<int>’
  138 |     struct __is_integer<bool>
      |            ^~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:273: delay.o] Error 1
make[2]: Leaving directory '/home/recherma/Documents/iperf-2.0.5/compat'
make[1]: *** [Makefile:252: all-recursive] Error 1
make[1]: Leaving directory '/home/recherma/Documents/iperf-2.0.5'
make: *** [Makefile:190: all] Error 2

So I guess the configuration failed. Does anyone know now to configure it correctly?

EDIT: I think --host should be changed to aarch64-unknown-linux-gnu. But this changes nothing and I get the exact same errors.

1

There are 1 best solutions below

0
anoopknr On

Try removing DAST_CHECK_BOOL from configure.ac and try reconfigure again.

If that didn't help, after configure, comment #define bool int in config.h and try rebuild.