Closed narc-Ontakac2 closed 1 year ago
@narc-Ontakac2: you accidentially created this in libsml instead of vzlogger, moved it over.
the final link command for vzlogger,
(as to be found by rm src/vzlogger ; make
or in src/CMakeFiles/vzlogger.dir/link.txt
)
mentions "static" a few times, i guess the purpose is to link the internal libraries libvz.a
libvz-api.a
libproto.a
statically,
but i guess this is recursively applies to external libraries used by those.
libidn and libgmp are actualy just the tip of the iceberg, libcurl is included too, and it's strings can be found - the binary is also exessively large! (curl then pulls in idn and gmp)
manually applying this after running cmake
but before linking fixes the issue:
sed -i 's/-Wl,-Bstatic//g;s/-Wl,-Bdynamic//g' src/CMakeFiles/vzlogger.dir/link.txt
we need to find out how to make cmake generate the link command correctly.
this might seem like a regression, but even a build from 2020 has this issue:
root@raspberrypi:~# ls -l /usr/local/bin/vzlogger
-rwxr-xr-x 1 root root 8184908 May 6 2020 /usr/local/bin/vzlogger
root@raspberrypi:~# strings /usr/local/bin/vzlogger |grep punycode
[...]
string contains invalid punycode data
punycode encoded data will be too large
punycode conversion resulted in overflow
[...]
It may be an improved or fixed lintian that now detects it.
Curl is not affected, the CURL messages are from the vzlogger src.
strings /usr/lib/x86_64-linux-gnu/libcurl.so.4.8.0 | grep CURL:
finds nothing.
thanks, even if it's not curl, it's still striking how this bloats the binary by several megabytes, so it's probably more than idn and gmp.
[~/vzlogger]$ strip src/vzlogger
[~/vzlogger]$ du -h src/vzlogger
4.4M src/vzlogger
[~/vzlogger]$ sed -i 's/-Wl,-Bstatic//g;s/-Wl,-Bdynamic//g' src/CMakeFiles/vzlogger.dir/link.txt
[~/vzlogger]$ rm src/vzlogger
[~/vzlogger]$ make vlogger &>/dev/null
[~/vzlogger]$ strip src/vzlogger
[~/vzlogger]$ du -h src/vzlogger
1.3M src/vzlogger
``` ```
[~/vzlogger]$ du -sch /usr/lib/x86_64-linux-gnu/libidn2.a /usr/lib/x86_64-linux-gnu/libgmp.a
168K /usr/lib/x86_64-linux-gnu/libidn2.a
1.2M /usr/lib/x86_64-linux-gnu/libgmp.a
1.4M total
cmake -DENABLE_LOCAL=False
fixes the issue... so it's caused by microhttpd.
sudo rm /usr/lib/x86_64-linux-gnu/libmicrohttpd.a
also fixes it,
looks like microhttpd prefers static linking, and if it does, also pulls in the other libraries.
can't see the code responsible for that yet.
@narc-Ontakac2: can you test #587 ?
debuild is giving a lintian error about libgmp and libidn2 beeing statically linked. ldd says they are linked dynamically:
The lintian warnings are however coming from looking for strings in the binary, see
These strings are actually present in the vzlogger binary.
I am looking into this but I am grateful for any hints on what is going on here.