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

Re: patch for versioned symbols in Heimdal shared library



Brian May <bam@snoopy.debian.net> writes:
>>>>>> "Russ" == Russ Allbery <rra@debian.org> writes:

>     Russ> Out of curiosity, have you talked to Love about this issue
>     Russ> already?  Given that MIT Kerberos supports symbol versions
>     Russ> upstream, I'm a little surprised that Heimdal doesn't as
>     Russ> well, and I'd think that Love would at least be happy to
>     Russ> take a patch even if he doesn't have time to write it
>     Russ> himself.

> Anyone here willing to write such a patch if upstream would accept it?

> The current patch may not be acceptable, it modifies libtool.

I have some code that I use for other projects that supports doing symbol
versioning on Linux without modifying libtool (it just passes the
appropriate flags through libtool with -Wl).  I don't have a lot of time
to work on this, but I'm happy to provide those details to start people
off.

I do this in configure.ac:

dnl If and only if we're on Linux, use a mapfile to do symbol versioning.
dnl We'd like to do this on all platforms, but the syntax is different
dnl everywhere and I don't feel like dealing with the differences.
case "$host" in
*-linux*)
    VERSION_LDFLAGS="-Wl,--version-script=mapfile"
    ;;
*)
    VERSION_LDFLAGS=""
    ;;
esac
AC_SUBST([VERSION_LDFLAGS])

and then put a mapfile that contains the symbol versioning information in
each directory with a shared library.  Then, in the Makefile, just include
$(VERSION_LDFLAGS) in the arguments passed to libtool for the link.
(Heimdal uses Automake, so this means adding them to the appropriate
_LDFLAGS variable for each library.

If I remember the Heimdal build system properly, it builds only one shared
library in each directory, so this should work.  If multiple shared
libraries are built in a particular directory, you have to do something
more complicated.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: