[Tarantool-patches] [PATCH v1] build: make curl symbols global

Igor Munkin imun at tarantool.org
Tue Oct 13 14:47:19 MSK 2020


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


More information about the Tarantool-patches mailing list