From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98588 invoked by alias); 14 Jul 2015 14:46:46 -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 98578 invoked by uid 89); 14 Jul 2015 14:46:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 14 Jul 2015 14:46:44 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id BA90619CF49; Tue, 14 Jul 2015 14:46:43 +0000 (UTC) Received: from blade.nx (ovpn-116-104.ams2.redhat.com [10.36.116.104]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6EEkgCi006056; Tue, 14 Jul 2015 10:46:43 -0400 Received: by blade.nx (Postfix, from userid 1000) id C542A263C61; Tue, 14 Jul 2015 15:46:41 +0100 (BST) Date: Tue, 14 Jul 2015 14:46:00 -0000 From: Gary Benson To: Peter Bergner Cc: "gdb-patches@sourceware.org" Subject: Re: [PATCH] Fix build issue due to Introduce nat/linux-namespaces.[ch] patch Message-ID: <20150714144641.GC26999@blade.nx> References: <1436474110.5367.27.camel@otta> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1436474110.5367.27.camel@otta> X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00406.txt.bz2 Hi Peter, Peter Bergner wrote: > I have a toolchain that dies building gdb with the following error: > > /home/bergner/binutils/binutils-gdb/gdb/nat/linux-namespaces.c:39:1: error: static declaration of ‘setns’ follows non-static declaration > setns (int fd, int nstype) > ^ > In file included from /opt/at7.0/include/sched.h:41:0, > from /home/bergner/binutils/binutils-gdb/gdb/nat/linux-namespaces.c:30: > /opt/at7.0/include/bits/sched.h:91:12: note: previous declaration of ‘setns’ was here > extern int setns (int __fd, int __nstype) __THROW; > ^ > make[2]: *** [linux-namespaces.o] Error 1 > > My configure doesn't define HAVE_SETNS because my glibc defines > __stub_setns, so nat/linux-namespaces.c defines its own setns > routine. However, my glibc also has its sched.h with a extern > prototype for setns, which conflicts with this static version > linux-namespaces.c is creating, so we get the error above. How > about the following patch to work around the error? I can confirm > that it fixes the problem on my multiple systems that do and do not > have setns. > > Ok for trunk? I'd prefer it without the nested conditionals: #ifdef HAVE_SETNS return setns (fd, nstype); #elif defined __NR_setns return syscall (__NR_setns, fd, nstype); #else errno = ENOSYS; return -1; #endif Otherwise ok. Thanks for doing this work! Cheers, Gary -- http://gbenson.net/