Bug 1561953 - Filter out PR version files in static library build. r=glandium default tip
authorEdouard Oger <eoger@fastmail.com>
Wed, 07 Aug 2019 21:21:17 +0000
changeset 4827 bf5c37749c28c523134e41b1e28b6ffaf2d2c4e9
parent 4826 a1961c8c1d704cbfcf35fa9146c0ccb38f267c50
push id327
push userjjones@mozilla.com
push dateWed, 07 Aug 2019 21:27:22 +0000
reviewersglandium
bugs1561953
Bug 1561953 - Filter out PR version files in static library build. r=glandium Differential Revision: https://phabricator.services.mozilla.com/D36380
config/rules.mk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -275,20 +275,23 @@ ifdef MOZ_PROFILE_GENERATE
 endif	# MOZ_PROFILE_GENERATE
 else	# WINNT && !GCC
 	$(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) $(WRAP_LDFLAGS)
 endif	# WINNT && !GCC
 ifdef ENABLE_STRIP
 	$(STRIP) $@
 endif
 
-$(LIBRARY): $(OBJS)
+# Same as OBJS, but without any file that matches p*vrsion.o, since these
+# collide for static libraries, and are not useful for that case anyway.
+STATICLIB_OBJS = $(filter-out $(OBJDIR)/p%vrsion.$(OBJ_SUFFIX),$(OBJS))
+$(LIBRARY): $(STATICLIB_OBJS)
 	@$(MAKE_OBJDIR)
 	rm -f $@
-	$(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS)
+	$(AR) $(AR_FLAGS) $(STATICLIB_OBJS) $(AR_EXTRA_ARGS)
 	$(RANLIB) $@
 
 ifeq ($(OS_TARGET), OS2)
 $(IMPORT_LIBRARY): $(MAPFILE)
 	rm -f $@
 	$(IMPLIB) $@ $(MAPFILE)
 else
 ifeq (,$(filter-out WIN95 WINCE WINMO,$(OS_TARGET)))