Skip site navigation (1) Skip section navigation (2)

Re: pgsql/src Makefile.shlib

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql/src Makefile.shlib
Date: 2001-03-13 18:26:44
Message-ID: Pine.LNX.4.30.0103131915160.2274-100000@peter.localdomain (view raw, whole thread or download thread mbox)
Lists: 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

Peter Eisentraut      peter_e(at)gmx(dot)net

In response to


pgsql-committers by date

Next:From: Bruce MomjianDate: 2001-03-13 18:36:05
Subject: Re: pgsql/src Makefile.shlib
Previous:From: Bruce Momjian - CVSDate: 2001-03-13 14:42:40
Subject: [WEBMASTER] 'www/html/users-lounge/docs faq.html'

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group