Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Mavr Huston <huston.mavr@gmail.com>
Cc: Alexander Turenko <alexander.turenko@tarantool.org>,
	tarantool-patches@dev.tarantool.org, yaroslav.dynnikov@gmail.com
Subject: Re: [Tarantool-patches] [PATCH] cmake: cleanup src/CMakeLists.txt
Date: Thu, 18 Jun 2020 01:09:14 +0200	[thread overview]
Message-ID: <2e9c5d4a-4af1-ccb5-ef1d-4e245e62b8b7@tarantool.org> (raw)
In-Reply-To: <CAL+-_m_AKDo1CKPBGw7_55uBmtND-V87sC+KXYysxH_S-jUvMA@mail.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.

  reply	other threads:[~2020-06-17 23:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11  0:25 HustonMmmavr
2020-06-14 21:34 ` Alexander Turenko
2020-06-15 17:27   ` Mavr Huston
2020-06-15 21:20 ` Vladislav Shpilevoy
2020-06-17 15:29   ` Mavr Huston
2020-06-17 23:09     ` Vladislav Shpilevoy [this message]
2020-06-19 13:02       ` Yaroslav Dynnikov
2020-06-19 23:39         ` Vladislav Shpilevoy
2020-06-23 20:31           ` Yaroslav Dynnikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e9c5d4a-4af1-ccb5-ef1d-4e245e62b8b7@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=huston.mavr@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=yaroslav.dynnikov@gmail.com \
    --subject='Re: [Tarantool-patches] [PATCH] cmake: cleanup src/CMakeLists.txt' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox