diff -Nupr iperf-2.0.4.orig/compat/Makefile.am iperf-2.0.4/compat/Makefile.am
--- iperf-2.0.4.orig/compat/Makefile.am	2008-04-08 11:37:54.000000000 +0900
+++ iperf-2.0.4/compat/Makefile.am	2008-07-17 11:37:37.780395707 +0900
@@ -16,6 +16,7 @@ libcompat_a_SOURCES = \
 		      headers_slim.h \
 		      inet_ntop.c \
 		      inet_pton.c \
+		      malloc.c \
 		      signal.c \
 		      snprintf.c \
 		      string.c
diff -Nupr iperf-2.0.4.orig/compat/Makefile.in iperf-2.0.4/compat/Makefile.in
--- iperf-2.0.4.orig/compat/Makefile.in	2008-04-08 12:38:40.000000000 +0900
+++ iperf-2.0.4/compat/Makefile.in	2008-07-17 11:39:29.180139704 +0900
@@ -54,8 +54,8 @@ libcompat_a_AR = $(AR) $(ARFLAGS)
 libcompat_a_LIBADD =
 am_libcompat_a_OBJECTS = Thread.$(OBJEXT) error.$(OBJEXT) \
 	delay.$(OBJEXT) gettimeofday.$(OBJEXT) inet_ntop.$(OBJEXT) \
-	inet_pton.$(OBJEXT) signal.$(OBJEXT) snprintf.$(OBJEXT) \
-	string.$(OBJEXT)
+	inet_pton.$(OBJEXT) malloc.$(OBJEXT) signal.$(OBJEXT) \
+	snprintf.$(OBJEXT) string.$(OBJEXT)
 libcompat_a_OBJECTS = $(am_libcompat_a_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -193,6 +193,7 @@ libcompat_a_SOURCES = \
 		      headers_slim.h \
 		      inet_ntop.c \
 		      inet_pton.c \
+		      malloc.c \
 		      signal.c \
 		      snprintf.c \
 		      string.c
@@ -250,6 +251,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string.Po@am__quote@
diff -Nupr iperf-2.0.4.orig/compat/Thread.c iperf-2.0.4/compat/Thread.c
--- iperf-2.0.4.orig/compat/Thread.c	2008-04-08 11:37:54.000000000 +0900
+++ iperf-2.0.4/compat/Thread.c	2008-07-17 11:36:46.000507703 +0900
@@ -95,7 +95,7 @@ Condition thread_sNum_cond;
  * Initialize the thread subsystems variables and set the concurrency
  * level in solaris.
  * ------------------------------------------------------------------- */
-void thread_init( ) {
+void thread_initialize( ) {
     Condition_Initialize( &thread_sNum_cond );
 #if defined( sun )
     /* Solaris apparently doesn't default to timeslicing threads,
diff -Nupr iperf-2.0.4.orig/compat/malloc.c iperf-2.0.4/compat/malloc.c
--- iperf-2.0.4.orig/compat/malloc.c	1970-01-01 09:00:00.000000000 +0900
+++ iperf-2.0.4/compat/malloc.c	2008-07-17 12:09:58.505835702 +0900
@@ -0,0 +1,34 @@
+/*
+ * This code is diverted from the autoconf manual (AC_FUNC_MALLOC).
+ */
+
+#ifdef HAVE_CONFIG_H
+    #include "config.h"
+#endif
+
+#if !(HAVE_MALLOC)
+
+#undef malloc
+
+#include <sys/types.h>
+
+void *malloc( );
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Allocate an N-byte block of memory from the heap.
+   If N is zero, allocate a 1-byte block. */
+
+void *rpl_malloc( size_t n ) {
+    if (n == 0)
+        n = 1;
+    return malloc(n);
+}
+
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif
+
+#endif /* !(HAVE_MALLOC) */
diff -Nupr iperf-2.0.4.orig/include/Thread.h iperf-2.0.4/include/Thread.h
--- iperf-2.0.4.orig/include/Thread.h	2007-08-30 07:06:19.000000000 +0900
+++ iperf-2.0.4/include/Thread.h	2008-07-17 11:36:38.430518102 +0900
@@ -100,7 +100,7 @@ typedef int nthread_t;
 #include "Settings.hpp"
 
     // initialize or destroy the thread subsystem
-    void thread_init( );
+    void thread_initialize( );
     void thread_destroy( );
 
     // start or stop a thread executing
diff -Nupr iperf-2.0.4.orig/src/Makefile.am iperf-2.0.4/src/Makefile.am
--- iperf-2.0.4.orig/src/Makefile.am	2008-04-08 11:37:54.000000000 +0900
+++ iperf-2.0.4/src/Makefile.am	2008-07-17 11:37:04.350460702 +0900
@@ -12,7 +12,7 @@ AM_CPPFLAGS = @STRIP_BEGIN@ \
 AM_CXXFLAGS = -Wall
 AM_CFLAGS = -Wall
 
-iperf_LDFLAGS = @CFLAGS@ @PTHREAD_CFLAGS@ @WEB100_CFLAGS@ @DEFS@
+iperf_LDFLAGS = @CFLAGS@ @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ @WEB100_CFLAGS@ @DEFS@
 
 iperf_SOURCES = \
 		Client.cpp \
diff -Nupr iperf-2.0.4.orig/src/Makefile.in iperf-2.0.4/src/Makefile.in
--- iperf-2.0.4.orig/src/Makefile.in	2008-04-08 12:38:40.000000000 +0900
+++ iperf-2.0.4/src/Makefile.in	2008-07-17 11:37:07.050459801 +0900
@@ -192,7 +192,7 @@ AM_CPPFLAGS = @STRIP_BEGIN@ \
 
 AM_CXXFLAGS = -Wall
 AM_CFLAGS = -Wall
-iperf_LDFLAGS = @CFLAGS@ @PTHREAD_CFLAGS@ @WEB100_CFLAGS@ @DEFS@
+iperf_LDFLAGS = @CFLAGS@ @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ @WEB100_CFLAGS@ @DEFS@
 iperf_SOURCES = \
 		Client.cpp \
 		Extractor.c \
diff -Nupr iperf-2.0.4.orig/src/main.cpp iperf-2.0.4/src/main.cpp
--- iperf-2.0.4.orig/src/main.cpp	2008-04-08 11:37:54.000000000 +0900
+++ iperf-2.0.4/src/main.cpp	2008-07-17 11:36:53.250488003 +0900
@@ -146,7 +146,7 @@ int main( int argc, char **argv ) {
     Mutex_Initialize( &clients_mutex );
 
     // Initialize the thread subsystem
-    thread_init( );
+    thread_initialize( );
 
     // Initialize the interrupt handling thread to 0
     sThread = thread_zeroid();
