From patchwork Tue Nov 26 19:10:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 36241 Received: (qmail 105833 invoked by alias); 26 Nov 2019 19:10:38 -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 105764 invoked by uid 89); 26 Nov 2019 19:10:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=replacements, ht X-HELO: mail-qt1-f201.google.com Received: from mail-qt1-f201.google.com (HELO mail-qt1-f201.google.com) (209.85.160.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Nov 2019 19:10:35 +0000 Received: by mail-qt1-f201.google.com with SMTP id v92so13106454qtd.18 for ; Tue, 26 Nov 2019 11:10:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=50z5fADdtg4YWK8jI2/hYBCIjwmTL4bC/BmP8AXdZrI=; b=p6+/XZVt2zhgyOgm1UGM4MfauRSsZbTee17Ahr2yTK5GTtzkPE2qmbibFESUWcD9+B G09uO3iiQ3Osay0OFpCuYh2teitAo6fuLXzv8nTC10hfQOpvs+uX8CE4MdvS1MfD+Gne cH3and4Ys8vqPBJk61cmbYRLndLyFisA6s4rMpVTJRESrdiLulr1sekIK45+2vLR9kNa /ni03p4BzCt3gLf4IlvM/RMhMKLqQov+ostbNYqsKrRpotvbFn7pHwfX1KA/1zek8gWO 8YTcDG1ZjUO1hx97kWr9r7HYmOEV7sm9w9pt1POL1lPh9E6zz6Jc2IwDzRCvGI//QOEf e7nQ== Date: Tue, 26 Nov 2019 13:10:29 -0600 Message-Id: <20191126191029.10514-1-cbiesinger@google.com> Mime-Version: 1.0 Subject: [PATCH] Simplify the IPA parts of the gdbserver Makefile X-Patchwork-Original-From: "Christian Biesinger via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger X-IsSubscribed: yes 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 * gdbsupport/common-defs.h: Don't use Gnulib when building IPA. gdb/gdbserver/ChangeLog: 2019-11-26 Christian Biesinger * 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__))