Commit 8307b092 authored by Tom Lane's avatar Tom Lane

Still more third thoughts: when linking shared libraries, LDFLAGS probably

needs to appear before anything placed in SHLIB_LINK.  This is because
SHLIB_LINK is typically a subset of LIBS, and LIBS has to appear after
LDFLAGS on platforms that are sensitive to the relative order of -L and -l
switches.
parent 0a4ecfe7
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# Copyright (c) 1998, Regents of the University of California # Copyright (c) 1998, Regents of the University of California
# #
# IDENTIFICATION # IDENTIFICATION
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.124 2010/07/05 18:54:37 tgl Exp $ # $PostgreSQL: pgsql/src/Makefile.shlib,v 1.125 2010/07/06 03:55:33 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -78,9 +78,6 @@ LINK.static = $(AR) $(AROPT) ...@@ -78,9 +78,6 @@ LINK.static = $(AR) $(AROPT)
# Automatically append LDFLAGS and LDFLAGS_SL to SHLIB_LINK
SHLIB_LINK += $(LDFLAGS) $(LDFLAGS_SL)
ifdef SO_MAJOR_VERSION ifdef SO_MAJOR_VERSION
# Default library naming convention used by the majority of platforms # Default library naming convention used by the majority of platforms
ifeq ($(enable_shared), yes) ifeq ($(enable_shared), yes)
...@@ -355,7 +352,7 @@ ifneq ($(PORTNAME), aix) ...@@ -355,7 +352,7 @@ ifneq ($(PORTNAME), aix)
# Normal case # Normal case
$(shlib): $(OBJS) $(shlib): $(OBJS)
$(LINK.shared) -o $@ $(OBJS) $(SHLIB_LINK) $(LINK.shared) -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK)
ifdef shlib_major ifdef shlib_major
# If we're using major and minor versions, then make a symlink to major-version-only. # If we're using major and minor versions, then make a symlink to major-version-only.
ifneq ($(shlib), $(shlib_major)) ifneq ($(shlib), $(shlib_major))
...@@ -389,7 +386,7 @@ $(shlib) $(stlib): $(OBJS) ...@@ -389,7 +386,7 @@ $(shlib) $(stlib): $(OBJS)
$(LINK.static) $(stlib) $^ $(LINK.static) $(stlib) $^
$(RANLIB) $(stlib) $(RANLIB) $(stlib)
$(MKLDEXPORT) $(stlib) >$(exports_file) $(MKLDEXPORT) $(stlib) >$(exports_file)
$(COMPILER) -o $(shlib) $(stlib) -Wl,-bE:$(exports_file) $(SHLIB_LINK) $(COMPILER) -o $(shlib) $(stlib) -Wl,-bE:$(exports_file) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK)
rm -f $(stlib) rm -f $(stlib)
$(AR) $(AROPT) $(stlib) $(shlib) $(AR) $(AROPT) $(stlib) $(shlib)
...@@ -412,7 +409,7 @@ DLL_DEFFILE = lib$(NAME)dll.def ...@@ -412,7 +409,7 @@ DLL_DEFFILE = lib$(NAME)dll.def
endif endif
$(shlib): $(OBJS) $(DLL_DEFFILE) $(shlib): $(OBJS) $(DLL_DEFFILE)
$(DLLWRAP) -o $@ --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(DLL_DEFFILE) $(OBJS) $(SHLIB_LINK) $(DLLWRAP) -o $@ --dllname $(shlib) $(DLLWRAP_FLAGS) --def $(DLL_DEFFILE) $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK)
$(stlib): $(shlib) $(DLL_DEFFILE) $(stlib): $(shlib) $(DLL_DEFFILE)
$(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@ $(DLLTOOL) --dllname $(shlib) $(DLLTOOL_LIBFLAGS) --def $(DLL_DEFFILE) --output-lib $@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment