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

Commit 22dd465

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 fdacbf9 commit 22dd465

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
@@ -300,6 +300,7 @@ all-shared-lib: $(shlib)
300300

301301
ifndef haslibarule
302302
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
303+
rm -f $@
303304
$(LINK.static) $@ $^
304305
$(RANLIB) $@
305306
endif #haslibarule
@@ -341,6 +342,7 @@ else # PORTNAME == aix
341342

342343
# AIX case
343344
$(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
345+
rm -f $(stlib)
344346
$(LINK.static) $(stlib) $^
345347
$(RANLIB) $(stlib)
346348
$(MKLDEXPORT) $(stlib) >$(exports_file)
@@ -360,6 +362,7 @@ $(shlib): $(OBJS) | $(SHLIB_PREREQS)
360362
$(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
361363

362364
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
365+
rm -f $@
363366
$(LINK.static) $@ $^
364367
$(RANLIB) $@
365368

src/common/Makefile

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

4444
libpgcommon.a: $(OBJS_FRONTEND)
45+
rm -f $@
4546
$(AR) $(AROPT) $@ $^
4647

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

5152
libpgcommon_srv.a: $(OBJS_SRV)
53+
rm -f $@
5254
$(AR) $(AROPT) $@ $^
5355

5456
# 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)