1 From 445aaaeae1153efcfc94b2b0944c4b0c0e2be0e8 Mon Sep 17 00:00:00 2001 2 From: David 'Digit' Turner <digit (a] google.com> 3 Date: Thu, 10 May 2012 17:14:12 +0200 4 Subject: Fix win32 build. 5 6 This fixes the binutils build with the x86_64-w64-mingw32 toolchain. 7 The reason for this is that this toolchain's <sys/stat.h> redefines 8 'stat' through a macro, as with: 9 10 #define stat _stat64 11 12 Because bucomm.h didn't include <sys/stat.h>, the signature of 13 the functions that use 'struct stat' didn't match the one in the 14 implementation (which internally used 'struct _stat64'), resulting 15 in a build error. 16 17 Change-Id: I32de64af6c5f3e70344fa7c22b40d9a83695c7df 18 --- 19 binutils-2.19/binutils/bucomm.h | 2 ++ 20 binutils-2.21/binutils/bucomm.h | 2 ++ 21 2 files changed, 4 insertions(+), 0 deletions(-) 22 23 diff --git a/binutils-2.19/binutils/bucomm.h b/binutils-2.19/binutils/bucomm.h 24 index 08c166b..dd1d2e8 100644 25 --- a/binutils-2.19/binutils/bucomm.h 26 +++ b/binutils-2.19/binutils/bucomm.h 27 @@ -22,6 +22,8 @@ 28 #ifndef _BUCOMM_H 29 #define _BUCOMM_H 30 31 +#include <sys/stat.h> 32 + 33 /* Return the filename in a static buffer. */ 34 const char *bfd_get_archive_filename (bfd *); 35 36 diff --git a/binutils-2.21/binutils/bucomm.h b/binutils-2.21/binutils/bucomm.h 37 index fcbc32b..8124bd0 100644 38 --- a/binutils-2.21/binutils/bucomm.h 39 +++ b/binutils-2.21/binutils/bucomm.h 40 @@ -23,6 +23,8 @@ 41 #ifndef _BUCOMM_H 42 #define _BUCOMM_H 43 44 +#include <sys/stat.h> 45 + 46 /* Return the filename in a static buffer. */ 47 const char *bfd_get_archive_filename (const bfd *); 48 49 -- 50 1.7.6.rc0 51 52