From patchwork Thu Nov 3 10:03:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 59820 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B2A763858D39 for ; Thu, 3 Nov 2022 11:18:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2A763858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667474330; bh=dNu+xCAFlNH/46+cT1XXxeu02o0o+yTKmAyYzM+BwpI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=H9jqFccXyYGhyM4+rvKbSwWEcZ2CXB8cV9ubdvJ8k5gscLyt3nlVGqv6kLtaSCeZf x/BM5StqO+Nvm4hXRvCuL9tbV0mdS+J5buopsBetZbqQdlw1v7ia2mf8fwkykIn6yv s5eDXzsW1ZqKyGSjRMQtIczcC2ecJrL+XIn0tE1k= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id D47E03858D32 for ; Thu, 3 Nov 2022 11:18:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D47E03858D32 Received: by smtp.gentoo.org (Postfix, from userid 559) id 5C4343411C7; Thu, 3 Nov 2022 11:18:25 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 1/5] sim: build: switch to libtool for linking Date: Thu, 3 Nov 2022 17:03:59 +0700 Message-Id: <20221103100403.26278-1-vapier@gentoo.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" The top-level already sets up a libtool script for the host, so use that when linking rather than invoking CC directly. This will also happen when we (someday) move the building to pure automake. --- sim/arch-subdir.mk.in | 8 ++++++++ sim/common/Make-common.in | 12 +++++++----- sim/cris/Makefile.in | 3 ++- sim/erc32/Makefile.in | 3 ++- sim/ppc/Makefile.in | 3 ++- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in index 2c0e2bbce93d..dd75abcec22d 100644 --- a/sim/arch-subdir.mk.in +++ b/sim/arch-subdir.mk.in @@ -17,6 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +AM_V = @AM_V@ + host_alias = @host_alias@ target_alias = @target_alias@ program_transform_name = @program_transform_name@ @@ -42,6 +44,12 @@ AR_FLAGS = rc RANLIB = @RANLIB@ DTC = @DTC@ +LIBTOOL = @LIBTOOL@ +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = + DEPMODE = @CCDEPMODE@ DEPDIR = @DEPDIR@ diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index a6c54dc41d33..83b1cf111c70 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -43,6 +43,9 @@ srcsim = $(srcdir)/.. @SIM_COMMON_BUILD_FALSE@config.status = config.status @SIM_COMMON_BUILD_TRUE@config.status = ../config.status +# Settings from top-level configure. +include ../arch-subdir.mk + include $(srcroot)/gdb/silent-rules.mk ifeq ($(V),0) @@ -56,9 +59,6 @@ endif GNULIB_PARENT_DIR = ../.. include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc -# Settings from top-level configure. -include ../arch-subdir.mk - prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -258,7 +258,8 @@ libsim.a: $(LIB_OBJS) $(ECHO_RANLIB) $(RANLIB) libsim.a run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS) - $(ECHO_CCLD) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \ + $(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \ + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \ $(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS) # @@ -416,7 +417,8 @@ stamp-hw: Makefile.in $(srccom)/Make-common.in $(config.status) Makefile $(SILENCE) touch $@ test-hw-events: $(srccom)/hw-events.c libsim.a - $(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \ + $(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \ + $(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \ $(srccom)/hw-events.c libsim.a $(EXTRA_LIBS) # See sim_pre_argv_init and sim_module_install in sim-module.c for more details. diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in index d58aeee9363d..c3660e76f0d4 100644 --- a/sim/cris/Makefile.in +++ b/sim/cris/Makefile.in @@ -53,7 +53,8 @@ all: rvdummy$(EXEEXT) check: rvdummy$(EXEEXT) rvdummy$(EXEEXT): rvdummy.o $(EXTRA_LIBDEPS) - $(ECHO_CCLD) $(CC) $(ALL_CFLAGS) -o rvdummy$(EXEEXT) rvdummy.o $(EXTRA_LIBS) + $(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \ + $(CC) $(ALL_CFLAGS) -o rvdummy$(EXEEXT) rvdummy.o $(EXTRA_LIBS) rvdummy.o: rvdummy.c $(remote_sim_h) $(callback_h) diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in index 41830aab726f..de05be97262d 100644 --- a/sim/erc32/Makefile.in +++ b/sim/erc32/Makefile.in @@ -39,7 +39,8 @@ SIS_OFILES = exec.o erc32.o func.o help.o float.o all: sis$(EXEEXT) sis$(EXEEXT): sis.o $(SIS_OFILES) libsim.a $(LIBDEPS) - $(ECHO_CCLD) $(CC) $(ALL_CFLAGS) -o sis$(EXEEXT) \ + $(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \ + $(CC) $(ALL_CFLAGS) -o sis$(EXEEXT) \ sis.o $(SIS_OFILES) libsim.a $(EXTRA_LIBS) # Copy the files into directories where they will be run. diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in index 9eec4252971e..2b5a11aefea2 100644 --- a/sim/ppc/Makefile.in +++ b/sim/ppc/Makefile.in @@ -522,7 +522,8 @@ PACKAGE_OBJ = @sim_pk_obj@ psim$(EXEEXT): $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBINTL_DEP) - $(ECHO_CCLD) $(CC) $(CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(ZLIB) $(ZSTD_LIBS) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS) + $(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) run$(EXEEXT): psim$(EXEEXT) $(SILENCE) rm -f $@ From patchwork Thu Nov 3 10:04:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 59821 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 60BE53858283 for ; Thu, 3 Nov 2022 11:18:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60BE53858283 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667474331; bh=12MQxjk975wqbr8r3D47FfoRF1FmZYOU/0ALI1JnGHs=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=KzXyU4MfnNEPvXBHcoxQSJB+uJEwU1B9mAyhmQaatn+ndgoPcbDB/T6rOU7x0+8mn 5SZ3BMy0IPB/Vc+1QvJOuNfo2P77WfC6RkW4FzqlFU2tGquGU6t0H9w4V4VhXYF2Yh AEdBjHtjjpfWVMiSdCbWKJEv/+MdYhxxbWtzxQ84= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id DAC8C3858D39 for ; Thu, 3 Nov 2022 11:18:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DAC8C3858D39 Received: by smtp.gentoo.org (Postfix, from userid 559) id 7B4453411D2; Thu, 3 Nov 2022 11:18:27 +0000 (UTC) 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 Message-Id: <20221103100403.26278-2-vapier@gentoo.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103100403.26278-1-vapier@gentoo.org> References: <20221103100403.26278-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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 $@ From patchwork Thu Nov 3 10:04:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 59823 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B861A385840D for ; Thu, 3 Nov 2022 11:19:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B861A385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667474359; bh=sRk8suATn80jZAn1eB3rb7hVWpu6YudSCEIWHV7mJpI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hZutc31MtalVHffPisVGCZQGru7xsYmKZ8nfaR7NctBYuh8vkLFVjg7LPwRva2cso W4k7xFzUvqHEQwC50hFRJ/YSTsZrwG8C614YqvXsuE3GC7Nd5QW8yfGPRBkvFIJlx0 SCClXMsHCRPQl2fUGCAs7MzMqonLa6WNsHC4vfbM= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 1729A3858C60 for ; Thu, 3 Nov 2022 11:18:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1729A3858C60 Received: by smtp.gentoo.org (Postfix, from userid 559) id A82933411C7; Thu, 3 Nov 2022 11:18:29 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 3/5] sim: build: drop duplicate $(LIBS) usage Date: Thu, 3 Nov 2022 17:04:01 +0700 Message-Id: <20221103100403.26278-3-vapier@gentoo.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103100403.26278-1-vapier@gentoo.org> References: <20221103100403.26278-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" COMMON_LIBS is set to $(LIBS), and CONFIG_LIBS is set to that plus @LIBS@. This leds to the values being used twice. Inline the CONFIG_LIBS variable without @LIBS@ since it's used only once. --- sim/common/Make-common.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index c58eb0d3ba97..a79a375a90c5 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -221,10 +221,9 @@ SIM_HW_DEVICES = cfi core pal glue $(SIM_EXTRA_HW_DEVICES) LIBIBERTY_LIB = ../../libiberty/libiberty.a 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_LIBS) $(SIM_EXTRA_LIBS) $(LIBGNU) $(LIBGNU_EXTRA_LIBS) COMMON_OBJS_NAMES = \ callback.o \ From patchwork Thu Nov 3 10:04:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 59824 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 45DE73858400 for ; Thu, 3 Nov 2022 11:19:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 45DE73858400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667474387; bh=WyGe5gvx8GhV7IENeHQh4GHEalaRyC8wD+9TEDGW3eg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=T+FHpGnX0HqJQ+dAgwndzY2Hk2aa39NxKKcEFQ1n1G3QAP3K3uFfXSD1uoLWxbXl+ weGz/5I06Y0LYrwledc8XMQiWP9j8onJYNLvsS3ntxOsSovf/u6A8+sBUdIEEPYY0Z jRKCBo1e+1kxWY3mEILb9qHh9AWGVgeC7YVmlC3I= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id D22AC3858427 for ; Thu, 3 Nov 2022 11:18:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D22AC3858427 Received: by smtp.gentoo.org (Postfix, from userid 559) id CF37D3411C7; Thu, 3 Nov 2022 11:18:31 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 4/5] sim: build: change AC_CHECK_LIB to AC_SEARCH_LIBS Date: Thu, 3 Nov 2022 17:04:02 +0700 Message-Id: <20221103100403.26278-4-vapier@gentoo.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103100403.26278-1-vapier@gentoo.org> References: <20221103100403.26278-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" With more C libraries moving functions entirely into the main -lc, change the AC_CHECK_LIB calls to AC_SEARCH_LIBS so we look in there first and avoid extra linkage when possible. --- sim/config.h.in | 12 -- sim/configure | 235 +++++++++++++++++++++++--------------- sim/m4/sim_ac_platform.m4 | 10 +- 3 files changed, 150 insertions(+), 107 deletions(-) diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4 index 92fb00a3d795..74ac7fe14d45 100644 --- a/sim/m4/sim_ac_platform.m4 +++ b/sim/m4/sim_ac_platform.m4 @@ -145,12 +145,12 @@ AC_TYPE_UID_T LT_INIT dnl Libraries. -AC_CHECK_LIB(socket, bind) -AC_CHECK_LIB(nsl, gethostbyname) -AC_CHECK_LIB(m, fabs) -AC_CHECK_LIB(m, log2) +AC_SEARCH_LIBS([bind], [socket]) +AC_SEARCH_LIBS([gethostbyname], [nsl]) +AC_SEARCH_LIBS([fabs], [m]) +AC_SEARCH_LIBS([log2], [m]) -AC_CHECK_LIB(dl, dlopen) +AC_SEARCH_LIBS([dlopen], [dl]) if test "${ac_cv_lib_dl_dlopen}" = "yes"; then PKG_CHECK_MODULES(SDL, sdl2, [dnl SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL=2" From patchwork Thu Nov 3 10:04:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 59822 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F2288385829B for ; Thu, 3 Nov 2022 11:19:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F2288385829B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667474351; bh=ipBscLX39LStztd+KHxLuaX/OUy4Ou9VRv+GDm/EUlY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=WsBkVgqze7qtPWyccrQFbFBM2K+h4R8YGVjchnQLYO1hTN0cRL8E3KOg+p7rLPLNU pNGO2uS/sBhHcfKWJACvKi7p8/7zF+SlAyIXaZwiM9YKjaORfdez2Ez+bjUyT4+TKx D5Xnr2Gwg1I2gTSb8Ti07yPsRpi1OgSQvoEeAvLs= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 710EC3858426 for ; Thu, 3 Nov 2022 11:18:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 710EC3858426 Received: by smtp.gentoo.org (Postfix, from userid 559) id EF2F03411D2; Thu, 3 Nov 2022 11:18:33 +0000 (UTC) To: gdb-patches@sourceware.org Subject: [PATCH 5/5] sim: drop -lm from SIM_EXTRA_LIBS Date: Thu, 3 Nov 2022 17:04:03 +0700 Message-Id: <20221103100403.26278-5-vapier@gentoo.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103100403.26278-1-vapier@gentoo.org> References: <20221103100403.26278-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" We have configure tests for this in the top-level configure script to link this when necessary, so we don't need to explicitly list it for specific ports. --- sim/aarch64/Makefile.in | 2 -- sim/arm/Makefile.in | 1 - sim/bfin/Makefile.in | 2 +- sim/erc32/Makefile.in | 2 +- sim/moxie/Makefile.in | 1 - sim/or1k/Makefile.in | 2 -- sim/sh/Makefile.in | 1 - 7 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sim/aarch64/Makefile.in b/sim/aarch64/Makefile.in index 95de0f96cc6e..72a37053b049 100644 --- a/sim/aarch64/Makefile.in +++ b/sim/aarch64/Makefile.in @@ -21,8 +21,6 @@ ## COMMON_PRE_CONFIG_FRAG -SIM_EXTRA_LIBS = -lm - SIM_OBJS = \ $(SIM_NEW_COMMON_OBJS) \ interp.o \ diff --git a/sim/arm/Makefile.in b/sim/arm/Makefile.in index d7d50d54289f..f1f58ab27848 100644 --- a/sim/arm/Makefile.in +++ b/sim/arm/Makefile.in @@ -18,7 +18,6 @@ ## COMMON_PRE_CONFIG_FRAG SIM_EXTRA_CFLAGS = -DMODET -SIM_EXTRA_LIBS = -lm SIM_OBJS = \ wrapper.o \ diff --git a/sim/bfin/Makefile.in b/sim/bfin/Makefile.in index f4f30c48bcb5..62f7b71ded1a 100644 --- a/sim/bfin/Makefile.in +++ b/sim/bfin/Makefile.in @@ -60,7 +60,7 @@ SIM_EXTRA_HW_DEVICES = \ eth_phy SIM_EXTRA_CFLAGS = $(SDL_CFLAGS) -SIM_EXTRA_LIBS = $(SDL_LIBS) -lm +SIM_EXTRA_LIBS = $(SDL_LIBS) ## COMMON_POST_CONFIG_FRAG diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in index de05be97262d..1f20adf8c347 100644 --- a/sim/erc32/Makefile.in +++ b/sim/erc32/Makefile.in @@ -23,7 +23,7 @@ READLINE_SRC = $(srcroot)/readline/readline SIM_OBJS = exec.o erc32.o func.o help.o float.o interf.o SIM_RUN_OBJS = sis.o SIM_EXTRA_CFLAGS = $(READLINE_CFLAGS) -SIM_EXTRA_LIBS = $(READLINE_LIB) $(TERMCAP_LIB) -lm +SIM_EXTRA_LIBS = $(READLINE_LIB) $(TERMCAP_LIB) SIM_EXTRA_INSTALL = install-sis SIM_EXTRA_CLEAN = clean-sis diff --git a/sim/moxie/Makefile.in b/sim/moxie/Makefile.in index 1c01ec60516e..850b8c81ec05 100644 --- a/sim/moxie/Makefile.in +++ b/sim/moxie/Makefile.in @@ -22,7 +22,6 @@ SIM_OBJS = \ interp.o \ sim-resume.o -SIM_EXTRA_LIBS = -lm SIM_EXTRA_CFLAGS = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\"" ## COMMON_POST_CONFIG_FRAG diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in index f288b02c8e8b..54dc37135b05 100644 --- a/sim/or1k/Makefile.in +++ b/sim/or1k/Makefile.in @@ -51,8 +51,6 @@ SIM_EXTRA_DEPS = \ SIM_EXTRA_CFLAGS = -SIM_EXTRA_LIBS = -lm - ## COMMON_POST_CONFIG_FRAG arch = or1k diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in index fc794f30687f..4bba7059ff81 100644 --- a/sim/sh/Makefile.in +++ b/sim/sh/Makefile.in @@ -21,7 +21,6 @@ SIM_OBJS = \ interp.o \ $(SIM_NEW_COMMON_OBJS) \ table.o -SIM_EXTRA_LIBS = -lm SIM_EXTRA_DEPS = table.c code.c ppi.c ## COMMON_POST_CONFIG_FRAG