BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000760 [BusyBox] Other minor always 02-28-06 13:51 02-12-08 02:40
Reporter rfelker View Status public  
Assigned To BusyBox
Priority normal Resolution no change required  
Status closed   Product Version svn
Summary 0000760: [PORTABILITY] endian.h stuff [PATCH]
Description The attached patch replaces the preprocessor checks for endianness using endian.h with a fully portable check that should work on any usable version of gcc or any C99-compliant compiler. As long as optimization is enabled gcc eliminates the dead code. The way I've done this seems to match the desired direction of config options in BusyBox (from preprocessor hacks towards C conditionals with dead-code elimination).
Additional Information This patch is a big step in bringing BusyBox closer to compiling out of the box on my C library implementation and on non-Linux systems. A few old-style endian checks are still left behind where I didn't feel comfortable modifying the code. Hopefully I didn't mess anything up.
Attached Files  endian.diff [^] (9,766 bytes) 02-28-06 13:51

- Relationships

- Notes
(0001151)
vodz
02-28-06 21:44

Hmm. You removed #include <endian.h>. But use #if __BYTE_ORDER == __BIG_ENDIAN too. Its strange for me.

strndup->bb_strndup for get_header_tar.c applied.
 
(0001153)
rfelker
03-01-06 06:07

No, reread the patch. It removes all references to __BYTE_ORDER and __BIG_ENDIAN in these files. That is the whole point, to get rid of endian.h which is a GNU-specific interface.

Most programs that need to know test endianness at build time using a configure script, but since BusyBox does not take this approach, the C99/gcc way works. And as I said it seems to conform to the BusyBox design direction of replacing #if with if.
 
(0001394)
bernhardf
06-02-06 08:28

dalias,

IIRC some parts of the endian stuff were already touched.
Can i consider this done or are there outstanding snippets which are needed?

thanks,
 
(0004204)
vda
02-12-08 02:40

Seems to be resolved? Anyway, it's not a real bug, as in "wrong behavior at runtime"
 

- Issue History
Date Modified Username Field Change
02-28-06 13:51 rfelker New Issue
02-28-06 13:51 rfelker Status new => assigned
02-28-06 13:51 rfelker Assigned To  => BusyBox
02-28-06 13:51 rfelker File Added: endian.diff
02-28-06 21:44 vodz Note Added: 0001151
03-01-06 06:07 rfelker Note Added: 0001153
06-02-06 08:28 bernhardf Note Added: 0001394
02-12-08 02:40 vda Status assigned => closed
02-12-08 02:40 vda Note Added: 0004204
02-12-08 02:40 vda Resolution open => no change required


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker