aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in3
-rw-r--r--src/backend/Makefile8
2 files changed, 7 insertions, 4 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 346b73260fc..6ee0f513018 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -289,7 +289,6 @@ LDAP_LIBS_FE = @LDAP_LIBS_FE@
LDAP_LIBS_BE = @LDAP_LIBS_BE@
UUID_LIBS = @UUID_LIBS@
LLVM_LIBS=@LLVM_LIBS@
-LD = @LD@
with_gnu_ld = @with_gnu_ld@
# It's critical that within LDFLAGS, all -L switches pointing to build-tree
@@ -316,8 +315,6 @@ LDFLAGS = $(LDFLAGS_INTERNAL) @LDFLAGS@
LDFLAGS_EX = @LDFLAGS_EX@
# LDFLAGS_SL might have already been assigned by calling makefile
LDFLAGS_SL += @LDFLAGS_SL@
-LDREL = -r
-LDOUT = -o
WINDRES = @WINDRES@
X = @EXEEXT@
diff --git a/src/backend/Makefile b/src/backend/Makefile
index 181c217fae4..efd4d30a28d 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -100,8 +100,14 @@ ifeq ($(PORTNAME), aix)
postgres: $(POSTGRES_IMP)
$(CC) $(CFLAGS) $(call expand_subsys,$(OBJS)) $(LDFLAGS) $(LDFLAGS_EX) -Wl,-bE:$(top_builddir)/src/backend/$(POSTGRES_IMP) $(LIBS) -Wl,-brtllib -o $@
+# Linking to a single .o with -r is a lot faster than building a .a or passing
+# all objects to MKLDEXPORT.
+#
+# It looks alluring to use $(CC) -r instead of ld -r, but that doesn't
+# trivially work with gcc, due to gcc specific static libraries linked in with
+# -r.
$(POSTGRES_IMP): $(OBJS)
- $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(call expand_subsys,$^)
+ ld -r -o SUBSYS.o $(call expand_subsys,$^)
$(MKLDEXPORT) SUBSYS.o . > $@
@rm -f SUBSYS.o