[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: _idn2_punycode_decode undefined for static linkage
From: |
Tim Rühsen |
Subject: |
Re: _idn2_punycode_decode undefined for static linkage |
Date: |
Sat, 22 Jan 2022 19:28:26 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
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
and
./configure --enable-static --disable-shared
make clean
make
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. */
#ifdef HAVE_SYMVER_ALIAS_SUPPORT
__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
https://gitlab.com/libidn/libidn2/-/merge_requests/82
https://gitlab.com/libidn/libidn2/-/issues/74
Regards, Tim
Thx…
OpenPGP_signature
Description: OpenPGP digital signature