This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix gdb build on Solaris 8/SPARC


I just noticed that current gdb trunk doesn't build on Solaris 8/SPARC
(haven't tried any other Solaris version yet).  The failure is in
compiling gdb/coff-pe-read.c:

In file included from /usr/include/fcntl.h:24,
                 from /vol/src/gnu/gdb/gdb-git/gdb/defs.h:60,
                 from /vol/src/gnu/gdb/gdb-git/gdb/coff-pe-read.c:29:
/usr/include/sys/fcntl.h:181: error: expected specifier-qualifier-list before 'off32_t'
/usr/include/sys/fcntl.h:214: error: expected specifier-qualifier-list before 'pid32_t'
/usr/include/sys/fcntl.h:226: error: expected specifier-qualifier-list before 'pid32_t'
[many more]
make[2]: *** [coff-pe-read.o] Error 1

I could trace this down to _SYSCALL32 being defined *after*
<sys/types.h> is included, so <sys/types32.h>, which has the definition
of off32_t etc., is missed.

The following trivial patch fixes this (and from my understanding defs.h
should always be included first or almost first anyway), and allows the
build to complete.

Ok to install?

	Rainer


2011-11-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* coff-pe-read.c: Include defs.h before bfd.h.

diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
index ca87b72..5266e97 100644
--- a/gdb/coff-pe-read.c
+++ b/gdb/coff-pe-read.c
@@ -24,9 +24,8 @@
 
 #include "coff-pe-read.h"
 
-#include "bfd.h"
-
 #include "defs.h"
+#include "bfd.h"
 #include "gdbtypes.h"
 
 #include "symtab.h"

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]