Fix for HP-UX shared library builds - Mailing list pgsql-patches
From | Giles Lean |
---|---|
Subject | Fix for HP-UX shared library builds |
Date | |
Msg-id | 4171.1040683078@hpchs.cup.hp.com Whole thread Raw |
Responses |
Re: Fix for HP-UX shared library builds
Re: Fix for HP-UX shared library builds |
List | pgsql-patches |
[ Take #3: send the mail *with* the patch (problem #1), send if *from* an address that is subscribed to the list (problem #2). It's time for me to shut my brain down for Christmas. --giles ] Hi, Below is a patch against 7.3.1 that makes shared library major numbers useful on HP-UX. Without this patch PostgreSQL builds on HP-UX install libraries without internal names, with the result that applications link to 'libpq.sl' without a version number. With the patch below the following changes are made: 1. libraries have an internal name set with ld +h 2. a symbolic link is created from the non-version name to the version name, that is (on a patched 7.3.1 install): $ ls -l libpq* -rw-r--r-- 1 root sys 164330 Dec 24 08:43 libpq.a lrwxrwxrwx 1 root sys 10 Dec 24 08:43 libpq.sl -> libpq.sl.3 -r-xr-xr-x 1 root sys 159744 Dec 24 08:43 libpq.sl.3 instead of (on an unpatched 7.2.3 install): $ ls -l libpq* -rw-r--r-- 1 root users 103544 Oct 6 14:54 libpq.a -r-xr-xr-x 1 root users 102400 Oct 6 14:54 libpq.sl lrwxr-xr-x 1 root users 8 Oct 6 14:54 libpq.sl.2 -> libpq.sl 3. applications link to the versioned library $ /usr/ccs/bin/ldd psql /usr/lib/libm.2 => /usr/lib/libm.2 /usr/lib/libnsl.1 => /usr/lib/libnsl.1 /usr/lib/libxti.2 => /usr/lib/libxti.2 /usr/lib/libdld.2 => /usr/lib/libdld.2 /usr/lib/libc.2 => /usr/lib/libc.2 /usr/lib/libdld.2 => /usr/lib/libdld.2 /usr/lib/libgen.2 => /usr/lib/libgen.2 /usr/lib/libc.2 => /usr/lib/libc.2 ../../../src/interfaces/libpq/libpq.sl.3 => /opt/pgsql-7.3.1/lib/libpq.sl.3 /usr/lib/libnsl.1 => /usr/lib/libnsl.1 instead of: $ /usr/ccs/bin/ldd psql /usr/lib/libm.2 => /usr/lib/libm.2 /usr/lib/libnsl.1 => /usr/lib/libnsl.1 /usr/lib/libxti.2 => /usr/lib/libxti.2 /usr/lib/libdld.2 => /usr/lib/libdld.2 /usr/lib/libc.2 => /usr/lib/libc.2 /usr/lib/libdld.2 => /usr/lib/libdld.2 /usr/lib/libgen.2 => /usr/lib/libgen.2 /usr/lib/libc.2 => /usr/lib/libc.2 ../../../src/interfaces/libpq/libpq.sl => /opt/pgsql-7.2.3/lib/libpq.sl /usr/lib/libnsl.1 => /usr/lib/libnsl.1 I have tested this patch on: HP-UX 11.11, HP ANSI C compiler, 64 bit and 32 bit builds HP-UX 11.11, gcc, 32 bit build HP-UX 11.00, HP ANSI C compiler, 32 bit build HP-UX 10.20, HP ANSI C compiler 'gmake check' passed in all cases, and the installed library paths were correct. Having checked 10.20, 11.00, 11.11 and both gcc and the HP ANSI C compiler I think this patch is safe to commit, and I request that it be applied both to the HEAD and the 7.3.x branch. Regards, Giles *** src/Makefile.shlib-orig Wed Oct 9 09:21:54 2002 --- src/Makefile.shlib Sun Dec 22 21:07:43 2002 *************** *** 126,134 **** endif ifeq ($(PORTNAME), hpux) ! # HPUX doesn't believe in version numbers for shlibs ! shlib := lib$(NAME)$(DLSUFFIX) ! LINK.shared = $(LD) -b +b $(libdir) endif ifeq ($(PORTNAME), irix5) --- 126,133 ---- endif ifeq ($(PORTNAME), hpux) ! shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) ! LINK.shared = $(LD) +h $(shlib) -b +b $(libdir) endif ifeq ($(PORTNAME), irix5)
pgsql-patches by date: