Обсуждение: Solaris SONAME not matching libraries

Поиск
Список
Период
Сортировка

Solaris SONAME not matching libraries

От
Mark Round
Дата:
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
:wq



Re: Solaris SONAME not matching libraries

От
Tom Lane
Дата:
Mark Round <mark@markround.com> writes:
> 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

Re: Solaris SONAME not matching libraries

От
Zdenek Kotala
Дата:
Tom Lane wrote:
> Mark Round <mark@markround.com> writes:
>> 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

Re: Solaris SONAME not matching libraries

От
Mark Round
Дата:
> 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

Re: Solaris SONAME not matching libraries

От
Tom Lane
Дата:
Mark Round <mark@markround.com> writes:
>> 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