Here is the change to cp/Make-lang.in

In addition to adding new object files, it sets MODULE_VERSION to the current date, when DEVPHASE is experimental. I also wedge that version into the REVISION variable.

for releases the MODULE_VERSION is the MAJOR.MINOR pair. It'll refuse to load modules when the MODULE_VERSION is not on the same day (there's an override flag).

I'm not sure if we should continue putting the version into REVISION, particularly for non-experimental builds.

nathan

--
Nathan Sidwell

diff --git c/gcc/cp/Make-lang.in w/gcc/cp/Make-lang.in
index 6ee4e41266f..b9aa4025bd4 100644
--- c/gcc/cp/Make-lang.in
+++ w/gcc/cp/Make-lang.in
@@ -46,13 +46,36 @@ CP_PLUGIN_HEADERS := cp-tree.h cxx-pretty-print.h name-lookup.h type-utils.h ope
 # Note that it would be nice to move the dependency on g++
 # into the C++ rule, but that needs a little bit of work
 # to do the right thing within all.cross.
-c++: cc1plus$(exeext)
+c++: cc1plus$(exeext) mapper-server$(exeext)
 
 # Tell GNU make to ignore these if they exist.
 .PHONY: c++
 
 CFLAGS-cp/g++spec.o += $(DRIVER_DEFINES)
 
+CFLAGS-cp/module.o += -DHOST_MACHINE=\"$(host)\" \
+	-DTARGET_MACHINE=\"$(target)\"
+
+ifeq ($(DEVPHASE_c),experimental)
+# We want to make the module version volatile, when in development mode,
+# so link it to the cp dir modification time
+cp/module.o : $(srcdir)/cp
+# Some date's don't grok 'r', if so, simply use today's
+# date (don't bootstrap at midnight).
+MODULE_VERSION := $(shell date -r $(srcdir)/cp '+%y%m%d-%H%M' 2>/dev/null\
+  || date '+%y%m%d-0000' 2>/dev/null || echo 0)
+version.o : $(srcdir)/cp
+# Set REVISION string
+ifeq ($(REVISION_c),)
+REVISION_c := []
+endif
+# Wedge inside [...], if that's what it already looks like
+REVISION_s := '" $(REVISION_c:]=)$(if \
+	$(REVISION_c:[]=),:):20$(MODULE_VERSION)$(if \
+	$(filter %],$(REVISION_c)),])"'
+CFLAGS-cp/module.o += -DMODULE_VERSION='($(subst -,,$(MODULE_VERSION))U)'
+endif
+
 # Create the compiler driver for g++.
 GXX_OBJS = $(GCC_OBJS) cp/g++spec.o
 xg++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
@@ -80,7 +124,8 @@ CXX_AND_OBJCXX_OBJS = \
 	cp/error.o cp/except.o cp/expr.o \
 	cp/friend.o cp/init.o \
 	cp/lambda.o cp/lex.o cp/logic.o \
-	cp/mangle.o cp/method.o \
+	cp/mangle.o cp/mapper-client.o cp/mapper-resolver.o \
+	cp/method.o cp/module.o \
 	cp/name-lookup.o cp/optimize.o \
 	cp/parser.o cp/pt.o cp/ptree.o \
 	cp/rtti.o \
@@ -94,6 +139,11 @@ $(CXX_AND_OBJCXX_OBJS): CFLAGS += -fauto-profile=cc1plus.fda
 $(CXX_AND_OBJCXX_OBJS): cc1plus.fda
 endif
 
+MAPPER_SERVER_OBJS := cp/mapper-server.o cp/mapper-resolver.o
+mapper-server$(exeext): $(MAPPER_SERVER_OBJS) $(LIBDEPS)
+	+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
+	$(MAPPER_SERVER_OBJS) version.o $(CODYLIB) $(LIBIBERTY) $(LIBINTL)
+
 # Language-specific object files for C++.
 CXX_OBJS = cp/cp-lang.o c-family/stub-objc.o $(CXX_AND_OBJCXX_OBJS)
 
@@ -239,6 +289,9 @@ c++.install-common: installdirs
 	    fi ; \
 	  fi; \
 	fi
+	rm -f $(DESTDIR)$(libexecsubdir)/mapper-server$(exeext)
+	$(INSTALL_PROGRAM) mapper-server$(exeext) \
+	  $(DESTDIR)$(libexecsubdir)/mapper-server$(exeext)
 
 # We can't use links because not everyone supports them.  So just copy the
 # manpage.
@@ -284,6 +337,7 @@ c++.mostlyclean:
 	-rm -f cp/*$(objext)
 	-rm -f cp/*$(coverageexts)
 	-rm -f xg++$(exeext) g++-cross$(exeext) cc1plus$(exeext) cc1plus.fda
+	-rm -f mapper-server$(exeext)
 c++.clean:
 c++.distclean:
 	-rm -f cp/config.status cp/Makefile

Reply via email to