Bug 2737

Summary: windres depends on host's endianness and bitness
Product: binutils Reporter: Sir Raorn <raorn>
Component: binutilsAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: bug-binutils, hjl.tools, sherpya
Priority: P2    
Version: 2.18   
Target Milestone: ---   
Host: x86_64-alt-linux Target: i386-mingw32msvc
Build: Last reconfirmed:

Description Sir Raorn 2006-06-09 07:37:58 UTC
windres uses unsigned long for fwrite'ing 32-bit little-endian integers (DWORD).
 This breaks cross tools on 64-bit and/or bigendian hosts.

When writing res file, resource header (write_res_header() from resres.c) is two
64-bit integers instead of 32 bit.

There's also FIXME in code about that issue (resres.c):

/* FIXME: This file does not work correctly in a cross configuration.
   It assumes that it can use fread and fwrite to read and write
   integers.  It does no swapping.  */
Comment 1 H.J. Lu 2007-03-11 16:37:43 UTC
*** Bug 3961 has been marked as a duplicate of this bug. ***
Comment 2 H.J. Lu 2007-04-24 14:51:03 UTC
*** Bug 4412 has been marked as a duplicate of this bug. ***
Comment 3 H.J. Lu 2007-06-18 19:02:37 UTC
Fixed by

http://sourceware.org/ml/binutils/2007-05/msg00315.html