I wrote:
> What exactly is in /client/lib ... could it be that there is an existing
> SSL-dependent installation of libpq in there? In theory the link should
> find the libpq in ../../../../src/interfaces/libpq not the one in
> /client/lib, but we've seen bizarre linker search behavior before ...
Actually, not so bizarre as all that: looking at your command again, the
-L/client/lib is in there twice:
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wendif-labels
-fno-strict-aliasing -L../../../../src/port -L/client/lib -Wl,-bnoentry
-Wl,-H512 -Wl,-bM:SRE -o libecpg.so libecpg.a -Wl,-bE:libecpg.exp
-L../pgtypeslib -L../../../../src/interfaces/libpq -L../../../../src/port
-L/client/lib -lpgtypes -lpq -lm
Assuming there is a libpq in /client/lib, I bet this patch will help.
regards, tom lane
*** src/Makefile.shlib.orig Fri Oct 28 13:32:22 2005
--- src/Makefile.shlib Sat Dec 3 14:58:32 2005
***************
*** 76,81 ****
--- 76,84 ----
# Insert -L from LDFLAGS after any -L already present in SHLIB_LINK
SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) $(filter -L%, $(LDFLAGS)) $(filter-out -L%, $(SHLIB_LINK))
+ # Need a -L-free version of LDFLAGS to use in combination with SHLIB_LINK
+ LDFLAGS_NO_L := $(filter-out -L%, $(LDFLAGS))
+
# Default shlib naming convention used by the majority of platforms
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
shlib_major = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
***************
*** 154,160 ****
ifeq ($(PORTNAME), hpux)
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
ifeq ($(with_gnu_ld), yes)
! LINK.shared = $(CC) $(LDFLAGS) -shared -Wl,-h -Wl,$(soname)
else
# can't use the CC-syntax rpath pattern here
rpath =
--- 157,163 ----
ifeq ($(PORTNAME), hpux)
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
ifeq ($(with_gnu_ld), yes)
! LINK.shared = $(CC) $(LDFLAGS_NO_L) -shared -Wl,-h -Wl,$(soname)
else
# can't use the CC-syntax rpath pattern here
rpath =
***************
*** 309,315 ****
# AIX case
$(shlib): lib$(NAME).a
$(MKLDEXPORT) lib$(NAME).a > lib$(NAME)$(EXPSUFF)
! $(COMPILER) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $< -Wl,-bE:lib$(NAME)$(EXPSUFF) $(SHLIB_LINK)
endif # PORTNAME == aix
--- 312,318 ----
# AIX case
$(shlib): lib$(NAME).a
$(MKLDEXPORT) lib$(NAME).a > lib$(NAME)$(EXPSUFF)
! $(COMPILER) $(LDFLAGS_NO_L) $(LDFLAGS_SL) -o $@ $< -Wl,-bE:lib$(NAME)$(EXPSUFF) $(SHLIB_LINK)
endif # PORTNAME == aix