diff options
author | Mike Frysinger <vapier@gentoo.org> | 2022-11-03 18:19:13 +0700 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-11-05 20:00:56 +0700 |
commit | c0c25232da12f3985041cded1bb7e761d4d0cd1e (patch) | |
tree | b1886508998af5eeda176ae1bedc71a016cf89a7 /sim/common | |
parent | 59d8576e4ff7e6467fab3ea894baa72c8400e22a (diff) | |
download | fsf-binutils-gdb-c0c25232da12f3985041cded1bb7e761d4d0cd1e.zip fsf-binutils-gdb-c0c25232da12f3985041cded1bb7e761d4d0cd1e.tar.gz fsf-binutils-gdb-c0c25232da12f3985041cded1bb7e761d4d0cd1e.tar.bz2 |
sim: run: move linking into top-level
Automake will run each subdir individually before moving on to the next
one. This means that the linking phase, a single threaded process, will
not run in parallel with anything else. When we have to link ~32 ports,
that's 32 link steps that don't take advantage of parallel systems. On
my really old 4-core system, this cuts a multi-target build from ~60 sec
to ~30 sec. We eventually want to move all compile+link steps to this
common dir anyways, so might as well move linking now for a nice speedup.
We use noinst_PROGRAMS instead of bin_PROGRAMS because we're taking care
of the install ourselves rather than letting automake process it.
Diffstat (limited to 'sim/common')
-rw-r--r-- | sim/common/Make-common.in | 7 | ||||
-rw-r--r-- | sim/common/local.mk | 19 |
2 files changed, 19 insertions, 7 deletions
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 2cdf357..8e27795 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -208,18 +208,13 @@ LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(LDFLAGS_FOR_BUILD) -o $@ RUNTESTFLAGS = -all: libsim.a run$(EXEEXT) +all: libsim.a $(SIM_RUN_OBJS) libsim.a: $(LIB_OBJS) $(SILENCE) rm -f libsim.a $(ECHO_AR) $(AR) $(AR_FLAGS) libsim.a $(LIB_OBJS) $(ECHO_RANLIB) $(RANLIB) libsim.a -run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS) - $(ECHO_CCLD) $(LIBTOOL) $(AM_V_lt) --tag=CC --mode=link \ - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \ - $(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS) - # # Dependency tracking. Most of this is conditional on GNU Make being # found by configure; if GNU Make is not found, we fall back to a diff --git a/sim/common/local.mk b/sim/common/local.mk index 5afae91..c45af29 100644 --- a/sim/common/local.mk +++ b/sim/common/local.mk @@ -30,7 +30,8 @@ SIM_ALL_RECURSIVE_DEPS += \ ## NB: libcommon.a isn't used directly by ports. We need a target for common ## objects to be a part of, and ports use the individual objects directly. -noinst_LIBRARIES += %D%/libcommon.a +SIM_COMMON_LIB = %D%/libcommon.a +noinst_LIBRARIES += $(SIM_COMMON_LIB) %C%_libcommon_a_SOURCES = \ %D%/callback.c \ %D%/portability.c \ @@ -50,3 +51,19 @@ noinst_LIBRARIES += %D%/libcommon.a CLEANFILES += \ %D%/version.c %D%/version.c-stamp + +## +## For subdirs. +## + +LIBIBERTY_LIB = ../libiberty/libiberty.a +BFD_LIB = ../bfd/libbfd.la +OPCODES_LIB = ../opcodes/libopcodes.la + +SIM_COMMON_LIBS = \ + $(SIM_COMMON_LIB) \ + $(BFD_LIB) \ + $(OPCODES_LIB) \ + $(LIBIBERTY_LIB) \ + $(LIBGNU) \ + $(LIBGNU_EXTRA_LIBS) |