* PATCH: Fix gdb compilation on Tru64 UNIX
@ 2010-01-18 16:39 Rainer Orth
2010-01-21 17:05 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Rainer Orth @ 2010-01-18 16:39 UTC (permalink / raw)
To: gdb-patches
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)
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: PATCH: Fix gdb compilation on Tru64 UNIX
2010-01-18 16:39 PATCH: Fix gdb compilation on Tru64 UNIX Rainer Orth
@ 2010-01-21 17:05 ` Tom Tromey
2010-01-21 22:49 ` Rainer Orth
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2010-01-21 17:05 UTC (permalink / raw)
To: Rainer Orth; +Cc: gdb-patches
>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
Rainer> napms() is declared only if _XOPEN_SOURCE_EXTENDED is defined, which
Rainer> requires _XOPEN_SOURCE >= 420.
Rainer> 2010-01-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Rainer> * gdb_curses.h [__osf__] (_XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED)
Rainer> Define.
Rainer> * solib-osf.c (osf_current_sos): Initialize tail.
The solib-osf.c change is ok.
I am not as sure about the gdb_curses.h change. I don't think we have
many host tests like that. Perhaps some kind of configury would be
better.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATCH: Fix gdb compilation on Tru64 UNIX
2010-01-21 17:05 ` Tom Tromey
@ 2010-01-21 22:49 ` Rainer Orth
2010-01-22 1:43 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Rainer Orth @ 2010-01-21 22:49 UTC (permalink / raw)
To: tromey; +Cc: gdb-patches
Tom Tromey <tromey@redhat.com> writes:
>>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
> Rainer> napms() is declared only if _XOPEN_SOURCE_EXTENDED is defined, which
> Rainer> requires _XOPEN_SOURCE >= 420.
>
> Rainer> 2010-01-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> Rainer> * gdb_curses.h [__osf__] (_XOPEN_SOURCE, _XOPEN_SOURCE_EXTENDED)
> Rainer> Define.
> Rainer> * solib-osf.c (osf_current_sos): Initialize tail.
>
> The solib-osf.c change is ok.
>
> I am not as sure about the gdb_curses.h change. I don't think we have
> many host tests like that. Perhaps some kind of configury would be
> better.
True. While researching where/how best to handle this in configure.ac,
I found that TUI wasn't supposed to be built on Tru64 UNIX at all.
Unfortunately, the test is completely broken and can never have worked:
* The test checks $host_os, but tries to match it against the full
target triplet, which fails since host_os is only the third component.
* Both if conditions failed to invoke the test command, but instead
tried to execute the value of $enable_tui as a command.
After fixing those issues, TUI is disabled on alpha-dec-osf5.1b (tested
by removing the gdb subdir and running make again) and gdb builds
without problems.
Ok?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2010-01-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* configure.ac: Only use host_os part when disabling TUI on osf.
Use test to check variables, prefix strings with x.
* configure: Regenerate.
Index: gdb/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.112
diff -u -p -r1.112 configure.ac
--- gdb/configure.ac 15 Jan 2010 00:34:37 -0000 1.112
+++ gdb/configure.ac 21 Jan 2010 22:44:01 -0000
@@ -447,11 +447,11 @@ AM_ICONV
# broken on alpha-osf.
case $host_os in
- alpha*-*-osf* )
- if "$enable_tui" = "yes"; then
+ osf* )
+ if test x"$enable_tui" = xyes; then
AC_MSG_ERROR([Building GDB with TUI mode is not supported on this host])
fi
- if "$enable_tui" = "auto"; then
+ if test x"$enable_tui" = xauto; then
enable_tui=no
fi
;;
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: PATCH: Fix gdb compilation on Tru64 UNIX
2010-01-21 22:49 ` Rainer Orth
@ 2010-01-22 1:43 ` Tom Tromey
0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2010-01-22 1:43 UTC (permalink / raw)
To: Rainer Orth; +Cc: gdb-patches
>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
Rainer> 2010-01-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Rainer> * configure.ac: Only use host_os part when disabling TUI on osf.
Rainer> Use test to check variables, prefix strings with x.
Rainer> * configure: Regenerate.
This is ok. Thanks for finding this.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-22 1:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-18 16:39 PATCH: Fix gdb compilation on Tru64 UNIX Rainer Orth
2010-01-21 17:05 ` Tom Tromey
2010-01-21 22:49 ` Rainer Orth
2010-01-22 1:43 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox