Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Christian Biesinger via gdb-patches" <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Christian Biesinger <cbiesinger@google.com>
Subject: [PATCH] Simplify the IPA parts of the gdbserver Makefile
Date: Tue, 26 Nov 2019 19:10:00 -0000	[thread overview]
Message-ID: <20191126191029.10514-1-cbiesinger@google.com> (raw)

Instead of adding the Gnulib CFLAGS and partially undoing them, just
don't add them.

Requires a minor change to common-defs.h, and depends on
https://sourceware.org/ml/gdb-patches/2019-11/msg00908.html

gdb/ChangeLog:

2019-11-26  Christian Biesinger  <cbiesinger@google.com>

	* gdbsupport/common-defs.h: Don't use Gnulib when building IPA.

gdb/gdbserver/ChangeLog:

2019-11-26  Christian Biesinger  <cbiesinger@google.com>

	* Makefile.in: Don't use Gnulib headers when building IPA.

Change-Id: I93266a721def7e5cd40b5a2f2ed959c70446a2d8
---
 gdb/gdbserver/Makefile.in    | 16 +++++-----------
 gdb/gdbsupport/common-defs.h |  5 ++++-
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 16012dddcb..aba0eea78f 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -119,8 +119,7 @@ GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
 # e.g.: "target/wait.h".
 #
 INCLUDE_CFLAGS = -I. -I${srcdir} \
-	-I$(srcdir)/../regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
-	$(INCGNU)
+	-I$(srcdir)/../regformats -I$(srcdir)/.. -I$(INCLUDE_DIR)
 
 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
 # from the config/ directory.
@@ -143,7 +142,8 @@ CPPFLAGS = @CPPFLAGS@
 INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \
 	${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS}
 INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
-INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
+NON_GNU_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
+INTERNAL_CFLAGS = ${NON_GNU_CFLAGS} $(INCGNU)
 
 # LDFLAGS is specifically reserved for setting from the command line
 # when running make.
@@ -440,7 +440,7 @@ IPA_LIB = libinproctrace.so
 $(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
 	$(SILENCE) rm -f $(IPA_LIB)
 	$(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
-		-Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
+		-Wl,--no-undefined $(NON_GNU_CFLAGS) $(INTERNAL_LDFLAGS) \
 		-o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
 
 # Put the proper machine-specific files first, so M-. on a machine
@@ -551,15 +551,9 @@ regdat_sh = $(srcdir)/../regformats/regdat.sh
 
 UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
 
-# Undo gnulib replacements for the IPA shared library build.
-# The gnulib headers are still needed, but gnulib is not linked
-# into the IPA lib so replacement apis don't work.
-UNDO_GNULIB_CFLAGS = -Drpl_strerror=strerror
-
 # Note, we only build the IPA if -fvisibility=hidden is supported in
 # the first place.
-IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
-	$(UNDO_GNULIB_CFLAGS) \
+IPAGENT_CFLAGS = $(NON_GNU_CFLAGS) $(UST_CFLAGS) \
 	-fPIC -DIN_PROCESS_AGENT \
 	-fvisibility=hidden
 
diff --git a/gdb/gdbsupport/common-defs.h b/gdb/gdbsupport/common-defs.h
index 4fa84ff8e5..d28e996abe 100644
--- a/gdb/gdbsupport/common-defs.h
+++ b/gdb/gdbsupport/common-defs.h
@@ -108,9 +108,12 @@
    MinGW, gnulib might enable __USE_MINGW_ANSI_STDIO, which may or not
    require use of attribute gnu_printf instead of printf.  gnulib
    checks that at configure time.  Since _GL_ATTRIBUTE_FORMAT_PRINTF
-   is compatible with ATTRIBUTE_PRINTF, simply use it.  */
+   is compatible with ATTRIBUTE_PRINTF, simply use it.
+   Since IPA does not use Gnulib, we don't do it there.  */
+#ifndef IN_PROCESS_AGENT
 #undef ATTRIBUTE_PRINTF
 #define ATTRIBUTE_PRINTF _GL_ATTRIBUTE_FORMAT_PRINTF
+#endif
 
 #if GCC_VERSION >= 3004
 #define ATTRIBUTE_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
-- 
2.24.0.432.g9d3f5f5b63-goog


             reply	other threads:[~2019-11-26 19:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 19:10 Christian Biesinger via gdb-patches [this message]
2019-11-26 20:29 ` Pedro Alves
2019-11-26 20:33   ` Christian Biesinger via gdb-patches
2019-11-26 20:56     ` Pedro Alves
2019-11-26 21:06       ` Christian Biesinger via gdb-patches
2019-11-29 17:40         ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191126191029.10514-1-cbiesinger@google.com \
    --to=gdb-patches@sourceware.org \
    --cc=cbiesinger@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox