Skip to content

Commit 1c96685

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 5c8dabe commit 1c96685

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Makefile.shlib

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ all-shared-lib: $(shlib)
343343

344344
ifndef haslibarule
345345
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
346+
rm -f $@
346347
$(LINK.static) $@ $^
347348
$(RANLIB) $@
348349
endif #haslibarule
@@ -385,6 +386,7 @@ else # PORTNAME == aix
385386

386387
# AIX case
387388
$(shlib) $(stlib): $(OBJS) | $(SHLIB_PREREQS)
389+
rm -f $(stlib)
388390
$(LINK.static) $(stlib) $^
389391
$(RANLIB) $(stlib)
390392
$(MKLDEXPORT) $(stlib) >$(exports_file)
@@ -405,6 +407,7 @@ $(shlib): $(OBJS) | $(SHLIB_PREREQS)
405407
$(CC) $(CFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) $(LDAP_LIBS_BE)
406408

407409
$(stlib): $(OBJS) | $(SHLIB_PREREQS)
410+
rm -f $@
408411
$(LINK.static) $@ $^
409412
$(RANLIB) $@
410413

src/port/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ uninstall:
5050
rm -f '$(DESTDIR)$(libdir)/libpgport.a'
5151

5252
libpgport.a: $(OBJS)
53+
rm -f $@
5354
$(AR) $(AROPT) $@ $^
5455

5556
# thread.o needs PTHREAD_CFLAGS (but thread_srv.o does not)
@@ -61,6 +62,7 @@ thread.o: thread.c
6162
#
6263

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

6668
%_srv.o: %.c

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy