Re: Linking problem with FreeBSD




Marc van Kempen <marc@bowtie.nl> writes:

> Hi,
> 
> Since of several releases ago there is an annoying problem with
> the gtk and glib releases (also tested on gtk+-1.1.15, and glib-1.1.15).
> 
> FreeBSD 2.2.6 (and 2.2.x?, I haven't been able to test that, FreeBSD 3.x
> should be ok since it's ELF) has a problem linking correctly.
>                                                                                 Because `gtk-config --libs` specifies -lgtk instead of -lgtk-1.1 it
> links with the static libraries.
> 
> There are two ways around this problem:
> 1. changce gtk-config to specify -lgtk-1.1 -lgdk-1.1 etc (same
>    problem for glib)

This is the correct thing to do, but I'd like to do it only
on platforms that actually require it.

In theory, this should be pretty simple - we need to specify
-lgtk-1.1 on platforms where the name of the file being 
linked against matters. This is, approximately what 
libtool calls version-type=sunos or version-type=freebsd-aout.

(All of libtools configuration that it decides upon can
 be accessed with ./libtool --config)

However, things are not quite so simple. Among platforms
with version-type=sunos, we have

HP/UX:
  library_name = libgtk-1.1.sl.14.1
  symlinks = libgtk-1.1.sl.14 libgtk.sl

[ But actually, though hp/ux 9-11 all have version-type = sunos,
  at least HP/UX 10-11 and maybe HP/UX 9 have a concept of soname, 
  so they don't actually fall into this category ]

net/openbsd:
  library_name = libgtk-1.1.so.14.1
  symlinks = NONE

sunos
  library_name = libgtk-1.1.so.14.1
  symlinks = libgtk.so.14.1

freebsd-elf:
  library_name = libgtk-1.1.so.14.1
  symlinks = libgtk.so


So it basically looks, to me, not having any of these
platforms to test:

 On Net/Open BSD, our current scheme doesn't work, and
 it should be easy to detect.

 On SunOS, our current scheme "works" but incorrrectly,
 $release ends up being ignored, because of an
 incorrect symlink.

 On freebsd-aout, our current scheme doesn't work 
 an incorrect symlink is created that confuses things.

So, I think, it might sort of work, to say

 "if the version_type is sunos, or freebsd-aout, and no
  soname_spec is set, then put -lgtk-1.1 into gtk-config."

I can implement that, and have some confidence that it
will at least improve things a bit, but I have the
strong feelings:
 
 a) I don't really understand the situation
 b) libtool has some problems with it's handling of $release
 
On freebsd-elf I have no idea how anything is working at all, if
it is, from reading the sources. FreeBSD-elf presumably has the
ability to set the soname, but libtool doesn't seem to be doing
so. When I asked one of the of the FreeBSD-ports people 
who was working on GLib about this, they sort of shrugged
and said: "we basically ignore the shared library versioning
that the package does and make up our own." Which
didn't exactly increase my confidence level.

Anybody who made it through the above, probably understands
why I've sort of given up, and am waiting for somebody
who understands, and has access to, *BSD boxes, to send
in patch to fix things.

> 2. Add an extra symbolic link
> 
>         Currently these links are being made:
> 
>         libgdk-1.1.so.14.1                                                              libgdk.a
>         libgdk.la
>         libgdk.so -> libgdk-1.1.so.14.1
> 
>         Adding this link solves the problem:
> 
>         libgdk.so.14.1 -> libgdk-1.1.so.14.1

This is an incorrect link, because it defeats our
naming scheme. Once we have a 1.3 development
branch, we might eventually have a libgdk-1.3.so.14.1,
which will be incompatible with libgdk-1.1.so.14.1.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]