This patch: http://sourceware.org/ml/binutils/2008-01/msg00195.html breaks 32bit mingw host for 64bit target. It has #elif BFD_HOST_64BIT_LONG_LONG +#ifndef _WIN32 #define sprintf_vma(s,x) sprintf (s, "%016llx", x) #define fprintf_vma(f,x) fprintf (f, "%016llx", x) #else +#define sprintf_vma(s,x) sprintf (s, "%016I64x", x) +#define fprintf_vma(f,x) fprintf (f, "%016I64x", x) +#endif You can't use BFD_HOST_64BIT_LONG_LONG to check for win32 vs. win64.
Created attachment 2228 [details] A patch My gcc 4.1 cross compiler for 32bit mingw doesn't understand %I64. This patch allows me to build binutils hosted on 32bit mingw for 64bit target. If %ll was never supported on 32bit mingw, mingw should use things like #define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff))) #define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff)) #define fprintf_vma(s,x) \ fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x)) #define sprintf_vma(s,x) \ sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x)) to print out 64bit value.
Fixed by http://sourceware.org/ml/binutils/2008-02/msg00037.html