From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63608 invoked by alias); 18 Oct 2016 14:28:30 -0000 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 Received: (qmail 63257 invoked by uid 89); 18 Oct 2016 14:28:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=lift, Rainer, Orth, rainer X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Oct 2016 14:28:17 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 248D18F242; Tue, 18 Oct 2016 14:28:16 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9IESE3q022746; Tue, 18 Oct 2016 10:28:14 -0400 Subject: Re: Fix gdb 7.12 C++ compilation on Solaris To: Rainer Orth References: <5e1396ea-6599-6b9a-bc8b-f59defaf4c3a@redhat.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: Date: Tue, 18 Oct 2016 14:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00511.txt.bz2 On 10/18/2016 02:14 PM, Rainer Orth wrote: >> Yes, with the tweak above on master. But, the process for getting > > Thanks. When investigating the failure to detect -static-libstdc++ > support (more below), I found two more issues which only show up with > -Werror: > > /vol/src/gnu/gdb/gdb/local/gdb/procfs.c: In function 'ssd* proc_get_LDT_entry(procinfo*, int)': > /vol/src/gnu/gdb/gdb/local/gdb/procfs.c:2487:19: error: variable 'old_chain' set but not used [-Werror=unused-but-set-variable] > struct cleanup *old_chain = NULL; > ^ > > Unless I'm mistaken, you need to run do_cleanups on every return from > the function. You're right. > > Afterwards, I ran a 32-bit compilation, which (after adding > --disable-largefile to avoid > > In file included from /usr/include/sys/procfs.h:28:0, > from /vol/src/gnu/gdb/gdb/local/gdb/i386-sol2-nat.c:23: > /usr/include/sys/old_procfs.h:39:2: error: #error "Cannot use procfs in the large file compilation environment" > #error "Cannot use procfs in the large file compilation environment" > ^ > BTW, the gdb/procfs.c file is long overdue for an overall face lift... All the !NEW_PROC_API code should be dead, AFAIK. Despite the comments at the top, the file is no longer used for any target other than Solaris: $ grep -rn "[^-]procfs\.o" gdb/config/ gdb/config/sparc/sol2.mh:5: procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o gdb/config/i386/sol2-64.mh:3: procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o gdb/config/i386/i386sol2.mh:3: procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o The other Unix ports mentioned are all gone. But I'm surprised that your Solaris build is including some "old_procfs.h" though. I thought that any non-ancient Solaris version would be going through NEW_PROC_API too. Doesn't this bit in gdb/configure.ac pick NEW_PROC_API for you in 32-bit mode? : # Detect which type of /proc is in use, such as for Solaris. if test "${target}" = "${host}"; then case "${host}" in *-*-sysv4.2* | *-*-sysv5* ) AC_DEFINE(NEW_PROC_API, 1, [Define if you want to use new multi-fd /proc interface.]) ;; *-*-solaris2.[[6789]] | *-*-solaris2.1[[0-9]]*) AC_DEFINE(NEW_PROC_API, 1, [Define if you want to use new multi-fd /proc interface.]) ;; mips-sgi-irix5*) # Work around needing _KMEMUSER problem on IRIX 5. AC_DEFINE([_KMEMUSER], 1, [Define to 1 so gets a definition of anon_hdl. Works around a problem on IRIX 5.]) ;; esac fi It'd be great to find someone motivated to clean this all up. :-) At least to make sure that the 32-bit and 64-bit compilations take the same paths in the backend... FYI, AFAIK, no GDB maintainer cares for/tests on Solaris routinely nowadays. > and two more instances) revealed > > /vol/src/gnu/gdb/gdb/local/gdb/top.c: In function 'void gdb_safe_append_history()': > /vol/src/gnu/gdb/gdb/local/gdb/top.c:1170:59: error: format '%d' expects argument of type 'int', but argument 3 has type 'pid_t {aka long int}' [-Werror=format=] > = xstrprintf ("%s-gdb%d~", history_filename, getpid ()); > ^ > > Fixed by casting pid_t to long and printing it as such. > > Still ok for mainline? Still OK. Thanks, Pedro Alves