[Tarantool-patches] [PATCH] cmake: cleanup src/CMakeLists.txt

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Jun 18 02:09:14 MSK 2020


On 17/06/2020 17:29, Mavr Huston wrote:
> 
> EXPORT_LIST contains following libraries in case of static build (with normal build it's empty):
> 
> /usr/lib/x86_64-linux-gnu/libreadline.so
> 
> /usr/lib/x86_64-linux-gnu/libcurses.so
> 
> /usr/lib/x86_64-linux-gnu/libform.so
> 
> /usr/lib/x86_64-linux-gnu/libtinfo.so
> 
> /usr/lib/x86_64-linux-gnu/libz.so
> 
> /opt/local/lib/libssl.so
> 
> /opt/local/lib/libcrypto.so
> 
> /usr/lib/x86_64-linux-gnu/libz.so
> 
> /opt/local/lib/libicui18n.so
> 
> /opt/local/lib/libicuuc.so
> 
> /opt/local/lib/libicudata.so
> 
> 
> It doesn’t contains libcurl because it’s bundled statically. So it isn’t related to https://github.com/tarantool/tarantool/issues/4559but this problem may be solved with next patch: https://github.com/tarantool/tarantool/tree/rosik/refactor-static-build. At this patch added flag --disble-symbos-hiding (https://github.com/tarantool/tarantool/blob/rosik/refactor-static-build/cmake/BuildLibCURL.cmake#L93) at building libcurl and after that most of libcurl symbols are visible from tarantool binary

The problem is not in the hiding. It is about removal. Not used symbols from
static libs may be removed from the final executable. Hide or not hide rules
are applied to what is left. That is the single reason why we had exports file
before 2971 and have exports.h and exports.c now. You can try it by yourself -
just add an unused function to lib/bit to bit.h and bit.c. And don't use it
anywhere. You may even add 'export' to it, or change visibility rules using
__attribute__ - it does not matter. If the function is not used and is not
added to exports.h, you won't see it in the executable. (At least it was so
last time I tried, works not with all libs, but with lib/bit it worked).

Seems EXPORT_LIST was used to extract all symbols from the static libs and
force their exposure + forbid their removal. Here the symbols were retrieved:
https://github.com/tarantool/tarantool/commit/03790ac5510648d1d9648bb2281857a7992d0593#diff-6b9c867c54f1a1b792de45d5262f1dcfL20-L25

Here the libs were passed to mkexports:
https://github.com/tarantool/tarantool/commit/03790ac5510648d1d9648bb2281857a7992d0593#diff-95e351a3805a1dafa85bf20b81d086e6L253-L260

We probably should resurrect that part. Rename the current exports.h to exports.h.in
and generate exports.h during cmake. Like it was done for exports before 2971. To
forbid symbols removal. Not to unhide them.


More information about the Tarantool-patches mailing list