Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Yukhin <kyukhin@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	Alexander Turenko <alexander.turenko@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] build: fix linking with static openssl library
Date: Wed, 28 Aug 2019 02:38:12 +0300	[thread overview]
Message-ID: <20190827233812.ria5q3r3j6iwl6m3@tarantool.org> (raw)
In-Reply-To: <3124ad309d395d9fe9581499198bcd2de9c83b3c.1566525651.git.alexander.turenko@tarantool.org>

Hello,

On 23 авг 05:08, Alexander Turenko wrote:
> System-wide dynamic libraries usually (always?) have NEEDED and RUNPATH
> tags in a dynamic section (as `readelf -d /usr/lib/lib<...>.so` shows),
> so when we link, say, with libssl.so, which depends on libz.so, a linker
> does not complain against unresolved symbols that can be found in Z
> library (if it is installed within a system).
> 
> Things are different when we linking with a static library. Say, when we
> linking with libssl.a, which contains an unresolved symbol from Z
> library, a linker reports an error. It is not possible to store an
> information where to find unresolved symbols (NEEDED / RUNPATH) in a
> static library (AFAIK).
> 
> We depend on three libraries that are depend on Z library: libcurl,
> libssl and libcrypto (two latter are part of OpenSSL). When one of those
> libraries is linked statically we should link with libz.so or libz.a
> (depending on BUILD_STATIC flag). The patch doing exactly this.
> 
> Before this patch we add Z library to OPENSSL_LIBRARIES when
> BUILD_STATIC is enabled. It is not quite correct: we should do that when
> OPENSSL_USE_STATIC_LIBS is enabled. However we didn't experienced
> problems with static linking of libcurl (when BUILD_STATIC is enabled),
> because OPENSSL_LIBRARIES is added to CURL_LIBRARIES. This is a kind of
> side effect of dependency libcurl on OpenSSL and it is better to add
> libz explicitly to CURL_LIBRARIES (and OPENSSL_LIBRARIES) when
> appropriate.
> 
> Fixes #4437.
> ---
> 
> https://github.com/tarantool/tarantool/issues/4437
> https://github.com/tarantool/tarantool/tree/Totktonada/gh-4437-fix-static-openssl-build-full-ci

I've checked your patch into 1.10, 2.1, 2.2 and master.

--
Regards, Kirill Yukhin

      parent reply	other threads:[~2019-08-27 23:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23  2:08 [tarantool-patches] " Alexander Turenko
2019-08-23 21:07 ` [tarantool-patches] " Vladislav Shpilevoy
2019-08-25 11:15   ` Alexander Turenko
2019-08-26 23:02     ` Alexander Turenko
2019-08-27 22:23       ` Vladislav Shpilevoy
2019-08-27 23:38 ` Kirill Yukhin [this message]

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=20190827233812.ria5q3r3j6iwl6m3@tarantool.org \
    --to=kyukhin@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH] build: fix linking with static openssl library' \
    /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