diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.global.in | 2 | ||||
-rw-r--r-- | src/backend/Makefile | 12 | ||||
-rw-r--r-- | src/makefiles/Makefile.freebsd | 1 | ||||
-rw-r--r-- | src/makefiles/Makefile.linux | 1 | ||||
-rw-r--r-- | src/makefiles/Makefile.netbsd | 1 | ||||
-rw-r--r-- | src/makefiles/Makefile.openbsd | 1 | ||||
-rw-r--r-- | src/makefiles/Makefile.solaris | 4 |
7 files changed, 8 insertions, 14 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 6ee0f513018..fb3e197fc06 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@ -with_gnu_ld = @with_gnu_ld@ # It's critical that within LDFLAGS, all -L switches pointing to build-tree # directories come before any -L switches pointing to external directories. @@ -313,6 +312,7 @@ endif LDFLAGS = $(LDFLAGS_INTERNAL) @LDFLAGS@ LDFLAGS_EX = @LDFLAGS_EX@ +LDFLAGS_EX_BE = @LDFLAGS_EX_BE@ # LDFLAGS_SL might have already been assigned by calling makefile LDFLAGS_SL += @LDFLAGS_SL@ WINDRES = @WINDRES@ 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 diff --git a/src/makefiles/Makefile.freebsd b/src/makefiles/Makefile.freebsd index db74a21568c..8a65d781354 100644 --- a/src/makefiles/Makefile.freebsd +++ b/src/makefiles/Makefile.freebsd @@ -1,4 +1,3 @@ -export_dynamic = -Wl,-export-dynamic rpath = -Wl,-R'$(rpathdir)' # extra stuff for $(with_temp_install) diff --git a/src/makefiles/Makefile.linux b/src/makefiles/Makefile.linux index 5a9451371ab..16d8249a111 100644 --- a/src/makefiles/Makefile.linux +++ b/src/makefiles/Makefile.linux @@ -1,4 +1,3 @@ -export_dynamic = -Wl,-E # Use --enable-new-dtags to generate DT_RUNPATH instead of DT_RPATH. # This allows LD_LIBRARY_PATH to still work when needed. rpath = -Wl,-rpath,'$(rpathdir)',--enable-new-dtags diff --git a/src/makefiles/Makefile.netbsd b/src/makefiles/Makefile.netbsd index 4f8e9ec2521..eb86e0b76e4 100644 --- a/src/makefiles/Makefile.netbsd +++ b/src/makefiles/Makefile.netbsd @@ -1,4 +1,3 @@ -export_dynamic = -Wl,-E rpath = -Wl,-R'$(rpathdir)' diff --git a/src/makefiles/Makefile.openbsd b/src/makefiles/Makefile.openbsd index 4f8e9ec2521..eb86e0b76e4 100644 --- a/src/makefiles/Makefile.openbsd +++ b/src/makefiles/Makefile.openbsd @@ -1,4 +1,3 @@ -export_dynamic = -Wl,-E rpath = -Wl,-R'$(rpathdir)' diff --git a/src/makefiles/Makefile.solaris b/src/makefiles/Makefile.solaris index 3de73ebc010..e2b386ac127 100644 --- a/src/makefiles/Makefile.solaris +++ b/src/makefiles/Makefile.solaris @@ -1,10 +1,6 @@ # src/makefiles/Makefile.solaris rpath = -Wl,-rpath,'$(rpathdir)' -ifeq ($(with_gnu_ld), yes) -export_dynamic = -Wl,-E -endif - # Rule for building a shared library from a single .o file %.so: %.o $(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ |