From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5542 invoked by alias); 9 Aug 2008 21:42:33 -0000 Received: (qmail 5530 invoked by uid 22791); 9 Aug 2008 21:42:32 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 09 Aug 2008 21:41:54 +0000 Received: (qmail 5185 invoked from network); 9 Aug 2008 21:41:52 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Aug 2008 21:41:52 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Patches to build on DJGPP Date: Sat, 09 Aug 2008 21:42:00 -0000 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_a8gnIrHXMp8V5su" Message-Id: <200808092241.46195.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00259.txt.bz2 --Boundary-00=_a8gnIrHXMp8V5su Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 1714 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 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 --Boundary-00=_a8gnIrHXMp8V5su Content-Type: text/x-diff; charset="utf-8"; name="go32_fixes.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="go32_fixes.diff" Content-length: 5060 gdb/ 2008-08-09 Pedro Alves * 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 * signals.c (rl_set_sighandler): Guard access to SIGWINCH. * wcwidth.c [__GO32__]: Include wctype.h before wchar.h. bfd/ 2008-08-09 Pedro Alves * 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 #include +#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 +#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 #endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif + #ifdef USE_WIN32API #include #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 +#endif + #include 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; --Boundary-00=_a8gnIrHXMp8V5su--