[netperf-talk] Errors compiling netperf on Opteron running Fedora-9
Rick Jones
rick.jones2 at hp.com
Mon Sep 8 17:51:57 PDT 2008
Rahul Nabar wrote:
> On Mon, Sep 8, 2008 at 7:31 PM, Rick Jones <rick.jones2 at hp.com> wrote:
>
>>sigh, whack-a-mole
>>
>>there are some typdefs in src/netdrv_ethtool.c which probably need some
>>#ifndef/#endif around them. At least I _think_ I can get away with that -
>>can you try the following:
>
>
> Thanks Rick. So in the file /src/netdrv_ethtool.c I added the two pair
> of ifndef-endif statements around the blocks that your diff showed.
> That's what you meant, right?
>
> Now the block looks like shown at the very bottom of the email. But a
> new error now.
same error, new line number. perhaps I cannot use ifndef afterall?
(just to be sure, if you added that by hand you did do two underscores
right?
#ifndef __u64
Hmm... the mind's gears turn slowly...
Which distro are you using? I realised that my #ifndef stuff is botched
because of course there is no __u64 at that point in the source -
sys/types.h has not included linux/types.h and so there is no __u64, and
while linux/ethtool.h in previous distros didn't include
linux/types.h, (which I guess is where __u64 originates - didn't knwo
that when I did the typdef blocks) now it does.
So, how about trying this diff against the original top of trunk bits.
It will have an include of linux/types.h before the #ifndef test:
raj at tardy:~/netperf2_trunk$ svn diff src/netdrv_ethtool.c
Index: src/netdrv_ethtool.c
===================================================================
--- src/netdrv_ethtool.c (revision 288)
+++ src/netdrv_ethtool.c (working copy)
@@ -9,22 +9,27 @@
#include <string.h>
#include <errno.h>
#include <net/if.h>
+#include <linux/types.h>
#include <linux/sockios.h>
/* alas, direct inclusion of ethtool.h depends on some types not
normally found in nature, which we must provide or things will be
quite unhappy. */
+#ifndef __u64
typedef __uint64_t __u64;
typedef __uint32_t __u32;
typedef __uint16_t __u16;
typedef __uint8_t __u8;
+#endif
/* older ones want them without the leading underscores */
+#ifndef u64
typedef __uint64_t u64;
typedef __uint32_t u32;
typedef __uint16_t u16;
typedef __uint8_t u8;
+#endif
#include <linux/ethtool.h>
I'd pull the typedef blocks, but am to chicken to do so at present :)
rick jones
> ************************************************************************
> In file included from /usr/include/linux/types.h:6,
> from /usr/include/linux/ethtool.h:15,
> from netdrv_ethtool.c:33:
> /usr/include/asm/types.h:29: error: conflicting types for '__u64'
> netdrv_ethtool.c:19: error: previous declaration of '__u64' was here
> make[3]: *** [netdrv_ethtool.o] Error 1
> make[3]: Leaving directory `/usr/local/src/netperf-2.4.4/src'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/usr/local/src/netperf-2.4.4/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/local/src/netperf-2.4.4'
> make: *** [all] Error 2
> ***********************************************************************
>
> Sugestions, again? Apologies for bothering you yet again!
>
More information about the netperf-talk
mailing list