Re: pgsql/src Makefile.shlib - Mailing list pgsql-committers

From Peter Eisentraut
Subject Re: pgsql/src Makefile.shlib
Date
Msg-id Pine.LNX.4.30.0103131915160.2274-100000@peter.localdomain
Whole thread Raw
In response to Re: pgsql/src Makefile.shlib  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql/src Makefile.shlib
List pgsql-committers
Tom Lane writes:

> I tried this and realized that it does not work unless I make
>     shlib_symbolic = -Bsymbolic
> rather than
>     shlib_symbolic = -Wl,-Bsymbolic
> as is done on all the other platforms that define this symbol.
> Reason: we build shlibs by invoking the linker directly, not
> via the compiler, on HPUX.

This is fine.  Different platforms, different habits.

> AFAICT, our practice for the other platforms that invoke the linker
> directly is to include options directly into the LINK.shared macro;

LINK.shared should include the command line necessary to link a shared
library, no matter if the linker, the compiler driver, or what else is
running behind the scenes.  On a GCC/ELF platform it may be simply

    $(CC) -shared

on others it can invoke the linker with special options or what not.

> see for example the *bsd and sunos4 entries in Makefile.shlib.

Note that in sunos

    $(LD) -assert pure-text -Bdynamic

the -Bdynamic option is not the same as the -Bsymbolic option.  -Bdynamic
simply means "create a shared library".  (Not sure about the -assert
thing, I think it ensures that the library is somewhat self contained.)

Also, the *bsd lines you might be referring to

    $(LD) -x -Bshareable -Bforcearchive

the -Bshareable is the flag to make a shared library, -Bforcearchive is
completely unnecessary, and -x says "Discard all local symbols in the
input files.", whatever that may mean.  (In fact, I'm fairly convinced
that this is not the recommended way to link shared libraries on these
systems, but I don't have enough enthusiasm to amend this.)

> These examples are why I added -Bsymbolic to HPUX's LINK.shared in the
> first place, and I'm now inclined to leave it that way.  Comments?

Well, this is not really related.  Makefile.shlib and LINK.shared say
"link a shared library in some default way".  The shlib_symbolic macro
says "link a shared library in some other way".  Now you can postulate the
"other way" to be the new "default way", but at least that's how the setup
is.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


pgsql-committers by date:

Previous
From: Bruce Momjian - CVS
Date:
Subject: pgsql/doc FAQ src/FAQ/FAQ.html
Next
From: Bruce Momjian
Date:
Subject: Re: pgsql/src Makefile.shlib