From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 5C4343411C7; Thu, 3 Nov 2022 11:18:25 +0000 (UTC) From: Mike Frysinger 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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 $@ -- 2.38.1