summaryrefslogtreecommitdiff
path: root/src/backend/Makefile
diff options
context:
space:
mode:
authorAndres Freund2022-12-07 02:55:28 +0000
committerAndres Freund2022-12-07 02:55:28 +0000
commit9db49fc5bfdc0126be03f4b8986013e59d93b91d (patch)
tree9b3a2ee004e98feec42933a5174f9159ca862788 /src/backend/Makefile
parent8018ffbf5895ee16a1fd7117c4526b47ac42332e (diff)
autoconf: Move export_dynamic determination to configure
Previously export_dynamic was set in src/makefiles/Makefile.$port. For solaris this required exporting with_gnu_ld. The determination of with_gnu_ld would be nontrivial to copy for meson PGXS compatibility. It's also nice to delete libtool.m4. This uses -Wl,--export-dynamic on all platforms, previously all platforms but FreeBSD used -Wl,-E. The likelihood of a name conflict seems lower with the longer spelling. Discussion: https://postgr.es/m/20221005200710.luvw5evhwf6clig6@awork3.anarazel.de
Diffstat (limited to 'src/backend/Makefile')
-rw-r--r--src/backend/Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/Makefile b/src/backend/Makefile
index efd4d30a28d..c8d1de4f103 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -55,6 +55,8 @@ ifeq ($(with_systemd),yes)
LIBS += -lsystemd
endif
+override LDFLAGS := $(LDFLAGS) $(LDFLAGS_EX) $(LDFLAGS_EX_BE)
+
##########################################################################
all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(POSTGRES_IMP)
@@ -64,7 +66,7 @@ ifneq ($(PORTNAME), win32)
ifneq ($(PORTNAME), aix)
postgres: $(OBJS)
- $(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(LIBS) -o $@
+ $(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) $(LIBS) -o $@
endif
endif
@@ -73,7 +75,7 @@ endif
ifeq ($(PORTNAME), cygwin)
postgres: $(OBJS)
- $(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) -Wl,--stack,$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.a $(LIBS) -o $@
+ $(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) -Wl,--stack,$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.a $(LIBS) -o $@
# libpostgres.a is actually built in the preceding rule, but we need this to
# ensure it's newer than postgres; see notes in src/backend/parser/Makefile
@@ -86,7 +88,7 @@ ifeq ($(PORTNAME), win32)
LIBS += -lsecur32
postgres: $(OBJS) $(WIN32RES)
- $(CC) $(CFLAGS) $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LDFLAGS) $(LDFLAGS_EX) -Wl,--stack=$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.a $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LDFLAGS) -Wl,--stack=$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.a $(LIBS) -o $@$(X)
# libpostgres.a is actually built in the preceding rule, but we need this to
# ensure it's newer than postgres; see notes in src/backend/parser/Makefile
@@ -98,7 +100,7 @@ endif # win32
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 $@
+ $(CC) $(CFLAGS) $(call expand_subsys,$(OBJS)) $(LDFLAGS) -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.
@@ -320,4 +322,4 @@ maintainer-clean: distclean
# are up to date. It saves the time of doing all the submakes.
.PHONY: quick
quick: $(OBJS)
- $(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(LIBS) -o postgres
+ $(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) $(LIBS) -o postgres