public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFA] Fix CPPFLAGS handling in gdbserver's build.
@ 2014-09-16 19:01 Joel Brobecker
  2014-09-16 19:56 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2014-09-16 19:01 UTC (permalink / raw)
  To: gdb-patches

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,
-- 
Joel

---
 gdb/gdbserver/Makefile.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] Fix CPPFLAGS handling in gdbserver's build.
  2014-09-16 19:01 [RFA] Fix CPPFLAGS handling in gdbserver's build Joel Brobecker
@ 2014-09-16 19:56 ` Pedro Alves
  2014-09-16 20:42   ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2014-09-16 19:56 UTC (permalink / raw)
  To: Joel Brobecker, gdb-patches

On 09/16/2014 08:01 PM, Joel Brobecker wrote:

> 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?

OK, thanks.

Pedro Alves

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA] Fix CPPFLAGS handling in gdbserver's build.
  2014-09-16 19:56 ` Pedro Alves
@ 2014-09-16 20:42   ` Joel Brobecker
  0 siblings, 0 replies; 3+ messages in thread
From: Joel Brobecker @ 2014-09-16 20:42 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> > 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, thanks.

Thanks, Pedro. This is now in.

-- 
Joel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-16 20:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-16 19:01 [RFA] Fix CPPFLAGS handling in gdbserver's build Joel Brobecker
2014-09-16 19:56 ` Pedro Alves
2014-09-16 20:42   ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).