Discussion:
[PORTS] Solaris SONAME not matching libraries
(too old to reply)
Mark Round
2007-05-28 15:15:18 UTC
Permalink
--Apple-Mail-1-193842441
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

Hi all,

I have noticed some odd behaviour under Solaris when various
libraries are installed from the source package. Using 8.2.4 tarballs
on Solaris 8, Sun Studio 11 (cc: Sun C 5.8 Patch 121016-05
2007/01/10), I get the following behaviour (using plpgsql.so as an
example, there are many others) :

# elfdump -d plpgsql.so | grep SONAME
[2] SONAME 0x10da libplpgsql.so.1

As you can see, the file is installed with the name "plpgsql.so",
although it's SONAME according to elfdump is set to libplpgsql.so.1.

Why the discrepancy ?

Many thanks in advance for any pointers, advice etc.

-Mark

--
Mark Round
***@markround.com
:wq




--Apple-Mail-1-193842441
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=ISO-8859-1

<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; ">Hi all,<DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>I have noticed some odd =
behaviour under Solaris when various libraries are installed from the =
source package. Using 8.2.4 tarballs on Solaris 8, Sun Studio 11 (cc: =
Sun C 5.8 Patch 121016-05 2007/01/10), I get the following behaviour =
(using plpgsql.so as an example, there are many others) :</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV># elfdump -d plpgsql.so | =
grep SONAME=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 </DIV><DIV>=A0 =A0 =A0=A0 =
[2]=A0 SONAME=A0 =A0 =A0 =A0 =A0=A0 0x10da=A0 =A0 =A0 =A0 =A0 =A0 =
libplpgsql.so.1</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>As you can see, the file is =
installed with the name "plpgsql.so", although it's SONAME according to =
elfdump is set to libplpgsql.so.1.=A0</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>Why the discrepancy =
?=A0</DIV><DIV><BR class=3D"khtml-block-placeholder"></DIV><DIV>Many =
thanks in advance for any pointers, advice etc.</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>-Mark</DIV><DIV><BR><DIV> =
<SPAN class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; =
"><DIV>--</DIV><DIV>Mark Round</DIV><DIV><A =
href=3D"mailto:***@markround.com">***@markround.com</A></DIV><DIV>:wq</D=
IV><DIV><BR class=3D"khtml-block-placeholder"></DIV><BR =
class=3D"Apple-interchange-newline"></SPAN> =
</DIV><BR></DIV></BODY></HTML>=

--Apple-Mail-1-193842441--
Tom Lane
2007-05-28 17:05:37 UTC
Permalink
Post by Mark Round
As you can see, the file is installed with the name "plpgsql.so",
although it's SONAME according to elfdump is set to libplpgsql.so.1.
Why the discrepancy ?
It's an artifact of the Makefile rules we use to generate shared
libraries --- Makefile.shlib insists on building any shared library
under the name 'libsomething'. Is it important enough to fix?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
Zdenek Kotala
2007-05-29 12:24:21 UTC
Permalink
Post by Tom Lane
Post by Mark Round
As you can see, the file is installed with the name "plpgsql.so",
although it's SONAME according to elfdump is set to libplpgsql.so.1.
Why the discrepancy ?
It's an artifact of the Makefile rules we use to generate shared
libraries --- Makefile.shlib insists on building any shared library
under the name 'libsomething'. Is it important enough to fix?
I think it is minor bug. SONAME is used by linker to setup dependencies
(NEEDED) in a final binary. Plpgsql is loaded dynamically and postmaster
is not linked with this library directly. It means that this problem
does not occur anywhere. I don't expect that somebody will link these
libraries and create separate binary.

However, if I look into lib directory there are only five libraries with
lib prefix and 60 without prefix.

I suggested to introduce SO_PREFIX variable which will be used for
affected five libraries in their makefiles. And also adjust pgxs.mk to
keep name untouched.


Zdenek

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ***@postgresql.org so that your
message can get through to the mailing list cleanly
Mark Round
2007-05-29 21:04:15 UTC
Permalink
Post by Zdenek Kotala
I think it is minor bug. SONAME is used by linker to setup
dependencies (NEEDED) in a final binary.
This is the reason that was given to me by a developer - they were
trying to link against one of these libraries, and the linker was
putting the wrong thing in the NEEDED dependency - the value of
SONAME, which referred to a non-existant file. The plpgsql.so file
was just to give an example, like you say there are many more of
these libraries in lib/ .

-Mark

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ***@postgresql.org so that your
message can get through to the mailing list cleanly
Tom Lane
2007-05-29 21:25:04 UTC
Permalink
Post by Mark Round
Post by Zdenek Kotala
I think it is minor bug. SONAME is used by linker to setup
dependencies (NEEDED) in a final binary.
This is the reason that was given to me by a developer - they were
trying to link against one of these libraries,
The question is why they were trying to do that; there's no point in
it that I can see for any dynamically loaded pgsql module.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Loading...