From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id BBB1D2741E for ; Tue, 27 Aug 2019 19:38:16 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Exed4ZAQLxa2 for ; Tue, 27 Aug 2019 19:38:16 -0400 (EDT) Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [94.100.177.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 0DD772741D for ; Tue, 27 Aug 2019 19:38:15 -0400 (EDT) Date: Wed, 28 Aug 2019 02:38:12 +0300 From: Kirill Yukhin Subject: [tarantool-patches] Re: [PATCH] build: fix linking with static openssl library Message-ID: <20190827233812.ria5q3r3j6iwl6m3@tarantool.org> References: <3124ad309d395d9fe9581499198bcd2de9c83b3c.1566525651.git.alexander.turenko@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3124ad309d395d9fe9581499198bcd2de9c83b3c.1566525651.git.alexander.turenko@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: Vladislav Shpilevoy , Alexander Turenko 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