public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/5] sim: build: switch to bfd & opcodes libtool linker scripts
Date: Thu,  3 Nov 2022 17:04:00 +0700	[thread overview]
Message-ID: <20221103100403.26278-2-vapier@gentoo.org> (raw)
In-Reply-To: <20221103100403.26278-1-vapier@gentoo.org>

Now that we use libtool to link, we don't need to duplicate all the
libs that bfd itself uses.  This simplifies the configure & Makefile.
---
 sim/Makefile.in           |  23 +--
 sim/aclocal.m4            |   4 -
 sim/arch-subdir.mk.in     |   6 -
 sim/common/Make-common.in |  16 +-
 sim/config.h.in           |  10 --
 sim/configure             | 363 +-------------------------------------
 sim/m4/sim_ac_platform.m4 |  16 +-
 sim/moxie/Makefile.in     |   2 +-
 sim/ppc/Makefile.in       |   9 +-
 9 files changed, 18 insertions(+), 431 deletions(-)

diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index dd75abcec22d..bd047c97687c 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -53,12 +53,6 @@ am__v_lt_1 =
 DEPMODE = @CCDEPMODE@
 DEPDIR = @DEPDIR@
 
-zlibdir = @zlibdir@
-ZSTD_LIBS = @ZSTD_LIBS@
-@PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@
-LIBINTL = @LIBINTL@
-LIBINTL_DEP = @LIBINTL_DEP@
-INTL_CFLAGS = @INCINTL@
 SDL_CFLAGS = @SDL_CFLAGS@
 SDL_LIBS = @SDL_LIBS@
 TERMCAP_LIB = @TERMCAP_LIB@
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 83b1cf111c70..c58eb0d3ba97 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -210,8 +210,7 @@ CSEARCH = -I. -I$(srcdir) -I$(srccom) \
   -I$(srcroot)/include \
   -I../../bfd -I$(srcroot)/bfd \
   -I$(srcroot)/opcodes \
-  -I../.. \
-  $(INTL_CFLAGS)
+  -I../..
 ALL_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(INCGNU) $(SIM_EXTRA_CFLAGS) $(CFLAGS)
 BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH)
 
@@ -219,14 +218,13 @@ COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS)
 
 SIM_HW_DEVICES = cfi core pal glue $(SIM_EXTRA_HW_DEVICES)
 
-ZLIB = $(zlibdir) -lz
 LIBIBERTY_LIB = ../../libiberty/libiberty.a
-BFD_LIB = ../../bfd/libbfd.a
-OPCODES_LIB = ../../opcodes/libopcodes.a
-CONFIG_LIBS = $(COMMON_LIBS) @LIBS@ $(ZLIB) $(ZSTD_LIBS)
-LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL_DEP) $(LIBIBERTY_LIB)
-EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL) $(LIBIBERTY_LIB) \
-	$(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBDL) $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
+BFD_LIB = ../../bfd/libbfd.la
+OPCODES_LIB = ../../opcodes/libopcodes.la
+CONFIG_LIBS = $(COMMON_LIBS) @LIBS@
+LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBIBERTY_LIB)
+EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBIBERTY_LIB) \
+	$(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBGNU) $(LIBGNU_EXTRA_LIBS)
 
 COMMON_OBJS_NAMES = \
 	callback.o \
diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4
index a91b2334b847..92fb00a3d795 100644
--- a/sim/m4/sim_ac_platform.m4
+++ b/sim/m4/sim_ac_platform.m4
@@ -142,21 +142,7 @@ AC_TYPE_SIGNAL
 AC_TYPE_SIZE_T
 AC_TYPE_UID_T
 
-dnl We don't use gettext, but bfd does.  So we do the appropriate checks
-dnl to see if there are intl libraries we should link against.
-ALL_LINGUAS=
-ZW_GNU_GETTEXT_SISTER_DIR
-
-dnl BFD conditionally uses zlib, so we must link it in if libbfd does, by
-dnl using the same condition.
-AM_ZLIB
-AC_ZSTD
-
-dnl BFD uses libdl when when plugins enabled.
-AC_PLUGINS
-AM_CONDITIONAL(PLUGINS, test "$plugins" = yes)
-LT_INIT([dlopen])
-AC_SUBST(lt_cv_dlopen_libs)
+LT_INIT
 
 dnl Libraries.
 AC_CHECK_LIB(socket, bind)
diff --git a/sim/moxie/Makefile.in b/sim/moxie/Makefile.in
index b267adc026df..1c01ec60516e 100644
--- a/sim/moxie/Makefile.in
+++ b/sim/moxie/Makefile.in
@@ -22,7 +22,7 @@ SIM_OBJS = \
 	interp.o \
 	sim-resume.o
 
-SIM_EXTRA_LIBS = -lm -lz
+SIM_EXTRA_LIBS = -lm
 SIM_EXTRA_CFLAGS = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 2b5a11aefea2..b1fda1fbff42 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -88,7 +88,7 @@ CONFIG_CFLAGS = \
   $(DEVZERO_CFLAGS)
 SIM_FPU_CFLAGS = -DHAVE_COMMON_FPU -I../common -I${srcdir}/../common
 
-STD_CFLAGS	= $(CFLAGS) $(WERROR_CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(INCGNU) $(INTL_CFLAGS) $(SIM_FPU_CFLAGS)
+STD_CFLAGS	= $(CFLAGS) $(WERROR_CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(INCGNU) $(SIM_FPU_CFLAGS)
 NOWARN_CFLAGS	= $(CFLAGS) $(INLINE_CFLAGS) $(CONFIG_CFLAGS) $(INCLUDES) $(SIM_FPU_CFLAGS)
 BUILD_CFLAGS	= $(CFLAGS_FOR_BUILD) $(INCLUDES) $(WARN_CFLAGS)
 
@@ -132,8 +132,7 @@ GDB_INCLUDES	= -I../../gdb -I$(srcdir)/../../gdb  -I$(srcdir)/../../gdb/config
 INCLUDES	= -I. -I$(srcdir) $(LIB_INCLUDES) $(BFD_INCLUDES) $(GDB_INCLUDES) -I../..
 
 LIBIBERTY_LIB	= ../../libiberty/libiberty.a
-BFD_LIB		= ../../bfd/libbfd.a
-ZLIB		= $(zlibdir) -lz
+BFD_LIB		= ../../bfd/libbfd.la
 
 
 TARGETLIB	= libsim.a
@@ -521,9 +520,9 @@ PACKAGE_SRC = @sim_pk_src@
 PACKAGE_OBJ = @sim_pk_obj@
 
 
-psim$(EXEEXT): $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBINTL_DEP)
+psim$(EXEEXT): $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB)
 	$(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \
-	  $(CC) $(CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(ZLIB) $(ZSTD_LIBS) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS)
+	  $(CC) $(CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(LIBIBERTY_LIB) $(LIBS)
 
 run$(EXEEXT): psim$(EXEEXT)
 	$(SILENCE) rm -f $@
-- 
2.38.1


  reply	other threads:[~2022-11-03 11:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 10:03 [PATCH 1/5] sim: build: switch to libtool for linking Mike Frysinger
2022-11-03 10:04 ` Mike Frysinger [this message]
2022-11-03 10:04 ` [PATCH 3/5] sim: build: drop duplicate $(LIBS) usage Mike Frysinger
2022-11-03 10:04 ` [PATCH 4/5] sim: build: change AC_CHECK_LIB to AC_SEARCH_LIBS Mike Frysinger
2022-11-03 10:04 ` [PATCH 5/5] sim: drop -lm from SIM_EXTRA_LIBS Mike Frysinger

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=20221103100403.26278-2-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).