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 D7FEF260CB for ; Mon, 19 Aug 2019 18:54:56 -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 GO5pcLbOpmxS for ; Mon, 19 Aug 2019 18:54:56 -0400 (EDT) Received: from smtp1.mail.ru (smtp1.mail.ru [94.100.179.111]) (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 19EDA26067 for ; Mon, 19 Aug 2019 18:54:55 -0400 (EDT) Date: Tue, 20 Aug 2019 01:54:36 +0300 From: Alexander Turenko Subject: [tarantool-patches] Re: [PATCH 0/2] Build libcurl statically Message-ID: <20190819225435.jernpohuyi6dbmkx@tkn_work_nb> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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: Georgy Kirichenko Cc: tarantool-patches@freelists.org, "Alexander V . Tikhonov" , Mergen Imeev > https://github.com/tarantool/tarantool/issues/4318 > https://github.com/tarantool/tarantool/tree/imeevma/gh-4318-link-libcurl-statically-full-ci > > CI now fails, because some SQL tests were not updated properly on > master. I'll rebase the branch when it will be fixed and will ensure > that everything work. CI is now okay. ---- Georgy asks me to ensure that openssl links statically when it is requested with -DOPENSSL_USE_STATIC_LIBS=ON CMake option (correct me if I misunderstood something). I had performed several builds on my Gentoo box on master (2.3.0-26-gd0e38d59f) and imeevma/gh-4318-link-libcurl-statically-full-ci (2.3.0-23-gdcd4795bb) branches. The following patch was temporary applied to pass builds with -DOPENSSL_USE_STATIC_LIBS=ON, but without -DBUILD_STATIC=ON (it is needed both on master and on the feature branch). | diff --git a/CMakeLists.txt b/CMakeLists.txt | index bfb15effb..4b542e655 100644 | --- a/CMakeLists.txt | +++ b/CMakeLists.txt | @@ -329,6 +329,9 @@ endif() | if(BUILD_STATIC) | find_library(Z_LIBRARY libz.a) | set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} ${Z_LIBRARY}) | +elseif(NOT BUILD_STATIC AND OPENSSL_USE_STATIC_LIBS) | + find_library(Z_LIBRARY z) | + set(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} ${Z_LIBRARY}) | endif() | | # (I don't sure I understood how it works, so I'll think about it, will file an issue and will send a patch later separately.) The raw results are below, they looks okay for me. Georgy, can you, please, look into them and answer whether it answers your question? WBR, Alexander Turenko. master ------ $ cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_BACKTRACE=ON -DENABLE_DIST=ON && make -j $ lddtree src/tarantool tarantool => src/tarantool (interpreter => /lib64/ld-linux-x86-64.so.2) tarantool => src/tarantool (interpreter => /lib64/ld-linux-x86-64.so.2) libicui18n.so.64 => /usr/lib64/libicui18n.so.64 libicuuc.so.64 => /usr/lib64/libicuuc.so.64 libicudata.so.64 => /usr/lib64/libicudata.so.64 libreadline.so.8 => /lib64/libreadline.so.8 libncurses.so.6 => /lib64/libncurses.so.6 libform.so.6 => /usr/lib64/libform.so.6 libcurl.so.4 => /usr/lib64/libcurl.so.4 libnghttp2.so.14 => //usr/lib64/libnghttp2.so.14 libz.so.1 => /lib64/libz.so.1 libssl.so.1.1 => /usr/lib64/libssl.so.1.1 libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 libdl.so.2 => /lib64/libdl.so.2 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 librt.so.1 => /lib64/librt.so.1 libpthread.so.0 => /lib64/libpthread.so.0 libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgcc_s.so.1 libunwind-x86_64.so.8 => /usr/lib64/libunwind-x86_64.so.8 libunwind.so.8 => /usr/lib64/libunwind.so.8 libgomp.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgomp.so.1 libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libstdc++.so.6 libm.so.6 => /lib64/libm.so.6 libc.so.6 => /lib64/libc.so.6 Expected: dynamic libssl, libcrypto (ok). $ cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_BACKTRACE=ON -DENABLE_DIST=ON -DBUILD_STATIC=ON && make -j $ lddtree src/tarantool tarantool => src/tarantool (interpreter => /lib64/ld-linux-x86-64.so.2) libssl.so.1.1 => /usr/lib64/libssl.so.1.1 libz.so.1 => /lib64/libz.so.1 libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 libdl.so.2 => /lib64/libdl.so.2 libpthread.so.0 => /lib64/libpthread.so.0 librt.so.1 => /lib64/librt.so.1 libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgcc_s.so.1 libm.so.6 => /lib64/libm.so.6 libc.so.6 => /lib64/libc.so.6 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 Expected: dynamic libssl, libcrypto (ok). $ cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_BACKTRACE=ON -DENABLE_DIST=ON -DOPENSSL_USE_STATIC_LIBS=ON && make -j $ lddtree src/tarantool tarantool => src/tarantool (interpreter => /lib64/ld-linux-x86-64.so.2) libicui18n.so.64 => /usr/lib64/libicui18n.so.64 libicuuc.so.64 => /usr/lib64/libicuuc.so.64 libicudata.so.64 => /usr/lib64/libicudata.so.64 libreadline.so.8 => /lib64/libreadline.so.8 libncurses.so.6 => /lib64/libncurses.so.6 libform.so.6 => /usr/lib64/libform.so.6 libcurl.so.4 => /usr/lib64/libcurl.so.4 libnghttp2.so.14 => //usr/lib64/libnghttp2.so.14 libssl.so.1.1 => //usr/lib64/libssl.so.1.1 libcrypto.so.1.1 => //usr/lib64/libcrypto.so.1.1 libdl.so.2 => /lib64/libdl.so.2 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 libz.so.1 => /lib64/libz.so.1 librt.so.1 => /lib64/librt.so.1 libpthread.so.0 => /lib64/libpthread.so.0 libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgcc_s.so.1 libunwind-x86_64.so.8 => /usr/lib64/libunwind-x86_64.so.8 libunwind.so.8 => /usr/lib64/libunwind.so.8 libgomp.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgomp.so.1 libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libstdc++.so.6 libm.so.6 => /lib64/libm.so.6 libc.so.6 => /lib64/libc.so.6 Expected: static libssl, libcrypto (ok). Note: System libcurl is linked dynamically into tarantool and links its dependencies libssl/libcrypto dynamically too. We cannot change a system library. So it is also expected behaviour (but only for master, when we does not build libcurl ourself). $ cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_BACKTRACE=ON -DENABLE_DIST=ON -DBUILD_STATIC=ON -DOPENSSL_USE_STATIC_LIBS=ON && make -j $ lddtree src/tarantool tarantool => src/tarantool (interpreter => /lib64/ld-linux-x86-64.so.2) libdl.so.2 => /lib64/libdl.so.2 libpthread.so.0 => /lib64/libpthread.so.0 librt.so.1 => /lib64/librt.so.1 libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgcc_s.so.1 libm.so.6 => /lib64/libm.so.6 libc.so.6 => /lib64/libc.so.6 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 Expected: static libssl, libcrypto (ok). imeevma/gh-4318-link-libcurl-statically-full-ci ----------------------------------------------- $ cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_BACKTRACE=ON -DENABLE_DIST=ON && make -j $ lddtree src/tarantool tarantool => src/tarantool (interpreter => /lib64/ld-linux-x86-64.so.2) tarantool => src/tarantool (interpreter => /lib64/ld-linux-x86-64.so.2) libicui18n.so.64 => /usr/lib64/libicui18n.so.64 libicuuc.so.64 => /usr/lib64/libicuuc.so.64 libicudata.so.64 => /usr/lib64/libicudata.so.64 libreadline.so.8 => /lib64/libreadline.so.8 libncurses.so.6 => /lib64/libncurses.so.6 libform.so.6 => /usr/lib64/libform.so.6 libz.so.1 => /lib64/libz.so.1 librt.so.1 => /lib64/librt.so.1 libssl.so.1.1 => /usr/lib64/libssl.so.1.1 libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 libdl.so.2 => /lib64/libdl.so.2 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 libpthread.so.0 => /lib64/libpthread.so.0 libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgcc_s.so.1 libunwind-x86_64.so.8 => /usr/lib64/libunwind-x86_64.so.8 libunwind.so.8 => /usr/lib64/libunwind.so.8 libgomp.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgomp.so.1 libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libstdc++.so.6 libm.so.6 => /lib64/libm.so.6 libc.so.6 => /lib64/libc.so.6 Expected: dynamic libssl, libcrypto (ok). $ cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_BACKTRACE=ON -DENABLE_DIST=ON -DBUILD_STATIC=ON && make -j $ lddtree src/tarantool tarantool => src/tarantool (interpreter => /lib64/ld-linux-x86-64.so.2) librt.so.1 => /lib64/librt.so.1 libssl.so.1.1 => /usr/lib64/libssl.so.1.1 libz.so.1 => /lib64/libz.so.1 libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 libdl.so.2 => /lib64/libdl.so.2 libpthread.so.0 => /lib64/libpthread.so.0 libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgcc_s.so.1 libm.so.6 => /lib64/libm.so.6 libc.so.6 => /lib64/libc.so.6 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 Expected: dynamic libssl, libcrypto (ok). $ cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_BACKTRACE=ON -DENABLE_DIST=ON -DOPENSSL_USE_STATIC_LIBS=ON && make -j $ lddtree src/tarantool tarantool => src/tarantool (interpreter => /lib64/ld-linux-x86-64.so.2) libicui18n.so.64 => /usr/lib64/libicui18n.so.64 libicuuc.so.64 => /usr/lib64/libicuuc.so.64 libicudata.so.64 => /usr/lib64/libicudata.so.64 libreadline.so.8 => /lib64/libreadline.so.8 libncurses.so.6 => /lib64/libncurses.so.6 libform.so.6 => /usr/lib64/libform.so.6 libz.so.1 => /lib64/libz.so.1 librt.so.1 => /lib64/librt.so.1 libdl.so.2 => /lib64/libdl.so.2 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 libpthread.so.0 => /lib64/libpthread.so.0 libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgcc_s.so.1 libunwind-x86_64.so.8 => /usr/lib64/libunwind-x86_64.so.8 libunwind.so.8 => /usr/lib64/libunwind.so.8 libgomp.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgomp.so.1 libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libstdc++.so.6 libm.so.6 => /lib64/libm.so.6 libc.so.6 => /lib64/libc.so.6 Expected: static libssl, libcrypto (ok). $ cmake . -DCMAKE_BUILD_TYPE=Debug -DENABLE_BACKTRACE=ON -DENABLE_DIST=ON -DBUILD_STATIC=ON -DOPENSSL_USE_STATIC_LIBS=ON && make -j $ lddtree src/tarantool tarantool => src/tarantool (interpreter => /lib64/ld-linux-x86-64.so.2) librt.so.1 => /lib64/librt.so.1 libdl.so.2 => /lib64/libdl.so.2 libpthread.so.0 => /lib64/libpthread.so.0 libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/libgcc_s.so.1 libm.so.6 => /lib64/libm.so.6 libc.so.6 => /lib64/libc.so.6 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 Expected: static libssl, libcrypto (ok).