Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 346900e

Browse files
committed
Fix shared library linking operations to work properly on all (or at
least more) combinations of HP-UX hardware, compiler, and linker. Shinji Teragaito and Tom Lane.
1 parent cb79234 commit 346900e

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

src/Makefile.shlib

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.77 2004/07/13 00:06:46 tgl Exp $
9+
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.78 2004/09/02 23:06:43 tgl Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -148,10 +148,14 @@ endif
148148

149149
ifeq ($(PORTNAME), hpux)
150150
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
151-
LINK.shared = $(LD) +h $(soname) -b +b $(libdir)
152151
ifeq ($(GCC), yes)
153152
SHLIB_LINK += `$(CC) -print-libgcc-file-name`
154153
endif
154+
ifeq ($(with_gnu_ld), yes)
155+
LINK.shared = $(CC) $(LDFLAGS) -shared -Wl,-h -Wl,$(soname)
156+
else
157+
LINK.shared = $(LD) +h $(soname) -b +b $(libdir)
158+
endif
155159
endif
156160

157161
ifeq ($(PORTNAME), irix)

src/makefiles/Makefile.hpux

+27-6
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,27 @@ ifeq ($(HAVE_POSIX_SIGNALS), no)
1111
LIBS := -lBSD $(LIBS)
1212
endif
1313

14+
# Using X/Open Networking Interfaces requires to link with libxnet.
15+
# Without specifying this, bind(), getpeername() and so on don't work
16+
# correctly in the LP64 data model.
17+
LIBS := -lxnet $(LIBS)
18+
1419
# Embed 'libdir' as the shared library search path so that the executables
1520
# don't need SHLIB_PATH to be set. (We do not observe the --enable-rpath
1621
# switch here because you'd get rather bizarre behavior if you leave this
1722
# option off.)
18-
LDFLAGS += -Wl,+b -Wl,$(libdir)
23+
ifeq ($(with_gnu_ld), yes)
24+
LDFLAGS += -Wl,-rpath -Wl,$(libdir)
25+
else
26+
LDFLAGS += -Wl,+b -Wl,$(libdir)
27+
endif
1928

2029
# catch null pointer dereferences
21-
LDFLAGS += -Wl,-z
30+
ifeq ($(with_gnu_ld), yes)
31+
# XXX what to put here?
32+
else
33+
LDFLAGS += -Wl,-z
34+
endif
2235

2336
# set up appropriate options for shared library builds
2437
export_dynamic = -Wl,-E
@@ -28,16 +41,24 @@ INSTALL_SHLIB_OPTS = -m 555
2841

2942
AROPT = crs
3043

31-
DLSUFFIX = .sl
44+
ifeq ($(host_cpu), ia64)
45+
DLSUFFIX = .so
46+
else
47+
DLSUFFIX = .sl
48+
endif
3249
ifeq ($(GCC), yes)
33-
CFLAGS_SL = -fpic
50+
CFLAGS_SL = -fpic
3451
else
35-
CFLAGS_SL = +z
52+
CFLAGS_SL = +z
3653
endif
3754

3855
# Rule for building shared libs (currently used only for regression test
3956
# shlib ... should go away, since this is not really enough knowledge)
40-
%.sl: %.o
57+
%$(DLSUFFIX): %.o
58+
ifeq ($(with_gnu_ld), yes)
59+
$(CC) $(LDFLAGS) -shared -o $@ $<
60+
else
4161
$(LD) -b -o $@ $<
62+
endif
4263

4364
sqlmansect = 5

0 commit comments

Comments
 (0)