Subject: Re: Libtool on NetBSD/ELF
To: Nick Hudson <>
From: Steinar Hamre <>
List: tech-pkg
Date: 10/02/2000 16:42:36
Nick Hudson <> writes:

> It looks as though you are using the 1.3.5 distribution which does have
> problems for NetBSD.

That's exactly why I've fixed it locally. But the -module-bug has
existed since 1.3.2 at least, probably always. (One can argue if it's
a bug or not, libtool inludes a libary with dlopen() for ar-archives
of PIC-objects. However, most programs linking to theese modules will
not use this libary, but the native dlopen()...)

> Steinar Hamre wrote:
> > Ok, everyone hates libtool for always beeing so wrong. But we still
> > have to fix it. libtool -module on netbsd/elf creates an 'ar'-archive,
> > and *wow* that does not work with dlopen(). So I've tried fixing
> > libtool on netbsd/elf a little bit. It would be very nice if somebody
> > told me if I'm doing anything awfully wrong before i send this to the
> > libtool maintainers.
> > 
> > First,echo __ELF__ | $CC -E - | grep __ELF__is true if the the
> > toolcain is *not* elf. So the first test was inversed.
> This is fixed in the pkgsrc libtool.

Good. I couldn't really imagine that passing unnotised. (I am *not*
using pkgsrc, I'm compiling for a large number of different OS/arches
using the STORE system. I posted here because I figured this is where
I might find other people interested in libtool & NetBSD.)

> This is in the libtool cvs repository along with hardcode_into_libs=yes
> This is in pkgsrc and cvs libtool.

Very good. I was worried because very little seemed to have happened
since 1.3.2.

> > The (seriosly misnamed) version_type `linux' seems to be the most
> > sensible one. It's used by most elf and ecoff platforms. The only real
> > alternative is `freebsd-elf'. The difference is: `linux' uses 3-digit
> > versioning$major.$age.$minor (major=$current-$age) whereas
> > `freebsd-elf' uses 1-digit versioning$current
> I've not look at this one...

I think you should. Currenly `sunos' is used for NetBSD/aout and elf.
version_type=sunos is *not* meant for ELF, and does not set any soname
at all! (you do not get *any* versioning).

version_type=linux generates libaries in the same manner as the NetBSD
base system, so I suppose you should go for that.
version_type=freebsd_elf is a bit weird.

> > $ libtool --mode=link gcc -version-info 6:1:4 [...]   will create
> > (soname  using `version_type=linux'
> >     (soname  using `version_type=freebsd-elf'
> I presume the 2 in a typo?!?

No it's not. That is why I included this example. (major=$current-$age)
The $age is supposed to show how many versions this release is backwards
compatible. However, $age is very seldom used (probably because it is not
very well understood.)