From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 8311D469719 for ; Tue, 13 Oct 2020 14:57:57 +0300 (MSK) Date: Tue, 13 Oct 2020 14:47:19 +0300 From: Igor Munkin Message-ID: <20201013114719.GC18920@tarantool.org> References: <4fc536691abbbbb9f3439bb60bef7a551663a5b5.1602143974.git.avtikhon@tarantool.org> <18048f3308fd4e1372b0cda3e82e8a1c2d86ca71.1602143974.git.avtikhon@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <18048f3308fd4e1372b0cda3e82e8a1c2d86ca71.1602143974.git.avtikhon@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v1] build: make curl symbols global List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Alexander V. Tikhonov" Cc: tarantool-patches@dev.tarantool.org, Alexander Turenko Sasha, Thanks for the patch! Please, don't take it personal, but I totally don't like it. There is no need to patch curl build system at all. The symbols are simply hidden by default[1], so you to set the proper option to CMake. Consider the following changes: ================================================================================ diff --git a/cmake/BuildLibCURL.cmake b/cmake/BuildLibCURL.cmake index a4e222f95..0456bfd93 100644 --- a/cmake/BuildLibCURL.cmake +++ b/cmake/BuildLibCURL.cmake @@ -48,6 +48,8 @@ macro(curl_build) # let's disable testing for curl to save build time list(APPEND LIBCURL_CMAKE_FLAGS "-DBUILD_TESTING=OFF") + list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_HIDDEN_SYMBOLS=OFF") + # Setup use of openssl, use the same OpenSSL library # for libcurl as is used for tarantool itself. get_filename_component(FOUND_OPENSSL_ROOT_DIR ${OPENSSL_INCLUDE_DIR} DIRECTORY) diff --git a/third_party/curl b/third_party/curl index ac15de38d..12af024bc 160000 --- a/third_party/curl +++ b/third_party/curl @@ -1 +1 @@ -Subproject commit ac15de38d981f22affbc4d275a3b874e0eee57d6 +Subproject commit 12af024bc85606b14ffc415413a7e86e6bbee7eb ================================================================================ After these changes the tests are fine on my machine. On 08.10.20, Alexander V. Tikhonov wrote: > Building using cmake got issue in testing: > > [043] box-tap/gh-5223-curl-exports.test.lua [ fail ] > [043] Test failed! Output from reject file box-tap/gh-5223-curl-exports.reject: > [043] > [043] Last 15 lines of Tarantool Log file [Instance "app_server"][/build/usr/src/debug/tarantool-2.6.0.54/test/var/043_box-tap/gh-5223-curl-exports.test.lua.tarantool.log]: > [043] LuajitError: ...tool-2.6.0.54/test/box-tap/gh-5223-curl-exports.test.lua:57: tarantool: undefined symbol: curl_version_info > > It happened because curl used visibility hiding mode for its symbols > and the test could not use it. To fix it symbols hiding disabled for > gcc and clang. > > Closes #5268 > --- > > Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4874-out-of-source-build-full-ci > Issue: https://github.com/tarantool/tarantool/issues/5268 > > third_party/curl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/third_party/curl b/third_party/curl > index 5a1fc8d33..ac15de38d 160000 > --- a/third_party/curl > +++ b/third_party/curl > @@ -1 +1 @@ > -Subproject commit 5a1fc8d33808d7b22f57bdf9403cda7ff07b0670 > +Subproject commit ac15de38d981f22affbc4d275a3b874e0eee57d6 For the protocol, here is your patch for curl build system: ================================================================================ diff --git a/CMake/CurlSymbolHiding.cmake b/CMake/CurlSymbolHiding.cmake index aaac9fead..fb77eed69 100644 --- a/CMake/CurlSymbolHiding.cmake +++ b/CMake/CurlSymbolHiding.cmake @@ -28,15 +28,15 @@ if(CURL_HIDDEN_SYMBOLS) set(SUPPORTS_SYMBOL_HIDING FALSE) if(CMAKE_C_COMPILER_ID MATCHES "Clang") - set(SUPPORTS_SYMBOL_HIDING TRUE) - set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))") - set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") + set(SUPPORTS_SYMBOL_HIDING FALSE) + set(_SYMBOL_EXTERN "") + set(_CFLAG_SYMBOLS_HIDE "") elseif(CMAKE_COMPILER_IS_GNUCC) if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) # note: this is considered buggy prior to 4.0 but the autotools don't care, so let's ignore that fact - set(SUPPORTS_SYMBOL_HIDING TRUE) - set(_SYMBOL_EXTERN "__attribute__ ((__visibility__ (\"default\")))") - set(_CFLAG_SYMBOLS_HIDE "-fvisibility=hidden") + set(SUPPORTS_SYMBOL_HIDING FALSE) + set(_SYMBOL_EXTERN "") + set(_CFLAG_SYMBOLS_HIDE "") endif() elseif(CMAKE_C_COMPILER_ID MATCHES "SunPro" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 8.0) set(SUPPORTS_SYMBOL_HIDING TRUE) ================================================================================ > -- > 2.25.1 > -- Best regards, IM