Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Patches to build on DJGPP
@ 2008-08-09 21:42 Pedro Alves
  2008-08-10  0:10 ` Daniel Jacobowitz
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Pedro Alves @ 2008-08-09 21:42 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1714 bytes --]

Here are the left over patches I used to build GDB on DJGPP.

GDB changes:

- "missing sentinel in function calls" warnings:

  NULL is not a pointer in djgpp, it's #define NULL 0.  Recent gcc's
  bark on cases like the concat calls I'm fixing, if the last argument
  is not a pointer.

- cp-name-parse.y

  There's a call to snprintf in it.  DJGPP gets it from libiberty.

  I needed to include config.h, so HAVE_DECL_SNPRINTF is defined when
  libiberty.h is included, which then declares snprintf.

- gdb_select.h

  Include sys/types.h to pick up fd_set.

  Include <time.h> in posix-hdep.c, because that's where select is
  declared.  (?)

The readline bits, the patch explains what's needed.

Here's the error log
gcc -DHAVE_CONFIG_H    -I. -I../../readline -DRL_LIBRARY_VERSION='"5.1"' -O0 -g3
 -c ../../readline/support/wcwidth.c
In file included from ../../readline/support/wcwidth.c:9:
c:/djgpp/include/wchar.h:24: error: expected '=', ',', ';', 'asm' 
or '__attribut
e__' before 'typedef'
../../readline/support/wcwidth.c: In function 'wcwidth':
../../readline/support/wcwidth.c:130: warning: comparison is always false due 
to
 limited range of data type
../../readline/support/wcwidth.c:130: warning: comparison is always true due 
to
limited range of data type
make.exe: *** [wcwidth.o] Error 1

- libbfd 

 cc1.exe: warnings being treated as errors
 ../../bfd/archive.c: In function '_bfd_archive_bsd_update_armap_timestamp':
 ../../bfd/archive.c:2314: warning: comparison between signed and unsigned

 time_t in djgpp is unsigned int, armap_timestamp is long.
 There's a comment at the definition of armap_timestamp, claiming that it
 isn't time_t until more compilers support it.

-- 
Pedro Alves

[-- Attachment #2: go32_fixes.diff --]
[-- Type: text/x-diff, Size: 5060 bytes --]

gdb/
2008-08-09  Pedro Alves  <pedro@codesourcery.com>

	* buildsym.c (start_subfile): Cast sentinel NULL to void*.
	* cp-name-parser.y: Include "config.h".
	* posix-hdep.c [__GO32__]: Include time.h.
	* xml-tdesc.c (fetch_xml_from_file): Cast sentinel NULL to void*.
	* gdb_select.h: Include sys/types.h if available.

readline/
2008-08-09  Pedro Alves  <pedro@codesourcery.com>

	* signals.c (rl_set_sighandler): Guard access to SIGWINCH.
	* wcwidth.c [__GO32__]: Include wctype.h before wchar.h.

bfd/
2008-08-09  Pedro Alves  <pedro@codesourcery.com>

	* archive.c (_bfd_archive_bsd_update_armap_timestamp): Cast stat
	st_mtime to long before comparison.

---
 bfd/archive.c              |    2 +-
 gdb/buildsym.c             |    2 +-
 gdb/cp-name-parser.y       |    1 +
 gdb/gdb_select.h           |    4 ++++
 gdb/posix-hdep.c           |    6 ++++++
 gdb/xml-tdesc.c            |    2 +-
 readline/signals.c         |    4 ++++
 readline/support/wcwidth.c |    5 +++++
 8 files changed, 23 insertions(+), 3 deletions(-)

Index: src/gdb/buildsym.c
===================================================================
--- src.orig/gdb/buildsym.c	2008-08-09 20:55:28.000000000 +0100
+++ src/gdb/buildsym.c	2008-08-09 22:27:04.000000000 +0100
@@ -547,7 +547,7 @@ start_subfile (char *name, char *dirname
 	  && !IS_ABSOLUTE_PATH (subfile->name)
 	  && subfile->dirname != NULL)
 	subfile_name = concat (subfile->dirname, SLASH_STRING,
-			       subfile->name, NULL);
+			       subfile->name, (void*) NULL);
       else
 	subfile_name = subfile->name;
 
Index: src/gdb/cp-name-parser.y
===================================================================
--- src.orig/gdb/cp-name-parser.y	2008-08-09 20:55:32.000000000 +0100
+++ src/gdb/cp-name-parser.y	2008-08-09 22:27:04.000000000 +0100
@@ -36,6 +36,7 @@ Boston, MA 02110-1301, USA.  */
 #include <unistd.h>
 #include <string.h>
 
+#include "config.h"
 #include "safe-ctype.h"
 #include "libiberty.h"
 #include "demangle.h"
Index: src/gdb/posix-hdep.c
===================================================================
--- src.orig/gdb/posix-hdep.c	2008-08-09 20:55:39.000000000 +0100
+++ src/gdb/posix-hdep.c	2008-08-09 22:27:04.000000000 +0100
@@ -24,6 +24,12 @@
 
 #include "gdb_select.h"
 
+#ifdef __GO32__
+/* DJGPP defines the fd_set type in sys/types.h, but `select' goes
+   here. */
+# include <time.h>
+#endif
+
 /* The strerror() function can return NULL for errno values that are
    out of range.  Provide a "safe" version that always returns a
    printable string. */
