From patchwork Tue Sep 16 19:01:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 2865 Received: (qmail 29208 invoked by alias); 16 Sep 2014 19:01:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 29094 invoked by uid 89); 16 Sep 2014 19:01:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 16 Sep 2014 19:01:15 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 50AC61162C5 for ; Tue, 16 Sep 2014 15:01:13 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id w-qIm5BQ82G4 for ; Tue, 16 Sep 2014 15:01:13 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 21596116194 for ; Tue, 16 Sep 2014 15:01:13 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 9302D40E0F; Tue, 16 Sep 2014 12:01:12 -0700 (PDT) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA] Fix CPPFLAGS handling in gdbserver's build. Date: Tue, 16 Sep 2014 12:01:08 -0700 Message-Id: <1410894068-25516-1-git-send-email-brobecker@adacore.com> Hello, Something I happen to notice in passing... In gdb/gdbserver/Makefile.in, IPAGENT_CFLAGS is defined using an expression which references $(CPPFLAGS). But CPPFLAGS isn't actually defined. This patch first adds a CPPFLAGS definition, so as to inherit the value passed at configure time (if any). And it then makes it part of INTERNAL_CFLAGS_BASE, instead. There is no reason that CPPFLAGS be useful for a certain class of source files, and not the rest. This is also consistent with what's done in GDB. gdb/gdbserver/ChangeLog: * Makefile.in (CPPFLAGS): Define. (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}. (IPAGENT_CFLAGS): Remove ${CPPFLAGS}. Tested by rebuilding GDBserver with a dummy CPPFLAGS, and verifying that the compilation command was altered as expected. OK to apply? Thanks, diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 074d93d..e9d6b15 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -128,10 +128,11 @@ WARN_CFLAGS_NO_FORMAT = `echo " $(WARN_CFLAGS) " \ # CFLAGS is specifically reserved for setting from the command line # when running make. I.E. "make CFLAGS=-Wmissing-prototypes". CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \ - ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} + ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS) INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER @@ -447,7 +448,7 @@ UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION # Note, we only build the IPA if -fvisibility=hidden is supported in # the first place. -IPAGENT_CFLAGS = $(CPPFLAGS) $(INTERNAL_CFLAGS) $(UST_CFLAGS) \ +IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \ -fPIC -DIN_PROCESS_AGENT \ -fvisibility=hidden