From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E4C3642EF5C for ; Thu, 18 Jun 2020 02:09:16 +0300 (MSK) References: <20200611002510.35349-1-huston.mavr@gmail.com> <7855a532-9877-3fef-4a52-c480b4509e4a@tarantool.org> From: Vladislav Shpilevoy Message-ID: <2e9c5d4a-4af1-ccb5-ef1d-4e245e62b8b7@tarantool.org> Date: Thu, 18 Jun 2020 01:09:14 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH] cmake: cleanup src/CMakeLists.txt List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mavr Huston Cc: Alexander Turenko , tarantool-patches@dev.tarantool.org, yaroslav.dynnikov@gmail.com 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.