Index: src/gdb/xml-tdesc.c
===================================================================
--- src.orig/gdb/xml-tdesc.c	2008-08-09 20:55:45.000000000 +0100
+++ src/gdb/xml-tdesc.c	2008-08-09 22:27:04.000000000 +0100
@@ -443,7 +443,7 @@ fetch_xml_from_file (const char *filenam
 
   if (dirname && *dirname)
     {
-      char *fullname = concat (dirname, "/", filename, NULL);
+      char *fullname = concat (dirname, "/", filename, (void*) NULL);
       if (fullname == NULL)
 	nomem (0);
       file = fopen (fullname, FOPEN_RT);
Index: src/gdb/gdb_select.h
===================================================================
--- src.orig/gdb/gdb_select.h	2008-08-09 20:55:36.000000000 +0100
+++ src/gdb/gdb_select.h	2008-08-09 22:27:04.000000000 +0100
@@ -24,6 +24,10 @@
 #include <sys/select.h>
 #endif
 
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
 #ifdef USE_WIN32API
 #include <winsock2.h>
 #endif
Index: src/readline/signals.c
===================================================================
--- src.orig/readline/signals.c	2008-08-09 20:55:52.000000000 +0100
+++ src/readline/signals.c	2008-08-09 22:27:04.000000000 +0100
@@ -251,7 +251,11 @@ rl_set_sighandler (sig, handler, ohandle
   struct sigaction act;
 
   act.sa_handler = handler;
+#if defined (SIGWINCH)
   act.sa_flags = (sig == SIGWINCH) ? SA_RESTART : 0;
+#else
+  act.sa_flags = 0;
+#endif
   sigemptyset (&act.sa_mask);
   sigemptyset (&ohandler->sa_mask);
   sigaction (sig, &act, &old_handler);
Index: src/readline/support/wcwidth.c
===================================================================
--- src.orig/readline/support/wcwidth.c	2008-08-09 20:55:59.000000000 +0100
+++ src/readline/support/wcwidth.c	2008-08-09 22:27:04.000000000 +0100
@@ -6,6 +6,11 @@
  * Markus Kuhn -- 2001-09-08 -- public domain
  */
 
+#ifdef __GO32__
+/* DJGPP needs to include this before including wchar.h.  */
+# include <wctype.h>
+#endif
+
 #include <wchar.h>
 
 struct interval {
Index: src/bfd/archive.c
===================================================================
--- src.orig/bfd/archive.c	2008-08-09 20:56:09.000000000 +0100
+++ src/bfd/archive.c	2008-08-09 22:27:04.000000000 +0100
@@ -2311,7 +2311,7 @@ _bfd_archive_bsd_update_armap_timestamp 
       /* Can't read mod time for some reason.  */
       return TRUE;
     }
-  if (archstat.st_mtime <= bfd_ardata (arch)->armap_timestamp)
+  if (((long) archstat.st_mtime) <= bfd_ardata (arch)->armap_timestamp)
     /* OK by the linker's rules.  */
     return TRUE;
 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-09 21:42 Patches to build on DJGPP Pedro Alves
@ 2008-08-10  0:10 ` Daniel Jacobowitz
  2008-08-10  3:19   ` Eli Zaretskii
  2008-08-10 20:47   ` Pedro Alves
  2008-08-10  3:20 ` Eli Zaretskii
  2008-08-10 15:39 ` Mark Kettenis
  2 siblings, 2 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2008-08-10  0:10 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Sat, Aug 09, 2008 at 10:41:46PM +0100, Pedro Alves wrote:
> - "missing sentinel in function calls" warnings:
> 
>   NULL is not a pointer in djgpp, it's #define NULL 0.  Recent gcc's
>   bark on cases like the concat calls I'm fixing, if the last argument
>   is not a pointer.

IIRC OpenBSD detects this error too, so I'm not sure why this didn't
come up before.

> - cp-name-parse.y
> 
>   There's a call to snprintf in it.  DJGPP gets it from libiberty.
> 
>   I needed to include config.h, so HAVE_DECL_SNPRINTF is defined when
>   libiberty.h is included, which then declares snprintf.
> 
> - gdb_select.h
> 
>   Include sys/types.h to pick up fd_set.
> 
>   Include <time.h> in posix-hdep.c, because that's where select is
>   declared.  (?)

From my select man page:

       /* According to POSIX.1-2001 */
       #include <sys/select.h>

       /* According to earlier standards */
       #include <sys/time.h>

I'm guessing the time.h - sys/time.h difference is irrelevant, one
probably includes the other.

> gdb/
> 2008-08-09  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* buildsym.c (start_subfile): Cast sentinel NULL to void*.
> 	* cp-name-parser.y: Include "config.h".
> 	* posix-hdep.c [__GO32__]: Include time.h.
> 	* xml-tdesc.c (fetch_xml_from_file): Cast sentinel NULL to void*.
> 	* gdb_select.h: Include sys/types.h if available.
> 
> readline/
> 2008-08-09  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* signals.c (rl_set_sighandler): Guard access to SIGWINCH.
> 	* wcwidth.c [__GO32__]: Include wctype.h before wchar.h.
> 
> bfd/
> 2008-08-09  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* archive.c (_bfd_archive_bsd_update_armap_timestamp): Cast stat
> 	st_mtime to long before comparison.

These are all OK.  Could you do three additional things, please?

- You had nice instructions on how to set up DJGPP in your last
message.  Since you've already got them written down, could you put
them on the wiki?  I'm sure someone else will want to do this.

- The readline patches are OK for our import, but if they apply to a
clean upstream tarball of readline, please mail them to bug-bash.

- And last, let the binutils list know I approved the patch to BFD.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-10  0:10 ` Daniel Jacobowitz
@ 2008-08-10  3:19   ` Eli Zaretskii
  2008-08-10 20:47   ` Pedro Alves
  1 sibling, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2008-08-10  3:19 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: pedro, gdb-patches

> Date: Sat, 9 Aug 2008 20:09:20 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: gdb-patches@sourceware.org
> 
> On Sat, Aug 09, 2008 at 10:41:46PM +0100, Pedro Alves wrote:
> > - "missing sentinel in function calls" warnings:
> > 
> >   NULL is not a pointer in djgpp, it's #define NULL 0.  Recent gcc's
> >   bark on cases like the concat calls I'm fixing, if the last argument
> >   is not a pointer.
> 
> IIRC OpenBSD detects this error too, so I'm not sure why this didn't
> come up before.

IIRC, this problem is an ancient dispute we had with GCC folks.

> >   Include <time.h> in posix-hdep.c, because that's where select is
> >   declared.  (?)
> 
> >From my select man page:
> 
>        /* According to POSIX.1-2001 */
>        #include <sys/select.h>
> 
>        /* According to earlier standards */
>        #include <sys/time.h>
> 
> I'm guessing the time.h - sys/time.h difference is irrelevant, one
> probably includes the other.

In DJGPP, sys/time.h includes time.h, and select is declared in
time.h.  I'm fine with including sys/time.h.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-09 21:42 Patches to build on DJGPP Pedro Alves
  2008-08-10  0:10 ` Daniel Jacobowitz
@ 2008-08-10  3:20 ` Eli Zaretskii
  2008-08-10  8:33   ` Mark Kettenis
  2008-08-10 15:39 ` Mark Kettenis
  2 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2008-08-10  3:20 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Sat, 9 Aug 2008 22:41:46 +0100
> 
> Here are the left over patches I used to build GDB on DJGPP.

They are fine with me, except that I'd prefer to include sys/time.h
for select.

Thanks.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-10  3:20 ` Eli Zaretskii
@ 2008-08-10  8:33   ` Mark Kettenis
  2008-08-10 19:38     ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Kettenis @ 2008-08-10  8:33 UTC (permalink / raw)
  To: eliz; +Cc: pedro, gdb-patches

> Date: Sun, 10 Aug 2008 06:19:55 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Sat, 9 Aug 2008 22:41:46 +0100
> > 
> > Here are the left over patches I used to build GDB on DJGPP.
> 
> They are fine with me, except that I'd prefer to include sys/time.h
> for select.

If so, can that include be moved to gdb_select.h?  It is a
prerequisite for using select(2) on many other systems.  I guess so
far we've just been lucky that it has been included on those system
through some other way.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-09 21:42 Patches to build on DJGPP Pedro Alves
  2008-08-10  0:10 ` Daniel Jacobowitz
  2008-08-10  3:20 ` Eli Zaretskii
@ 2008-08-10 15:39 ` Mark Kettenis
  2008-08-10 16:06   ` Daniel Jacobowitz
  2008-08-10 17:41   ` Pedro Alves
  2 siblings, 2 replies; 13+ messages in thread
From: Mark Kettenis @ 2008-08-10 15:39 UTC (permalink / raw)
  To: pedro; +Cc: gdb-patches

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Sat, 9 Aug 2008 22:41:46 +0100
> 
> gdb/
> 2008-08-09  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* buildsym.c (start_subfile): Cast sentinel NULL to void*.
> 	* cp-name-parser.y: Include "config.h".
> 	* posix-hdep.c [__GO32__]: Include time.h.
> 	* xml-tdesc.c (fetch_xml_from_file): Cast sentinel NULL to void*.
> 	* gdb_select.h: Include sys/types.h if available.
> 
> readline/
> 2008-08-09  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* signals.c (rl_set_sighandler): Guard access to SIGWINCH.
> 	* wcwidth.c [__GO32__]: Include wctype.h before wchar.h.
> 
> bfd/
> 2008-08-09  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* archive.c (_bfd_archive_bsd_update_armap_timestamp): Cast stat
> 	st_mtime to long before comparison.
> 
> Index: src/gdb/buildsym.c
> ===================================================================
> --- src.orig/gdb/buildsym.c	2008-08-09 20:55:28.000000000 +0100
> +++ src/gdb/buildsym.c	2008-08-09 22:27:04.000000000 +0100
> @@ -547,7 +547,7 @@ start_subfile (char *name, char *dirname
>  	  && !IS_ABSOLUTE_PATH (subfile->name)
>  	  && subfile->dirname != NULL)
>  	subfile_name = concat (subfile->dirname, SLASH_STRING,
> -			       subfile->name, NULL);
> +			       subfile->name, (void*) NULL);
>        else
>  	subfile_name = subfile->name;
>  

There's a space missing; should be (void *) instead of (void*).
However, I think one can argue that one should use (char *) here.
Same for xml-tdep.c further down.

> Index: src/gdb/cp-name-parser.y
> ===================================================================
> --- src.orig/gdb/cp-name-parser.y	2008-08-09 20:55:32.000000000 +0100
> +++ src/gdb/cp-name-parser.y	2008-08-09 22:27:04.000000000 +0100
> @@ -36,6 +36,7 @@ Boston, MA 02110-1301, USA.  */
>  #include <unistd.h>
>  #include <string.h>
>  
> +#include "config.h"
>  #include "safe-ctype.h"
>  #include "libiberty.h"
>  #include "demangle.h"

Hmm, is there a reason not to include "defs.h" here?

> Index: src/gdb/posix-hdep.c
> ===================================================================
> --- src.orig/gdb/posix-hdep.c	2008-08-09 20:55:39.000000000 +0100
> +++ src/gdb/posix-hdep.c	2008-08-09 22:27:04.000000000 +0100
> @@ -24,6 +24,12 @@
>  
>  #include "gdb_select.h"
>  
> +#ifdef __GO32__
> +/* DJGPP defines the fd_set type in sys/types.h, but `select' goes
> +   here. */
> +# include <time.h>
> +#endif
> +
>  /* The strerror() function can return NULL for errno values that are
>     out of range.  Provide a "safe" version that always returns a
>     printable string. */

Like I wrote in another reply, I think we should include <sys/time.h>
in gdb_select.h, instead of adding this #ifdef __GO32__ here.

> Index: src/gdb/xml-tdesc.c
> ===================================================================
> --- src.orig/gdb/xml-tdesc.c	2008-08-09 20:55:45.000000000 +0100
> +++ src/gdb/xml-tdesc.c	2008-08-09 22:27:04.000000000 +0100
> @@ -443,7 +443,7 @@ fetch_xml_from_file (const char *filenam
>  
>    if (dirname && *dirname)
>      {
> -      char *fullname = concat (dirname, "/", filename, NULL);
> +      char *fullname = concat (dirname, "/", filename, (void*) NULL);
>        if (fullname == NULL)
>  	nomem (0);
>        file = fopen (fullname, FOPEN_RT);


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-10 15:39 ` Mark Kettenis
@ 2008-08-10 16:06   ` Daniel Jacobowitz
  2008-08-10 17:41   ` Pedro Alves
  1 sibling, 0 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2008-08-10 16:06 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: pedro, gdb-patches

On Sun, Aug 10, 2008 at 05:36:39PM +0200, Mark Kettenis wrote:
> > Index: src/gdb/cp-name-parser.y
> > ===================================================================
> > --- src.orig/gdb/cp-name-parser.y	2008-08-09 20:55:32.000000000 +0100
> > +++ src/gdb/cp-name-parser.y	2008-08-09 22:27:04.000000000 +0100
> > @@ -36,6 +36,7 @@ Boston, MA 02110-1301, USA.  */
> >  #include <unistd.h>
> >  #include <string.h>
> >  
> > +#include "config.h"
> >  #include "safe-ctype.h"
> >  #include "libiberty.h"
> >  #include "demangle.h"
> 
> Hmm, is there a reason not to include "defs.h" here?

It's not a great reason, but yes, there is - this file is otherwise
independent of GDB, because you can link it into a stand-alone test
program.  I won't complain if someone adds defs.h, as long as
the test program still links.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-10 15:39 ` Mark Kettenis
  2008-08-10 16:06   ` Daniel Jacobowitz
@ 2008-08-10 17:41   ` Pedro Alves
  2008-08-10 17:49     ` Pedro Alves
  1 sibling, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2008-08-10 17:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Mark Kettenis

On Sunday 10 August 2008 16:36:39, Mark Kettenis wrote:
> >
> > Index: src/gdb/buildsym.c
> > ===================================================================
> > --- src.orig/gdb/buildsym.c	2008-08-09 20:55:28.000000000 +0100
> > +++ src/gdb/buildsym.c	2008-08-09 22:27:04.000000000 +0100
> > @@ -547,7 +547,7 @@ start_subfile (char *name, char *dirname
> >  	  && !IS_ABSOLUTE_PATH (subfile->name)
> >  	  && subfile->dirname != NULL)
> >  	subfile_name = concat (subfile->dirname, SLASH_STRING,
> > -			       subfile->name, NULL);
> > +			       subfile->name, (void*) NULL);
> >        else
> >  	subfile_name = subfile->name;
>
> There's a space missing; should be (void *) instead of (void*).
> However, I think one can argue that one should use (char *) here.
> Same for xml-tdep.c further down.

Thanks, I will change it.  I see you've indeed fixed similar cases
before for OpenBSD/gcc4.

>
> > Index: src/gdb/posix-hdep.c
> > ===================================================================
> > --- src.orig/gdb/posix-hdep.c	2008-08-09 20:55:39.000000000 +0100
> > +++ src/gdb/posix-hdep.c	2008-08-09 22:27:04.000000000 +0100
> > @@ -24,6 +24,12 @@
> >
> >  #include "gdb_select.h"
> >
> > +#ifdef __GO32__
> > +/* DJGPP defines the fd_set type in sys/types.h, but `select' goes
> > +   here. */
> > +# include <time.h>
> > +#endif
> > +
> >  /* The strerror() function can return NULL for errno values that are
> >     out of range.  Provide a "safe" version that always returns a
> >     printable string. */
>

> Like I wrote in another reply, I think we should include <sys/time.h>
> in gdb_select.h, instead of adding this #ifdef __GO32__ here.

I just checked that this in gdb_select.h, and dropping the include <time.h>
in posix-hdep.c buils fine in DJGPP.

--- src.orig/gdb/gdb_select.h
+++ src/gdb/gdb_select.h
@@ -22,10 +22,8 @@
 
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#else
+#include <sys/time.h>
 #endif
 
We already include sys/time.h in common code without a HAVE_SYS... 
wrapper (event-loop.c), so I guess this is the best to do here?

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-10 17:41   ` Pedro Alves
@ 2008-08-10 17:49     ` Pedro Alves
  2008-08-10 18:29       ` Mark Kettenis
  0 siblings, 1 reply; 13+ messages in thread
From: Pedro Alves @ 2008-08-10 17:49 UTC (permalink / raw)
  To: gdb-patches; +Cc: Mark Kettenis

On Sunday 10 August 2008 18:40:25, Pedro Alves wrote:

> I just checked that this in gdb_select.h, and dropping the include <time.h>
> in posix-hdep.c buils fine in DJGPP.
>

> --- src.orig/gdb/gdb_select.h
> +++ src/gdb/gdb_select.h
> @@ -22,10 +22,8 @@
>
>  #ifdef HAVE_SYS_SELECT_H
>  #include <sys/select.h>
> -#endif
> -
> -#ifdef HAVE_SYS_TYPES_H
> -#include <sys/types.h>
> +#else
> +#include <sys/time.h>
>  #endif
>
> We already include sys/time.h in common code without a HAVE_SYS...
> wrapper (event-loop.c), so I guess this is the best to do here?

Sorry, that diff was confusing -- is was a diff against the previous
diff.

What I meant was simply:

--- src.orig/gdb/gdb_select.h   2008-08-10 18:47:57.000000000 +0100
+++ src/gdb/gdb_select.h        2008-08-10 18:48:08.000000000 +0100
@@ -22,6 +22,8 @@

 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
+#else
+#include <sys/time.h>
 #endif



-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-10 17:49     ` Pedro Alves
@ 2008-08-10 18:29       ` Mark Kettenis
  2008-08-10 18:44         ` Pedro Alves
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Kettenis @ 2008-08-10 18:29 UTC (permalink / raw)
  To: pedro; +Cc: gdb-patches

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Sun, 10 Aug 2008 18:48:48 +0100
> 
> On Sunday 10 August 2008 18:40:25, Pedro Alves wrote:
> 
> Sorry, that diff was confusing -- is was a diff against the previous
> diff.
> 
> What I meant was simply:
> 
> --- src.orig/gdb/gdb_select.h   2008-08-10 18:47:57.000000000 +0100
> +++ src/gdb/gdb_select.h        2008-08-10 18:48:08.000000000 +0100
> @@ -22,6 +22,8 @@
> 
>  #ifdef HAVE_SYS_SELECT_H
>  #include <sys/select.h>
> +#else
> +#include <sys/time.h>
>  #endif

Ah, that's much less confusing.  Yes this looks fine to me.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-10 18:29       ` Mark Kettenis
@ 2008-08-10 18:44         ` Pedro Alves
  0 siblings, 0 replies; 13+ messages in thread
From: Pedro Alves @ 2008-08-10 18:44 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 57 bytes --]

I've checked in the gdb bits, as below.

-- 
Pedro Alves

[-- Attachment #2: go32_fixes_gdb.diff --]
[-- Type: text/x-diff, Size: 2339 bytes --]

2008-08-09  Pedro Alves  <pedro@codesourcery.com>

	* buildsym.c (start_subfile): Properly cast sentinel in concat
	call.
	* cp-name-parser.y: Include "config.h".
	* xml-tdesc.c (fetch_xml_from_file): Properly cast sentinel in
	concat call.
	* gdb_select.h: Include sys/time.h if sys/select.h is not
	available.

---
 gdb/buildsym.c       |    2 +-
 gdb/cp-name-parser.y |    1 +
 gdb/gdb_select.h     |    2 ++
 gdb/xml-tdesc.c      |    2 +-
 4 files changed, 5 insertions(+), 2 deletions(-)

Index: src/gdb/buildsym.c
===================================================================
--- src.orig/gdb/buildsym.c	2008-08-10 19:36:43.000000000 +0100
+++ src/gdb/buildsym.c	2008-08-10 19:37:09.000000000 +0100
@@ -547,7 +547,7 @@ start_subfile (char *name, char *dirname
 	  && !IS_ABSOLUTE_PATH (subfile->name)
 	  && subfile->dirname != NULL)
 	subfile_name = concat (subfile->dirname, SLASH_STRING,
-			       subfile->name, NULL);
+			       subfile->name, (char *) NULL);
       else
 	subfile_name = subfile->name;
 
Index: src/gdb/cp-name-parser.y
===================================================================
--- src.orig/gdb/cp-name-parser.y	2008-08-10 19:36:43.000000000 +0100
+++ src/gdb/cp-name-parser.y	2008-08-10 19:37:09.000000000 +0100
@@ -36,6 +36,7 @@ Boston, MA 02110-1301, USA.  */
 #include <unistd.h>
 #include <string.h>
 
+#include "config.h"
 #include "safe-ctype.h"
 #include "libiberty.h"
 #include "demangle.h"
Index: src/gdb/xml-tdesc.c
===================================================================
--- src.orig/gdb/xml-tdesc.c	2008-08-10 19:36:43.000000000 +0100
+++ src/gdb/xml-tdesc.c	2008-08-10 19:37:10.000000000 +0100
@@ -443,7 +443,7 @@ fetch_xml_from_file (const char *filenam
 
   if (dirname && *dirname)
     {
-      char *fullname = concat (dirname, "/", filename, NULL);
+      char *fullname = concat (dirname, "/", filename, (char *) NULL);
       if (fullname == NULL)
 	nomem (0);
       file = fopen (fullname, FOPEN_RT);
Index: src/gdb/gdb_select.h
===================================================================
--- src.orig/gdb/gdb_select.h	2008-08-10 19:36:43.000000000 +0100
+++ src/gdb/gdb_select.h	2008-08-10 19:37:10.000000000 +0100
@@ -22,6 +22,8 @@
 
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
+#else
+#include <sys/time.h>
 #endif
 
 #ifdef USE_WIN32API

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-10  8:33   ` Mark Kettenis
@ 2008-08-10 19:38     ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2008-08-10 19:38 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: pedro, gdb-patches

> Date: Sun, 10 Aug 2008 10:31:22 +0200 (CEST)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> CC: pedro@codesourcery.com, gdb-patches@sourceware.org
> 
> > Date: Sun, 10 Aug 2008 06:19:55 +0300
> > From: Eli Zaretskii <eliz@gnu.org>
> > 
> > > From: Pedro Alves <pedro@codesourcery.com>
> > > Date: Sat, 9 Aug 2008 22:41:46 +0100
> > > 
> > > Here are the left over patches I used to build GDB on DJGPP.
> > 
> > They are fine with me, except that I'd prefer to include sys/time.h
> > for select.
> 
> If so, can that include be moved to gdb_select.h?

Yes.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Patches to build on DJGPP
  2008-08-10  0:10 ` Daniel Jacobowitz
  2008-08-10  3:19   ` Eli Zaretskii
@ 2008-08-10 20:47   ` Pedro Alves
  1 sibling, 0 replies; 13+ messages in thread
From: Pedro Alves @ 2008-08-10 20:47 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Sunday 10 August 2008 01:09:20, Daniel Jacobowitz wrote:
> - You had nice instructions on how to set up DJGPP in your last
> message.  Since you've already got them written down, could you put
> them on the wiki?  I'm sure someone else will want to do this.

Done:

http://sourceware.org/gdb/wiki/BuildingOnDJGPP

> - The readline patches are OK for our import, but if they apply to a
> clean upstream tarball of readline, please mail them to bug-bash.

Done.  Checked in to our sources, and sent them to bug-readline.

> - And last, let the binutils list know I approved the patch to BFD.

Done.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-08-10 20:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-09 21:42 Patches to build on DJGPP Pedro Alves
2008-08-10  0:10 ` Daniel Jacobowitz
2008-08-10  3:19   ` Eli Zaretskii
2008-08-10 20:47   ` Pedro Alves
2008-08-10  3:20 ` Eli Zaretskii
2008-08-10  8:33   ` Mark Kettenis
2008-08-10 19:38     ` Eli Zaretskii
2008-08-10 15:39 ` Mark Kettenis
2008-08-10 16:06   ` Daniel Jacobowitz
2008-08-10 17:41   ` Pedro Alves
2008-08-10 17:49     ` Pedro Alves
2008-08-10 18:29       ` Mark Kettenis
2008-08-10 18:44         ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox