shared lib names

Started by Zeugswetter Andreas IZ5over 26 years ago10 messages
#1Zeugswetter Andreas IZ5
Andreas.Zeugswetter@telecom.at

Why are our shared libs called e.g. ecpg.so and not libecpg.so ?
This seems strange to me, and it also complicates the link,
since now I cannot say -lecpg and decide whether to link static or shared
with the corresponding linker flag (-bnso or -brtl on AIX)

Andreas

#2Thomas Lockhart
lockhart@alumni.caltech.edu
In reply to: Zeugswetter Andreas IZ5 (#1)
Re: [HACKERS] shared lib names

Why are our shared libs called e.g. ecpg.so and not libecpg.so ?

Uh, they aren't on at least some platforms. Here is the lib directory
on my linux box:

global1.bki.source libpq++.so.3.0
global1.description libpq.a
libecpg.a libpq.so
libecpg.so libpq.so.2
libecpg.so.3 libpq.so.2.0
libecpg.so.3.0.0 libpsqlodbc.a
libpgtcl.a libpsqlodbc.so
libpgtcl.so libpsqlodbc.so.0
libpgtcl.so.2 libpsqlodbc.so.0.25
libpgtcl.so.2.0 local1_template1.bki.source
libpq++.a local1_template1.description
libpq++.so pg_geqo.sample
libpq++.so.2 pg_hba.conf.sample
libpq++.so.2.0 plpgsql.so
libpq++.so.3 pltcl.so

??

- Thomas

--
Thomas Lockhart lockhart@alumni.caltech.edu
South Pasadena, California

#3Zeugswetter Andreas IZ5
Andreas.Zeugswetter@telecom.at
In reply to: Thomas Lockhart (#2)
Re: [HACKERS] shared lib names

Thomas wrote:

Why are our shared libs called e.g. ecpg.so and not libecpg.so ?

Uh, they aren't on at least some platforms. Here is the lib directory
on my linux box:

Sorry Bruce, please can you make that change to my patch:

- shlib := $(NAME)$(DLSUFFIX)

+ shlib
:= lib$(NAME)$(DLSUFFIX)

Andreas

#4Zeugswetter Andreas IZ5
Andreas.Zeugswetter@telecom.at
In reply to: Zeugswetter Andreas IZ5 (#3)
AW: [HACKERS] shared lib names

Why are our shared libs called e.g. ecpg.so and not libecpg.so ?

Uh, they aren't on at least some platforms. Here is the lib directory
on my linux box:

Ok, sorry I see the difference now. Those that are for linking are named
lib*.so
and those that are for dyn loading into postgres don't have the lib.
Good, thanks.

Andreas

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Zeugswetter Andreas IZ5 (#4)
Re: AW: [HACKERS] shared lib names

Zeugswetter Andreas IZ5 <Andreas.Zeugswetter@telecom.at> writes:

Ok, sorry I see the difference now. Those that are for linking are named
lib*.so
and those that are for dyn loading into postgres don't have the lib.

What? They should all have the "lib" AFAIK --- dynamic loading takes
the same kind of shared lib as a regular link does on every platform
I've heard about.

I think you were just fooled by having misspelled the "shlib" variable
the first time around... or, perhaps, our dynlink support for aix
is confused too?

regards, tom lane

#6Mark Hollomon
mhh@nortelnetworks.com
In reply to: Tom Lane (#5)
Re: AW: [HACKERS] shared lib names

Tom Lane wrote:

Zeugswetter Andreas IZ5 <Andreas.Zeugswetter@telecom.at> writes:

Ok, sorry I see the difference now. Those that are for linking are named
lib*.so
and those that are for dyn loading into postgres don't have the lib.

What? They should all have the "lib" AFAIK --- dynamic loading takes
the same kind of shared lib as a regular link does on every platform
I've heard about.

I don't know about 'should' but they definitely are not required
to have it.

As Andreas said, the reason for the 'lib' prefix is to allow the -l
flag to the linker to work. What you pass to dlopen is the path to the
file, so
it can have any name you want. Generally (may be some platform this
isn't true)
you don't even have to have a magic suffix.

--

Mark Hollomon
mhh@nortelnetworks.com
ESN 451-9008 (302)454-9008

#7Zeugswetter Andreas
andreas.zeugswetter@telecom.at
In reply to: Mark Hollomon (#6)
Re: AW: [HACKERS] shared lib names

Ok, sorry I see the difference now. Those that are for linking are named
lib*.so
and those that are for dyn loading into postgres don't have the lib.

What? They should all have the "lib" AFAIK --- dynamic loading takes
the same kind of shared lib as a regular link does on every platform
I've heard about.

We are only talking about the naming convention here.
e.g. libpq.so but plpgsql.so

I think you were just fooled by having misspelled the "shlib" variable
the first time around... or, perhaps, our dynlink support for aix
is confused too?

The dynlink support is broken for plpgsql.so on aix,
unless Bruce applies my patch, which I guess he did for current,
but not for the 6.5.1 branch.

Andreas

#8Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Zeugswetter Andreas (#7)
Re: AW: [HACKERS] shared lib names

[Charset iso-8859-1 unsupported, filtering to ASCII...]

Ok, sorry I see the difference now. Those that are for linking are named
lib*.so
and those that are for dyn loading into postgres don't have the lib.

What? They should all have the "lib" AFAIK --- dynamic loading takes
the same kind of shared lib as a regular link does on every platform
I've heard about.

We are only talking about the naming convention here.
e.g. libpq.so but plpgsql.so

I think you were just fooled by having misspelled the "shlib" variable
the first time around... or, perhaps, our dynlink support for aix
is confused too?

The dynlink support is broken for plpgsql.so on aix,
unless Bruce applies my patch, which I guess he did for current,
but not for the 6.5.1 branch.

I have not applied either yet. I want someone who understands this to
make the decision.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#8)
Re: AW: [HACKERS] shared lib names

Bruce Momjian <maillist@candle.pha.pa.us> writes:

The dynlink support is broken for plpgsql.so on aix,
unless Bruce applies my patch, which I guess he did for current,
but not for the 6.5.1 branch.

I have not applied either yet. I want someone who understands this to
make the decision.

OK, I'll take responsibility for it ...

The double underscore in 'SO__MINOR_VERSION' in the irix5 code is clearly
a typo and should be fixed, so I committed that into 6.5.1. However I
am leery of committing the AIX code into 6.5 with so little time left
before 6.5.1 release --- too much risk that there will be problems.
Seems better to leave shlibs unimplemented on AIX for 6.5.

I have committed both fixes into the main branch, however. Plenty of
time to find out if the AIX support has any problems before 6.6.

regards, tom lane

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#9)
Re: AW: [HACKERS] shared lib names

"Zeugswetter Andreas" <andreas.zeugswetter@telecom.at> writes:

What? They should all have the "lib" AFAIK --- dynamic loading takes
the same kind of shared lib as a regular link does on every platform
I've heard about.

We are only talking about the naming convention here.
e.g. libpq.so but plpgsql.so

Oh, right, I see your point. plpgsql.so isn't intended to ever be
statically linked so it needn't obey the "lib" naming convention.

Never mind ... ;-)

regards, tom lane