From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32397 invoked by alias); 28 Jan 2011 15:22:07 -0000 Received: (qmail 32387 invoked by uid 22791); 28 Jan 2011 15:22:07 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Jan 2011 15:22:02 +0000 Received: (qmail 9376 invoked from network); 28 Jan 2011 15:22:00 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 28 Jan 2011 15:22:00 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [rfa/rfc] Build libcommon.a for gdb and gdbserver Date: Fri, 28 Jan 2011 15:52:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-24-generic; KDE/4.5.1; x86_64; ; ) Cc: Tom Tromey , Yao Qi References: <4D30E23F.3080103@codesourcery.com> <201101281504.38962.pedro@codesourcery.com> In-Reply-To: <201101281504.38962.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101281521.59734.pedro@codesourcery.com> X-IsSubscribed: yes 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: 2011-01/txt/msg00549.txt.bz2 On Friday 28 January 2011 15:04:38, Pedro Alves wrote: > > > > Yao> 4 Building libcommon.a for gdb and gdbserver respectively. > > > > This seems to mean that we must build libcommon twice. I don't > > understand that -- what is the benefit, versus having a single library? > > See above. It's not possible currently. gdb/common/ includes > headers from gdb/ when built for gdb, and headers from gdbserver/ > when built for gdbserver. ... and I should stress that gdbserver must be buildable for a different target you're building gdb for. Consider: - you build gdb for an x86-linux host, --target=arm-linux. libcommon.a built for x86. - you build gdbserver to run on arm-linux (host). libcommon.a built for arm. hence, you get two libcommon builds, even if we get rid of all the headers mess. Only the native-gdb-that-also-builds-gdbserver special case would be able to get by with a single build. libcommon.a could also be split into two distinct libraries. One, for common, but native-target independent stuff: utils, signal, xml, common structures, etc. Another, for native target backend stuff (think ptrace): gdbserver/linux-low.c and friends, merged with gdb/linux-nat.c and friends could go into this other library. But to a first approximation, a single common library is good too. -- Pedro Alves