From patchwork Tue Feb 25 22:22:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 38316 Received: (qmail 61493 invoked by alias); 25 Feb 2020 22:22:57 -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 61434 invoked by uid 89); 25 Feb 2020 22:22:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.146.80) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Feb 2020 22:22:48 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 775C332101 for ; Tue, 25 Feb 2020 16:22:47 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 6ibHjoTlPXVkQ6ibHj9tYW; Tue, 25 Feb 2020 16:22:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=K8tQon6LTLN8cGW1mH2po6p8pmTVF33VtRYs/ulDJjg=; b=L+i+gvo/CDrqgI18fFITOTfd/t SsvXz54Je0gkiXV7UjCTA0Bhr3o7PXux2ylU8rywaxMXls7eZS3Mvd+EEDc8n70CjiCKC5a+cIWpz EbFO5gePDRsr3MO9VMRIoI8ZH; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:55644 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j6ibH-000r0B-65; Tue, 25 Feb 2020 15:22:47 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 6/6] Change gdbserver to use existing gdbsupport Date: Tue, 25 Feb 2020 15:22:43 -0700 Message-Id: <20200225222243.8260-7-tom@tromey.com> In-Reply-To: <20200225222243.8260-1-tom@tromey.com> References: <20200225222243.8260-1-tom@tromey.com> This changes the gdbserver build to use the gdbsupport that was built for gdb. gdbserver and gdbreplay now must use WIN32APILIBS (aka -lws2_32). Before this change, gdbserver did not define USE_WIN32API when building gdbsupport, but now this is always done. 2020-02-25 Tom Tromey * Makefile.in: Rebuild. * Makefile.def (gdbserver): Depend on gdbsupport. gdbserver/ChangeLog 2020-02-25 Tom Tromey * configure: Rebuild. * configure.ac (GDBSERVER_DEPFILES): Remove srv_selftest_objs. (WIN32APILIBS): New subst. * Makefile.in (SFILES, OBS, TAGS, GDBREPLAY_OBS): Remove gdbsupport files. (gdbsupport/%.o): Remove target. (GDBSUPPORT_BUILDDIR, GDBSUPPORT): New variables. (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Add GDBSUPPORT. (WIN32APILIBS): New variable. (gdbserver$(EXEEXT)): Add WIN32APILIBS. (gdbreplay$(EXEEXT)): Likewise. --- ChangeLog | 5 +++ Makefile.def | 1 + Makefile.in | 1 + gdbserver/ChangeLog | 14 +++++++ gdbserver/Makefile.in | 88 +++++++----------------------------------- gdbserver/configure | 7 ++-- gdbserver/configure.ac | 8 ++-- 7 files changed, 42 insertions(+), 82 deletions(-) diff --git a/Makefile.def b/Makefile.def index 3162199ac7b..76d062bb671 100644 --- a/Makefile.def +++ b/Makefile.def @@ -412,6 +412,7 @@ dependencies = { module=all-gdb; on=all-libctf; }; // Host modules specific to gdbserver. dependencies = { module=configure-gdbserver; on=all-gnulib; }; +dependencies = { module=all-gdbserver; on=all-gdbsupport; }; dependencies = { module=all-gdbserver; on=all-gnulib; }; dependencies = { module=all-gdbserver; on=all-libiberty; }; diff --git a/Makefile.in b/Makefile.in index d24dfdfb860..9dfd39fae13 100644 --- a/Makefile.in +++ b/Makefile.in @@ -51977,6 +51977,7 @@ all-gdb: maybe-all-build-bison all-gdb: maybe-all-sim all-gdb: maybe-all-libtermcap configure-gdbserver: maybe-all-gnulib +all-gdbserver: maybe-all-gdbsupport all-gdbserver: maybe-all-gnulib configure-libgui: maybe-configure-tcl configure-libgui: maybe-configure-tk diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in index d6b79385e15..8c35c169d62 100644 --- a/gdbserver/Makefile.in +++ b/gdbserver/Makefile.in @@ -102,6 +102,9 @@ INCLUDE_DEP = $$(INCLUDE_DIR) LIBIBERTY_BUILDDIR = ../libiberty LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a +GDBSUPPORT_BUILDDIR = ../gdbsupport +GDBSUPPORT = $(GDBSUPPORT_BUILDDIR)/libgdbsupport.a + # Where is ust? These will be empty if ust was not available. ustlibs = @ustlibs@ ustinc = @ustinc@ @@ -152,6 +155,8 @@ CPPFLAGS = @CPPFLAGS@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ +WIN32APILIBS = @WIN32APILIBS@ + # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS) @@ -213,32 +218,6 @@ SFILES = \ $(srcdir)/../gdb/arch/arm-linux.c \ $(srcdir)/../gdb/arch/ppc-linux-common.c \ $(srcdir)/../gdb/arch/riscv.c \ - $(srcdir)/../gdbsupport/btrace-common.cc \ - $(srcdir)/../gdbsupport/buffer.cc \ - $(srcdir)/../gdbsupport/cleanups.cc \ - $(srcdir)/../gdbsupport/common-debug.cc \ - $(srcdir)/../gdbsupport/common-exceptions.cc \ - $(srcdir)/../gdbsupport/common-inferior.cc \ - $(srcdir)/../gdbsupport/common-regcache.cc \ - $(srcdir)/../gdbsupport/common-utils.cc \ - $(srcdir)/../gdbsupport/errors.cc \ - $(srcdir)/../gdbsupport/environ.cc \ - $(srcdir)/../gdbsupport/fileio.cc \ - $(srcdir)/../gdbsupport/filestuff.cc \ - $(srcdir)/../gdbsupport/job-control.cc \ - $(srcdir)/../gdbsupport/gdb-dlfcn.cc \ - $(srcdir)/../gdbsupport/gdb_tilde_expand.cc \ - $(srcdir)/../gdbsupport/gdb_vecs.cc \ - $(srcdir)/../gdbsupport/gdb_wait.cc \ - $(srcdir)/../gdbsupport/netstuff.cc \ - $(srcdir)/../gdbsupport/new-op.cc \ - $(srcdir)/../gdbsupport/pathstuff.cc \ - $(srcdir)/../gdbsupport/print-utils.cc \ - $(srcdir)/../gdbsupport/ptid.cc \ - $(srcdir)/../gdbsupport/rsp-low.cc \ - $(srcdir)/../gdbsupport/safe-strerror.cc \ - $(srcdir)/../gdbsupport/tdesc.cc \ - $(srcdir)/../gdbsupport/xml-utils.cc \ $(srcdir)/../gdb/nat/aarch64-sve-linux-ptrace.c \ $(srcdir)/../gdb/nat/linux-btrace.c \ $(srcdir)/../gdb/nat/linux-namespaces.c \ @@ -260,36 +239,6 @@ TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} OBS = \ alloc.o \ ax.o \ - gdbsupport/agent.o \ - gdbsupport/btrace-common.o \ - gdbsupport/buffer.o \ - gdbsupport/cleanups.o \ - gdbsupport/common-debug.o \ - gdbsupport/common-exceptions.o \ - gdbsupport/common-inferior.o \ - gdbsupport/job-control.o \ - gdbsupport/common-regcache.o \ - gdbsupport/common-utils.o \ - gdbsupport/errors.o \ - gdbsupport/environ.o \ - gdbsupport/fileio.o \ - gdbsupport/filestuff.o \ - gdbsupport/format.o \ - gdbsupport/gdb-dlfcn.o \ - gdbsupport/gdb_tilde_expand.o \ - gdbsupport/gdb_vecs.o \ - gdbsupport/gdb_wait.o \ - gdbsupport/netstuff.o \ - gdbsupport/new-op.o \ - gdbsupport/pathstuff.o \ - gdbsupport/print-utils.o \ - gdbsupport/ptid.o \ - gdbsupport/rsp-low.o \ - gdbsupport/safe-strerror.o \ - gdbsupport/signals.o \ - gdbsupport/signals-state-save-restore.o \ - gdbsupport/tdesc.o \ - gdbsupport/xml-utils.o \ debug.o \ dll.o \ event-loop.o \ @@ -312,14 +261,6 @@ OBS = \ $(XML_BUILTIN) GDBREPLAY_OBS = \ - gdbsupport/cleanups.o \ - gdbsupport/common-exceptions.o \ - gdbsupport/common-utils.o \ - gdbsupport/rsp-low.o \ - gdbsupport/errors.o \ - gdbsupport/netstuff.o \ - gdbsupport/print-utils.o \ - gdbsupport/safe-strerror.o \ gdbreplay.o \ utils.o \ version.o @@ -412,18 +353,20 @@ install-html: clean-info: gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY) \ - $(INTL_DEPS) + $(INTL_DEPS) $(GDBSUPPORT) $(SILENCE) rm -f gdbserver$(EXEEXT) $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \ - -o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \ - $(INTL) $(GDBSERVER_LIBS) $(XM_CLIBS) + -o gdbserver$(EXEEXT) $(OBS) $(GDBSUPPORT) $(LIBGNU) \ + $(LIBIBERTY) $(INTL) $(GDBSERVER_LIBS) $(XM_CLIBS) \ + $(WIN32APILIBS) gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) \ - $(INTL_DEPS) + $(INTL_DEPS) $(GDBSUPPORT) $(SILENCE) rm -f gdbreplay$(EXEEXT) $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \ - -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \ - $(LIBIBERTY) $(INTL) + -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) \ + $(GDBSUPPORT) $(LIBGNU) $(LIBIBERTY) $(INTL) \ + $(WIN32APILIBS) IPA_OBJS = \ alloc-ipa.o \ @@ -459,7 +402,6 @@ TAGS: ${TAGFILES} if [ x$$i != xyzzy ]; then \ echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \ -e 's,/\(arch\|nat\|target\)/,/../\1/,' \ - -e 's,/\(gdbsupport\)/,/../../\1/,'; \ fi; \ done` \ ${TAGFILES} @@ -595,10 +537,6 @@ arch/%.o: ../gdb/arch/%.c $(COMPILE) -x c++ $< $(POSTCOMPILE) -gdbsupport/%.o: ../gdbsupport/%.cc - $(COMPILE) $< - $(POSTCOMPILE) - %.o: %-generated.cc $(COMPILE) $< $(POSTCOMPILE) diff --git a/gdbserver/configure b/gdbserver/configure index 47f3152eb45..57b5dedfff6 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -637,6 +637,7 @@ WERROR_CFLAGS WARN_CFLAGS ustinc ustlibs +WIN32APILIBS LTLIBIPT LIBIPT HAVE_LIBIPT @@ -6112,8 +6113,6 @@ if $enable_unittests; then $as_echo "#define GDB_SELF_TEST 1" >>confdefs.h - srv_selftest_objs="gdbsupport/selftest.o" - fi @@ -9379,6 +9378,8 @@ $as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; } fi +# This is set by GDB_AC_COMMON. + # Check the return and argument types of ptrace. @@ -10626,7 +10627,7 @@ $as_echo "#define USE_XML 1" >>confdefs.h done fi -GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_selftest_objs" +GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles" GDBSERVER_LIBS="$srv_libs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports __sync_*_compare_and_swap" >&5 diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac index d0f406628d9..0556f7dba75 100644 --- a/gdbserver/configure.ac +++ b/gdbserver/configure.ac @@ -46,9 +46,7 @@ AC_HEADER_STDC # Set the 'development' global. . $srcdir/../bfd/development.sh -GDB_AC_SELFTEST([ - srv_selftest_objs="gdbsupport/selftest.o" -]) +GDB_AC_SELFTEST ACX_NONCANONICAL_TARGET ACX_NONCANONICAL_HOST @@ -81,6 +79,8 @@ AC_FUNC_FORK AC_CHECK_FUNCS(pread pwrite pread64) GDB_AC_COMMON +# This is set by GDB_AC_COMMON. +AC_SUBST(WIN32APILIBS) # Check the return and argument types of ptrace. GDB_AC_PTRACE @@ -360,7 +360,7 @@ if test "$srv_xmlfiles" != ""; then done fi -GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_selftest_objs" +GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles" GDBSERVER_LIBS="$srv_libs" dnl Check whether the target supports __sync_*_compare_and_swap.