Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 424793f

Browse files
committed
Unlink static libraries before rebuilding them.
When the library already exists in the build directory, "ar" preserves members not named on its command line. This mattered when, for example, a "configure" rerun dropped a file from $(LIBOBJS). libpgport carried the obsolete member until "make clean". Back-patch to 9.0 (all supported versions).
1 parent 097fe19 commit 424793f

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/Makefile.shlib

+3
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ all-shared-lib: $(shlib)
296296

297297
ifndef haslibarule
298298
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
299+
rm -f $@
299300
$(LINK.static) $@ $^
300301
$(RANLIB) $@
301302
endif #haslibarule
@@ -337,6 +338,7 @@ else # PORTNAME == aix
337338

338339
# AIX case
339340
$(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
341+
rm -f $(stlib)
340342
$(LINK.static) $(stlib) $^
341343
$(RANLIB) $(stlib)
342344
$(MKLDEXPORT) $(stlib) >$(exports_file)
@@ -356,6 +358,7 @@ $(shlib): $(OBJS) | $(SHLIB_PREREQS)
356358
$(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
357359

358360
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
361+
rm -f $@
359362
$(LINK.static) $@ $^
360363
$(RANLIB) $@
361364

src/common/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ uninstall:
4343
rm -f '$(DESTDIR)$(libdir)/libpgcommon.a'
4444

4545
libpgcommon.a: $(OBJS_FRONTEND)
46+
rm -f $@
4647
$(AR) $(AROPT) $@ $^
4748

4849
#
4950
# Server versions of object files
5051
#
5152

5253
libpgcommon_srv.a: $(OBJS_SRV)
54+
rm -f $@
5355
$(AR) $(AROPT) $@ $^
5456

5557
# Because this uses its own compilation rule, it doesn't use the

src/port/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ uninstall:
5151
rm -f '$(DESTDIR)$(libdir)/libpgport.a'
5252

5353
libpgport.a: $(OBJS)
54+
rm -f $@
5455
$(AR) $(AROPT) $@ $^
5556

5657
# thread.o needs PTHREAD_CFLAGS (but thread_srv.o does not)
@@ -61,6 +62,7 @@ thread.o: CFLAGS+=$(PTHREAD_CFLAGS)
6162
#
6263

6364
libpgport_srv.a: $(OBJS_SRV)
65+
rm -f $@
6466
$(AR) $(AROPT) $@ $^
6567

6668
# Because this uses its own compilation rule, it doesn't use the

0 commit comments

Comments
 (0)