[Top][All Lists]

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

Re: _idn2_punycode_decode undefined for static linkage

From: Todd Richmond
Subject: Re: _idn2_punycode_decode undefined for static linkage
Date: Tue, 25 Jan 2022 05:15:28 +0000
User-agent: Microsoft-MacOutlook/16.57.22011101

Thx for follow-up.

I confirmed that code is only making calls to new idn2 functions 
(idn2_lookup_u8, idn2_to_unicode_8z8z) and not the punycode functions.

Not sure why my build can't link, but I ended up disabling the 
HAVE_SYMVER_ALIAS_SUPPORT compile flag and everything works fine. I'm only 
using this for a small feature set and the extra static link size is not a 
problem for the simplicity it gains

I do build both static and dynamic libraries so that might be a difference


On 1/22/22, 10:28 AM, "Tim Rühsen" <> wrote:

    On 22.01.22 01:43, Todd Richmond wrote:
    > Using latest libidn 2.3.2 compiled from source with gcc 11 on Linux, it 
    > looks like the 2.3.0 version changes that modified the 
    > _/idn2_punycode/_decode symbol for shared libraries causes static 
    > linkage to fail. I can link against the .so correctly, but linking 
    > against the .a causes the following error

    You are absolutely sure that your application code doesn't use
    _idn2_punycode_decode() directly ?

    Because I can't reproduce this problem on Debian with
    $ gcc --version
    gcc (Debian 11.2.0-14) 11.2.0


    ./configure --enable-static --disable-shared
    make clean

    see `ldd src/idn2` - libidn2.a has been statically linked into it.

    > ld: error: symbol _idn2_punycode_decode has undefined version IDN2_0.0.0

    The library offers two symbols (nm -a libidn2.a)
    0000000000000000 T _idn2_punycode_decode
    0000000000000000 T _idn2_punycode_decode@IDN2_0.0.0

    The code to generate this is in lib/puny_decode.c:

    /* Create a compatibility symbol if supported.  Hidden references make
        the target symbol hidden, hence the alias.  */
    __typeof__ (_idn2_punycode_decode_internal) _idn2_punycode_decode
       __attribute__((visibility ("default"),
                      alias ("_idn2_punycode_decode_internal")));
    __asm__ (".symver _idn2_punycode_decode, _idn2_punycode_decode@IDN2_0.0.0");

    > Any possible workaround or compile change I need to make?

    Possible solutions / work-arounds:

    a) if you use _idn2_punycode_decode(): replace that with the appropriate 
    idn2_to_ascii function.

    b) In `config.h`, comment out the line that defines 
    HAVE_SYMVER_ALIAS_SUPPORT and `make clean && make` to build the library 
    again (check with nm -a that _idn2_punycode_decode@IDN2_0.0.0 is gone).

    See also

    Regards, Tim

    > Thx…

reply via email to

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