Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 275885 - net-libs/libnet-1.0.2-r3 breaks for ARM due to missing -DLIBNET_LIL_ENDIAN
Summary: net-libs/libnet-1.0.2-r3 breaks for ARM due to missing -DLIBNET_LIL_ENDIAN
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: ARM Linux
: High normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2009-06-29 22:41 UTC by Christopher Friedt
Modified: 2012-11-22 14:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
libnet-1.0.2a-fix-endianness.patch (libnet-1.0.2a-fix-endianness.patch,896 bytes, patch)
2009-06-29 22:42 UTC, Christopher Friedt
Details | Diff
patch for libnet.h (1.0.2a-endianness.patch,494 bytes, patch)
2010-11-21 15:20 UTC, Christopher Friedt
Details | Diff
patch for ebuild (ebuild.patch,432 bytes, patch)
2010-11-21 15:20 UTC, Christopher Friedt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Friedt 2009-06-29 22:41:12 UTC
include/libnet.h requires either LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN to be defined at make time. The r3 ebuild was modified to do this automatically using
toolchain-funcs.eclass and flag-o-matic.eclass .

I know this library is deprecated, but please consider bumping the revision just for the convenience of people like me, who are stuck using old versions :P

Please see the attached patch against the ebuild.

Reproducible: Always

Steps to Reproduce:
1.build (cross-compile?) libnet-1.0.2a-r3 for ARM
2.
3.

Actual Results:  
emake fails

include/libnet.h issues a preproccessor error stating that either LIBNET_LIL_ENDIAN or LIBNET_BIG_ENDIAN must be defined.

Expected Results:  
build w/o problems

used simple existing 'tc-endian' function in toolchain-funcs.eclass
Comment 1 Christopher Friedt 2009-06-29 22:42:50 UTC
Created attachment 196124 [details, diff]
libnet-1.0.2a-fix-endianness.patch

patch against libnet-1.0.2a-r3.ebuild - simple fix - I suggest bumping the revision
Comment 2 Peter Volkov (RETIRED) gentoo-dev 2009-07-09 15:26:28 UTC
Why do you use old library net-libs/libnet-1.0.2-r3 instead of newer libnet-1.1.2.1-r1.ebuild which does this detection at configure time? I was going to drop libnet-1.0.2a-r3.ebuild from the tree...
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2009-10-20 19:12:57 UTC
(In reply to comment #2)
> Why do you use old library net-libs/libnet-1.0.2-r3 instead of newer
> libnet-1.1.2.1-r1.ebuild which does this detection at configure time? I was
> going to drop libnet-1.0.2a-r3.ebuild from the tree...

net-analyzer/snort depends on it.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2009-10-20 19:18:38 UTC
arm@ can review the patch. It could (should) be shortened somewhat to perhaps:

if
 [ "$(tc-endian)x" = "${little}x" ]; then
   append-flags "-DLIBNET_LIL_ENDIAN"
else
   append-flags "-DLIBNET_BIG_ENDIAN"
fi
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2009-10-20 19:56:44 UTC
Oh and I think this was the intention. Sorry for the bug spam.
Comment 6 Raúl Porcel (RETIRED) gentoo-dev 2009-12-10 17:57:11 UTC
(In reply to comment #4)
> arm@ can review the patch. It could (should) be shortened somewhat to perhaps:
> 
> if
>  [ "$(tc-endian)x" = "${little}x" ]; then
>    append-flags "-DLIBNET_LIL_ENDIAN"
> else
>    append-flags "-DLIBNET_BIG_ENDIAN"
> fi
> 

Looks okay to me

Comment 7 Peter Volkov (RETIRED) gentoo-dev 2009-12-22 14:17:22 UTC
This should be fixed in libnet-1.1.4. Arm, please, retest.
Comment 8 Peter Volkov (RETIRED) gentoo-dev 2009-12-22 14:19:53 UTC
And I just missed, that it is keyworded on arm. So nothing should be done here.
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2009-12-22 16:11:52 UTC
net-libs/libnet-1.0* is still in the tree because many packages will not work with net-libs/libnet-1.1*, so reopening.
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2009-12-22 16:12:46 UTC
(In reply to comment #6)
> (In reply to comment #4)
> > arm@ can review the patch. It could (should) be shortened somewhat to perhaps:
> > 
> > if
> >  [ "$(tc-endian)x" = "${little}x" ]; then
> >    append-flags "-DLIBNET_LIL_ENDIAN"
> > else
> >    append-flags "-DLIBNET_BIG_ENDIAN"
> > fi
> > 
> 
> Looks okay to me

Great, could you then apply that and keyword for arm, please?
Comment 11 Raúl Porcel (RETIRED) gentoo-dev 2010-04-25 18:43:32 UTC
Christopher, is this really needed? I can compile it without issues natively...
Comment 12 Christopher Friedt 2010-04-26 07:34:45 UTC
(In reply to comment #11)
> Christopher, is this really needed? I can compile it without issues natively...
> 

My target was an ep93xx system with very very few resources in terms of memory, so in that sense, I would must rather cross-compile most packages for this system. Compiling natively is occasionally not really a valid option. 
Comment 13 solar (RETIRED) gentoo-dev 2010-05-03 21:19:18 UTC
Personally I'd rather see the logic in the source code vs the ebuild.
This helps if you have to cd into the dir and do anything manually.

#include <endian.h>

#if __BYTE_ORDER == __LITTLE_ENDIAN
 #define LIBNET_LIL_ENDIAN 1
#endif

#if __BYTE_ORDER == __BIG_ENDIAN
 #define LIBNET_BIG_ENDIAN 1
#endif
Comment 14 Christopher Friedt 2010-05-04 07:09:49 UTC
Good call... 

+1 for this. 

(In reply to comment #13)
> Personally I'd rather see the logic in the source code vs the ebuild.
> This helps if you have to cd into the dir and do anything manually.
> 
> #include <endian.h>
> 
> #if __BYTE_ORDER == __LITTLE_ENDIAN
>  #define LIBNET_LIL_ENDIAN 1
> #endif
> 
> #if __BYTE_ORDER == __BIG_ENDIAN
>  #define LIBNET_BIG_ENDIAN 1
> #endif
> 
Comment 15 Raúl Porcel (RETIRED) gentoo-dev 2010-11-21 11:41:32 UTC
Could a patch be prepared for this, please?
Comment 16 Christopher Friedt 2010-11-21 15:20:10 UTC
Created attachment 255019 [details, diff]
patch for libnet.h
Comment 17 Christopher Friedt 2010-11-21 15:20:33 UTC
Created attachment 255021 [details, diff]
patch for ebuild
Comment 18 Jeroen Roovers (RETIRED) gentoo-dev 2012-04-28 16:59:23 UTC
Applied in -r4. Thanks for reporting and for the patch.