[Top][All Lists]

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

Re: providing a libidn compatibility API

From: Nikos Mavrogiannopoulos
Subject: Re: providing a libidn compatibility API
Date: Tue, 14 Feb 2017 20:54:54 +0100

On Tue, Feb 14, 2017 at 10:07 AM, Tim Ruehsen <address@hidden> wrote:
>> > Interesting, that would affect gnutls as well since it is also using
>> > libunistring that way.
>> Actually it doesn't. I had made a separate library with unistring
>> which was only being included if libunistring was not available. I
>> attempted to do something similar for libidn2 at:
>> Note however that in libidn2 you had two states. Have libunistring
>> available with uc_joining_type imported from a local copy from
>> unistring (latest), and have libunistring containing everything. For
>> the simplicity of the fix above, I've switched to have a sufficiently
>> new libunistring, vs have no libunistring. That means of course that
>> the newer (and bigger) libunistring will enter on systems without
>> 0.9.6.
> Libidn2 is built with libtool which uses the linker flag --whole-archive for
> libgnu.a:
> libtool: link: gcc -shared  -fPIC -DPIC  .libs/idna.o .libs/decode.o .libs/
> lookup.o .libs/register.o .libs/bidi.o .libs/version.o .libs/error.o .libs/
> punycode.o .libs/free.o .libs/data.o .libs/tr46map.o .libs/tables.o .libs/
> context.o  -Wl,--whole-archive lib/.libs/libgnu.a -Wl,--no-whole-archive  -
> lunistring  -g -Wl,--version-script=./   -Wl,-soname -Wl,
> -o .libs/
> This adds everything from libgnu.a to, if needed or not.

That's right, but there is little gnulib can help here. Imagine a
libunistring on the system supporting unicode 6, while the gnulib
supporting unicode 7. It would really take a complex algorithm to
decide which functions can get in and which not. I think it makes
sense to keep things simple and require the latest libunistring, or
use the included otherwise.

> The issue is gone when removing --whole-archive. Everything links fine and the
> tests work. But I have no clue how to tell libtool that it should not use --
> whole-archive. Any idea ?

No idea.


PS. I've split the patches on the previous request to split lib from
unistring and move the main library to idn2/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]