This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
PATCH: Fix gdb compilation on Tru64 UNIX
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: gdb-patches at sourceware dot org
- Date: Mon, 18 Jan 2010 17:39:22 +0100
- Subject: PATCH: Fix gdb compilation on Tru64 UNIX
Current gdb mainline doesn't even compile on Tru64 UNIX V5.1B with gcc
4.4.2:
cc1: warnings being treated as errors
/vol/src/gnu/gdb/gdb/gdb/solib-osf.c: In function 'osf_current_sos':
/vol/src/gnu/gdb/gdb/gdb/solib-osf.c:539: error: 'tail' may be used uninitialized in this function
make[2]: *** [solib-osf.o] Error 1
This can be easily fixed by initializing tail to NULL.
cc1: warnings being treated as errors
/vol/src/gnu/gdb/gdb/gdb/tui/tui-io.c: In function 'tui_getc':
/vol/src/gnu/gdb/gdb/gdb/tui/tui-io.c:683: error: implicit declaration of function 'napms'
make[2]: *** [tui-io.o] Error 1
napms() is declared only if _XOPEN_SOURCE_EXTENDED is defined, which
requires _XOPEN_SOURCE >= 420.
The following patch fixes both issues and allows the compilation to
conclude.
Unfortunately, I still cannot debug gnat1 generated from GCC mainline:
Reading symbols from /vol/gcc/obj/gcc-4.5.0-20100111/5.1b-gcc/gcc/gnat1...Error reading symbol table: Memory exhausted
I'm investigating this separately.
Ok for mainline?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2010-01-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gdb_curses.h [__osf__] (_XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED):
Define.
* solib-osf.c (osf_current_sos): Initialize tail.
Index: solib-osf.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-osf.c,v
retrieving revision 1.28
diff -u -p -r1.28 solib-osf.c
--- solib-osf.c 8 Jan 2010 22:52:03 -0000 1.28
+++ solib-osf.c 18 Jan 2010 16:33:46 -0000
@@ -536,7 +536,7 @@ close_map (struct read_map_ctxt *ctxt)
static struct so_list *
osf_current_sos (void)
{
- struct so_list *head = NULL, *tail, *newtail, so;
+ struct so_list *head = NULL, *tail = NULL, *newtail, so;
struct read_map_ctxt ctxt;
int skipped_main;
Index: gdb_curses.h
===================================================================
RCS file: /cvs/src/src/gdb/gdb_curses.h,v
retrieving revision 1.12
diff -u -p -r1.12 gdb_curses.h
--- gdb_curses.h 1 Jan 2010 07:31:32 -0000 1.12
+++ gdb_curses.h 18 Jan 2010 16:33:46 -0000
@@ -21,6 +21,14 @@
#ifndef GDB_CURSES_H
#define GDB_CURSES_H 1
+/* On Tru64 UNIX, the napms() prototype is only visible with
+ _XOPEN_SOURCE_EXTENDED. */
+#ifdef __osf__
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 500
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+
#if defined (HAVE_NCURSES_NCURSES_H)
#include <ncurses/ncurses.h>
#elif defined (HAVE_NCURSES_H)