Subject: Re: shared libraries, slow progress
To: Erik Bertelsen <erik@sockdev.uni-c.dk>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 12/04/1996 12:59:12
Erik Bertelsen writes:

>I notice that the .so libraries are being built from the same .o files as
>the .a libraries. But this is also the case with libbfd and libopcodes in
>binutils. Is this a consequence of elf or of using a more "standard"
>gnu toolchain?

This is an artifact of  Manuel's patches, which AFAIK is in turn
an artifact of how OpenBSD generates .o files for mips/elf.

The alternative is to produce the old-style, static, non-PIC, .o files
for the statically libraries (e.g., libc.a, vs. libc.so and
libc_pic.a).  That would save about 15% and sometimes more like 40%
for statically linked binaries, over using the PIC shared-library .o
format for all .o files.  The downside is having to specify -static
(or -mno-half-pic -mno-abicalls) when compiling all statically-linked
objects.

This is _precisely_ the question I thought I asked for feed-back on,
here: whether it's better to do what other NetBSD ports do, and make
``pic'' code the default -- as the snapshot does -- or to build
non-PIC static libraries (libc.a).  The problem is linking a mixture
of PIC and non-PIC .o files together.  If you try, the linker produces
error messages saying it can't do this, though the resulting binaries
may actually work.

The cost of having non-PIC libc.a is that users who _want_ to build
statically-linked binaries now have to give extra, nonstandard
arguments when compiling their own .o files.

So, if anyone has an opinion on which way to go, now is the
time to express it :).



[Problems with ld.so and  shared-lib names: libtelnet.so/libtelnet.so.1.0]

The ld.so in the snapshot is, AFAIK, an OpenBSD snapshot, derived in
turn from the i386 Linux (GNU) ELF ld.so.  The library naming
conventions used by this ld.so, and it ldconfig, are a bad fit for the
NetBSD library naming conventions.  Yes, you need all those symlinks.

my hope here is that someone will port the ELF ld.so being used on
NetBSD/Alpha, which is derived from FreeBSD's ld.so and is a much
better fit for NetBSD.

[partial ldd port]

hey, that's neat, thanks. Don't forget to send a PR or patches
when you're done.

--Jonathan