Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin <imun@tarantool.org>
To: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org,
	Alexander Turenko <alexander.turenko@tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v1] build: make curl symbols global
Date: Tue, 13 Oct 2020 14:47:19 +0300	[thread overview]
Message-ID: <20201013114719.GC18920@tarantool.org> (raw)
In-Reply-To: <18048f3308fd4e1372b0cda3e82e8a1c2d86ca71.1602143974.git.avtikhon@tarantool.org>

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

  reply	other threads:[~2020-10-13 11:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08  8:03 [Tarantool-patches] [PATCH v3] build: enable cmake in curl build Alexander V. Tikhonov
2020-10-08  8:05 ` [Tarantool-patches] [PATCH v1] build: make curl symbols global Alexander V. Tikhonov
2020-10-13 11:47   ` Igor Munkin [this message]
2020-10-08  8:09 ` [Tarantool-patches] [PATCH v1] gitlab-ci: add out-of-source build Alexander V. Tikhonov
2020-10-13 20:39   ` Igor Munkin
2020-10-14  9:07     ` Alexander V. Tikhonov
2020-10-12 18:52 ` [Tarantool-patches] [PATCH v3] build: enable cmake in curl build Igor Munkin
2020-10-13 10:20   ` Igor Munkin
2020-10-14  9:08     ` Alexander V. Tikhonov
2020-10-14  9:12   ` Alexander V. Tikhonov

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=20201013114719.GC18920@tarantool.org \
    --to=imun@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v1] build: make curl symbols global' \
    /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