From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15031 invoked by alias); 14 Sep 2015 15:20:42 -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 15020 invoked by uid 89); 14 Sep 2015 15:20:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg20.ericsson.net Received: from usevmg20.ericsson.net (HELO usevmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 14 Sep 2015 15:20:40 +0000 Received: from EUSAAHC007.ericsson.se (Unknown_Domain [147.117.188.93]) by usevmg20.ericsson.net (Symantec Mail Security) with SMTP id D0.D2.32596.41786F55; Mon, 14 Sep 2015 10:36:36 +0200 (CEST) Received: from [142.133.110.95] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.95) with Microsoft SMTP Server id 14.3.248.2; Mon, 14 Sep 2015 11:20:28 -0400 From: Antoine Tremblay Subject: Re: [PATCH 2/7] Move some integer operations to common. To: Gary Benson References: <1441973603-15247-1-git-send-email-antoine.tremblay@ericsson.com> <1441973603-15247-3-git-send-email-antoine.tremblay@ericsson.com> <20150911142442.GA23515@blade.nx> <55F30C55.3080507@ericsson.com> <55F31019.1080607@ericsson.com> <20150914092453.GA26894@blade.nx> CC: Message-ID: <55F6E5BC.7050006@ericsson.com> Date: Mon, 14 Sep 2015 15:20:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <20150914092453.GA26894@blade.nx> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00295.txt.bz2 On 09/14/2015 05:24 AM, Gary Benson wrote: > Antoine Tremblay wrote: >> On 09/11/2015 01:16 PM, Antoine Tremblay wrote: >>> On 09/11/2015 10:24 AM, Gary Benson wrote: >>>> Please don't introduce "#ifdef GDBSERVER" conditionals into >>>> common code, I spent some time removing them. I know I didn't >>>> get them all, but the remaining two are on my hit list. >>> >>> Humm what is the issue that makes this a bad idea if I may ? > > The way the common code is built is currently kind of weird and ugly. > Even though the code is shared, there's still places you have to do > the same work twice, for example if you add a new .c or .h file to > common, for example, you have to add it to both GDB's and gdbserver's > Makefiles. If you add stuff that needs configure checks, you have to > add those twice too. Also we build gnulib twice. Also, the way the > compiler is invoked means that you can accidentally #include GDB- or > gdbserver-specific headers in common code. It's all very error-prone. > > For the future we'd like to move the common code into its own toplevel > directory with it's own Makefile, it's own ./configure, etc. It would > be built once, to a libgdbcommon.a or something that GDB and gdbserver > would statically link. We can't do that if gdb/{common,nat,target} > have conditional code. > Ok, thanks for clarifying this for me. So if there were a libgdbcommon I would need to include bfd into it and make it a requirement of that lib so that both GDB and GDBServer can use it. So I've made bfd.h a requirement of GDBServer, and when there will be a libgdbcommon we can have the whole lib as a requirement there. See patch v2 in next mail...