[PATCH] iperf: fix compile on gcc 6.3

1,441 views
Skip to first unread message

Justin Cinkelj

unread,
Aug 29, 2017, 4:38:08 AM8/29/17
to osv...@googlegroups.com, Justin Cinkelj
iperf failed to compile on Fedora 25, gcc 6.3, with:
In file included from /usr/include/c++/6.3.1/cmath:42:0,
from /usr/include/c++/6.3.1/math.h:36,
from ../include/headers.h:85,
from ../include/Timestamp.hpp:63,
from delay.cpp:53:
/usr/include/c++/6.3.1/bits/cpp_type_traits.h:205:12: error: redefinition of ‘struct std::__is_integer<int>’
struct __is_integer<int> /*---------------------------------------------------------------*/
^~~~~~~~~~~~~~~~~
/usr/include/c++/6.3.1/bits/cpp_type_traits.h:138:12: error: previous definition of ‘struct std::__is_integer<int>’
struct __is_integer<bool> /*------------------------------------------------------------------------------*/
^~~~~~~~~~~~~~~~~~

Problem is due to checking for sizeof(bool) with gcc (not g++).
Workaround is to comment out '#define bool int' in generated config.h.

Also add .gitignore

Fixes #55

Signed-off-by: Justin Cinkelj <justin....@xlab.si>
---
iperf/.gitignore | 3 +++
iperf/Makefile | 1 +
2 files changed, 4 insertions(+)
create mode 100644 iperf/.gitignore

diff --git a/iperf/.gitignore b/iperf/.gitignore
new file mode 100644
index 0000000..4939ce0
--- /dev/null
+++ b/iperf/.gitignore
@@ -0,0 +1,3 @@
+iperf-[0-9\.]*/
+iperf-[0-9\.]*.tar.gz
+iperf
diff --git a/iperf/Makefile b/iperf/Makefile
index 6a79af1..d956050 100644
--- a/iperf/Makefile
+++ b/iperf/Makefile
@@ -18,6 +18,7 @@ $(iperfv)/src/iperf: $(tarball)
tar xzf $^
patch -p0 < so.patch
cd $(iperfv) && CFLAGS='-fPIC -g' CXXFLAGS='-fPIC -g' ./configure
+ cd $(iperfv) && sed -i 's|^#define bool int|// #define bool int|' config.h
+$(MAKE) -C $(iperfv)

$(tarball):
--
2.9.4

Nadav Har'El

unread,
Sep 12, 2017, 4:32:56 AM9/12/17
to Justin Cinkelj, Osv Dev
Hi, sorry, I didn't see this patch, and committed a different patch
(c8b1906cf59d73a7cb39926c53dc4e136611d4f5) at about the same time,
doing the same thing in a different way.

--
Nadav Har'El
n...@scylladb.com
> --
> You received this message because you are subscribed to the Google Groups "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Justin Cinkelj

unread,
Sep 13, 2017, 3:06:14 AM9/13/17
to Nadav Har'El, Osv Dev
Actually, you saw that patch, but you also found better solution, and
committed that one.
Thank you :)

nicholas...@outlook.com.au

unread,
Jul 6, 2018, 2:02:14 AM7/6/18
to OSv Development
Just had this exact same error on 2018.07.06 (Friday) with Ubuntu 18.04 LTS. What a joke, they still did not fix it.

mips-linux-gnu-g++ -v

....
gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)

Nadav Har'El

unread,
Jul 8, 2018, 10:13:24 AM7/8/18
to nicholas...@outlook.com.au, OSv Development

On Fri, Jul 6, 2018 at 9:02 AM, <nicholas...@outlook.com.au> wrote:
Just had this exact same error on 2018.07.06 (Friday) with Ubuntu 18.04 LTS. What a joke, they still did not fix it.

mips-linux-gnu-g++ -v

....
gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)

I don't know if anyone is still working on iperf 2 (there are so many different versions floating around, I lost track).
If you have the energy to track them down, please point them to


