Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: gdb-patches@sourceware.org
Subject: PATCH: Fix gdb compilation on Tru64 UNIX
Date: Mon, 18 Jan 2010 16:39:00 -0000	[thread overview]
Message-ID: <yddtyujfjut.fsf@manam.CeBiTec.Uni-Bielefeld.DE> (raw)

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)


             reply	other threads:[~2010-01-18 16:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-18 16:39 Rainer Orth [this message]
2010-01-21 17:05 ` Tom Tromey
2010-01-21 22:49   ` Rainer Orth
2010-01-22  1:43     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yddtyujfjut.fsf@manam.CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox