Wednesday, August 8, 2012

hping3 error "-DBYTE_ORDER_(BIG|LITTLE)_ENDIAN""


If you are getting error below during ./configure of hping3

OS:

[root@localhost hping3-20051105]# uname -a
Linux localhost.localdomain 2.6.32-279.2.1.el6.x86_64 #1 SMP Fri Jul 20 01:55:29 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost hping3-20051105]# cat /etc/redhat-release
CentOS release 6.3 (Final)

Symptom:


[root@localhost hping3-20051105]#./configure
bytesex.h:22:3: error: #error can not find the byte order for this architecture, fix bytesex.h

In file included from rapd.c:11:
ars.h:190:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"
ars.h:254:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"
ars.h:323:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"
In file included from ars.h:20,
                 from split.c:11:
bytesex.h:22:3: error: #error can not find the byte order for this architecture, fix bytesex.h
In file included from split.c:11:
ars.h:190:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"
ars.h:254:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"
ars.h:323:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"
now you can try `make'

To resolve:
Since this was a x86_64 architecture, and it was not in the bytesex.h you just need to add in a line as below  and ./configure again.

[root@localhost hping3-20051105]# cat bytesex.h
/* Original code from the Linux C library */
/* Copyright (C) 2000,2001 Salvatore Sanfilippo
 * This code is under the original GNU C library license (GPL) */

/* $Id: bytesex.h,v 1.1.1.1 2003/08/31 17:23:48 antirez Exp $ */

#ifndef ARS_BYTESEX_H
#define ARS_BYTESEX_H

#if     defined(__i386__) \
        || defined(__alpha__) \
        || defined(__x86_64__) \
        || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__)))
#define BYTE_ORDER_LITTLE_ENDIAN
#elif   defined(__mc68000__) \
        || defined (__sparc__) \
        || defined (__sparc) \
        || defined (__PPC__) \
        || defined (__BIG_ENDIAN__) \
        || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__)))
#define BYTE_ORDER_BIG_ENDIAN
#else
# error can not find the byte order for this architecture, fix bytesex.h
#endif

#endif /* ARS_BYTESEX_H */


Post a Comment
There was an error in this gadget