Where I explained what the problem was (an unnecessary line in configure.in) and why it caused this "bool" problem.

ahas...@fiu.edu

unread,
May 18, 2019, 3:24:58 PM5/18/19
to OSv Development
Hi Here,

I still noticing this issue. Could anyone please give me clue?
#####
make all-recursive
make[1]: Entering directory '/home/user/Documents/iperf/iperf-2.0.5'
Making all in compat
make[2]: Entering directory '/home/user/Documents/iperf/iperf-2.0.5/compat'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT Thread.o -MD -MP -MF ".deps/Thread.Tpo" -c -o Thread.o Thread.c; \
then mv -f ".deps/Thread.Tpo" ".deps/Thread.Po"; else rm -f ".deps/Thread.Tpo"; exit 1; fi
Thread.c: In function ‘thread_release_nonterm’:
Thread.c:384:26: warning: format not a string literal and no format arguments [-Wformat-security]
fprintf( stderr, wait_server_threads );
^~~~~~~~~~~~~~~~~~~
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../include -Wall -O2 -MT error.o -MD -MP -MF ".deps/error.Tpo" -c -o error.o error.c; \
then mv -f ".deps/error.Tpo" ".deps/error.Po"; else rm -f ".deps/error.Tpo"; exit 1; fi
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++/7/cmath:42:0,
from /usr/include/c++/7/math.h:36,
from ../include/headers.h:85,
from ../include/Timestamp.hpp:63,
from delay.cpp:53:
/usr/include/c++/7/bits/cpp_type_traits.h:205:12: error: redefinition of ‘struct std::__is_integer<int>’
struct __is_integer<int>
^~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/cpp_type_traits.h:138:12: note: previous definition of ‘struct std::__is_integer<int>’
struct __is_integer<bool>
^~~~~~~~~~~~~~~~~~
Makefile:273: recipe for target 'delay.o' failed
make[2]: *** [delay.o] Error 1
make[2]: Leaving directory '/home/user/Documents/iperf/iperf-2.0.5/compat'
Makefile:252: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/user/Documents/iperf/iperf-2.0.5'
Makefile:190: recipe for target 'all' failed
make: *** [all] Error 2
######

Although I commented out define bool int but it creates tons of error.

Nadav Har'El

unread,
May 19, 2019, 3:35:55 AM5/19/19
to ahas...@fiu.edu, OSv Development
On Sat, May 18, 2019 at 10:25 PM <ahas...@fiu.edu> wrote:
Hi Here,

I still noticing this issue. Could anyone please give me clue?

This is the OSv mailing list, not the iperf mailing list (I don't know if there is one).

The workaround we used in OSv to get iperf-2.0.5 to compile on modern compilers was the simple one in

This patch still seems to be working for me (but I have gcc 8.3.1, apparently you have gcc 7).

 
--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.

rjmcm...@gmail.com

unread,
Jun 15, 2019, 3:43:46 PM6/15/19
to OSv Development
iperf 2.0.5 is very old and has known bugs and performance problems. The osv-dev might want to consider using iperf 2.0.13. https://sourceforge.net/projects/iperf2/

Bob
> To unsubscribe from this group and stop receiving emails from it, send an email to osv...@googlegroups.com.

Waldek Kozaczuk

unread,
Jun 15, 2019, 5:23:31 PM6/15/19
to OSv Development

Robert McMahon

unread,
Jun 16, 2019, 12:24:56 AM6/16/19
to Waldek Kozaczuk, OSv Development
Different tools with different implementation and feature sets.  Some overlap but other's don't, e.g. iperf 2 supports ip multicast while iperf 3 doesn't.

Bob  

You received this message because you are subscribed to a topic in the Google Groups "OSv Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/osv-dev/BE3ZzCltx9w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to osv-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/efac3592-b59e-44ca-bb1b-5586955dbc1c%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages