diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 8292a6d034..3a5e362716 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -300,11 +300,17 @@ all-static-lib: $(stlib) all-shared-lib: $(shlib) +# In this rule, "touch $@" works around a problem on some platforms wherein +# ranlib updates the library file's mod time with a value calculated to +# seconds precision. If the filesystem has sub-second timestamps, this can +# cause the library file to appear older than its input files, triggering +# parallel-make problems. ifndef haslibarule $(stlib): $(OBJS) | $(SHLIB_PREREQS) rm -f $@ $(LINK.static) $@ $^ $(RANLIB) $@ + touch $@ endif #haslibarule @@ -472,7 +478,7 @@ install-lib-static: $(stlib) installdirs-lib $(INSTALL_STLIB) $< '$(DESTDIR)$(libdir)/$(stlib)' ifeq ($(PORTNAME), darwin) cd '$(DESTDIR)$(libdir)' && \ - ranlib $(stlib) + $(RANLIB) $(stlib) endif install-lib-shared: $(shlib) installdirs-lib