From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6478 invoked by alias); 18 Jan 2010 16:39:38 -0000 Received: (qmail 6462 invoked by uid 22791); 18 Jan 2010 16:39:35 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Jan 2010 16:39:27 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 49B1EAB6 for ; Mon, 18 Jan 2010 17:39:25 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id QLETZLMNpEkM for ; Mon, 18 Jan 2010 17:39:22 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 787E4AB5 for ; Mon, 18 Jan 2010 17:39:22 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.3+Sun/8.14.3/Submit) id o0IGdMpq007004; Mon, 18 Jan 2010 17:39:22 +0100 (MET) From: Rainer Orth To: gdb-patches@sourceware.org Subject: PATCH: Fix gdb compilation on Tru64 UNIX Date: Mon, 18 Jan 2010 16:39:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-01/txt/msg00456.txt.bz2 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 * 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 #elif defined (HAVE_NCURSES_H)