This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Of libgcc -pic and -shared and openbsd config
- To: Marc Espie <espie at quatramaran dot ens dot fr>
- Subject: Re: Of libgcc -pic and -shared and openbsd config
- From: Richard Henderson <rth at cygnus dot com>
- Date: Tue, 26 Sep 2000 14:11:55 -0700
- Cc: gcc at gcc dot gnu dot org
- References: <20000919193155.A4064@quatramaran.ens.fr>
On Tue, Sep 19, 2000 at 07:31:55PM +0200, Marc Espie wrote:
> Note that I believe a separate t-openbsd/t-openbsd-old makes sense,
> even though they `share' a large part, the idea being that t-openbsd-old
> is somewhat broken, and not to use for anything else.
I think it's better to just add a new entry to the tmake list
for 2.8, similar to config/i386/t-crtpic.
> The last issue is the libc spec change for -shared... like FreeBSD does,
> I think we ought not to link against libc by default for shared libraries
> (especially since we have a shared libc). Opinions ?
This is a big mistake.
Always link against every DSO that you depend on. Always.
Linking against dependant libraries has multiple benefits:
1. If you ever implement elf symbol versioning, linking against the
implementing library is critical to getting the .o symbols bound
to the correct version. Not an issue for you now, but maybe later.
2. It sets up the proper dependancy graph between the DSOs. This
dependancy graph influences the order in which libraries are
initialized.
3. Having the explicit dependancy on the libraries providing the
symbols used by your new DSO ensures that they will be present
when dlopen'ing your new DSO.
Points 2 and 3 generally tend to cause more problems when the
dependancies are not present for libraries other than libc, since
libc tends to always be present. But making an exception to the
general rule for no good reason is bad.
r~