aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-07 01:48:06 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-12 23:49:41 -0400
commitdd8e16ea7b2b929480a3cfac894af78aecc7608e (patch)
treedaadd082687879dc2a3d8e3fadba5860badb8e1f /sim/common
parenta687671327dd2eb4d715745cce04a8f1c96e1fc1 (diff)
downloadgdb-dd8e16ea7b2b929480a3cfac894af78aecc7608e.zip
gdb-dd8e16ea7b2b929480a3cfac894af78aecc7608e.tar.gz
gdb-dd8e16ea7b2b929480a3cfac894af78aecc7608e.tar.bz2
sim: unify sim-load.o building
Since this file does not rely on any port-specific settings, move it up to building as part of the common step so we only do it once in a multibuild.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog9
-rw-r--r--sim/common/Make-common.in6
-rw-r--r--sim/common/defs.h4
-rw-r--r--sim/common/local.mk6
4 files changed, 23 insertions, 2 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 19e93bb..5d713c6 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,14 @@
2021-06-12 Mike Frysinger <vapier@gentoo.org>
+ * Make-common.in (SIM_NEW_COMMON_OBJS): Move sim-load.o to ...
+ (COMMON_OBJS_NAMES): ... here. Rename var from COMMON_OBJS.
+ (COMMON_OBJS): Redefine.
+ * defs.h [SIM_COMMON_BUILD]: Do not include ../config.h.
+ * local.mk (%C%_libcommon_a_CPPFLAGS): New variable.
+ (%C%_libcommon_a_SOURCES): Add %D%/sim-load.c.
+
+2021-06-12 Mike Frysinger <vapier@gentoo.org>
+
* dv-sockser.c: Include sys/select.h.
2021-06-12 Mike Frysinger <vapier@gentoo.org>
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 999b1ee..8454d16 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -179,7 +179,6 @@ SIM_NEW_COMMON_OBJS = \
sim-hrw.o \
sim-io.o \
sim-info.o \
- sim-load.o \
sim-memopt.o \
sim-model.o \
sim-module.o \
@@ -254,7 +253,10 @@ 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)
-COMMON_OBJS = ../common/version.o
+COMMON_OBJS_NAMES = \
+ sim-load.o \
+ version.o
+COMMON_OBJS = $(COMMON_OBJS_NAMES:%=../common/common_libcommon_a-%)
LIB_OBJS = callback.o modules.o syscall.o targ-map.o $(COMMON_OBJS) $(SIM_OBJS)
diff --git a/sim/common/defs.h b/sim/common/defs.h
index 4b5da7b..21ad2a4 100644
--- a/sim/common/defs.h
+++ b/sim/common/defs.h
@@ -37,6 +37,8 @@
/* Include arch-specific sim's various configure tests. */
#include "config.h"
+#ifndef SIM_COMMON_BUILD
+
/* Reset macros that our config.h will provide. */
#undef PACKAGE
#undef PACKAGE_BUGREPORT
@@ -52,3 +54,5 @@
#endif
#endif
+
+#endif
diff --git a/sim/common/local.mk b/sim/common/local.mk
index 357be75..a340feb 100644
--- a/sim/common/local.mk
+++ b/sim/common/local.mk
@@ -28,7 +28,13 @@ 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
+%C%_libcommon_a_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -DSIM_COMMON_BUILD \
+ -I../bfd \
+ -I..
%C%_libcommon_a_SOURCES = \
+ %D%/sim-load.c \
%D%/version.c
%D%/version.c: $(srcroot)/gdb/version.in $(srcroot)/bfd/version.h $(srcdir)/%D%/create-version.sh