cmake: hide tarantool symbols back
After unhiding all internal symbols([1]) we experience a bunch of problems ([2], [3]). The second one (clash of symbols from different version of the "small" library) still have no good solution. You can find more on the topic [4]. The situation for tarantool executable is the same as for any other library. A library should expose only its public API and should not increase probability of hard to debug problems due to clash of a user's code with an internal name from the library. Let's hide all symbols by default and create a list of exported symbols. (In fact, this patch is a revert of the patch 03790ac5 ([5]) taking into account the changes made to the code) Explanation of adding some controversial symbols to the export list: * The following symbols are used in shared libraries used in tests ("cfunc*.so", "sql_uuid.so", "gh-6024-funcs-return-bin.so", "function1.so", "gh-5938-wrong-string-length.so", "module_api.so") mp_check mp_encode_array mp_encode_bin mp_encode_bool mp_encode_int mp_encode_map mp_encode_nil mp_encode_str mp_encode_uint mp_decode_array_slowpath mp_decode_str mp_next_slowpath mp_load_u8 mp_next mp_sizeof_array mp_sizeof_str mp_type_hint decimal_from_string * These symbols are used in "crypto.lua" and, if absent, will lead to the failure of the "static_build_cmake_linux" on CI (the crypto prefix was used to avoid the clashes of names) crypto_ERR_error_string crypto_ERR_get_error crypto_EVP_DigestInit_ex crypto_EVP_DigestUpdate crypto_EVP_DigestFinal_ex crypto_EVP_get_digestbyname crypto_HMAC_Init_ex crypto_HMAC_Update crypto_HMAC_Final * For correct work of "schema.lua" in the "static_build_cmake_linux" rl_get_screen_size * The following symbols are used in "ssl-cert-paths-discover.test.lua" (I think these symbols will have to be wrapped in the to avoid clashes problems) X509_get_default_cert_dir_env X509_get_default_cert_file_env ssl_cert_paths_discover From "exports.test.lua" have been removed ZSTD symbols checking (see [6]) and "tt_uuid_str" (see [7]). 1. https://github.com/tarantool/tarantool/issues/2971 2. https://github.com/tarantool/tarantool/issues/5001 3. https://github.com/tarantool/memcached/issues/59 4. https://lists.tarantool.org/pipermail/tarantool-discussions/2020-September/000095.html 5. https://github.com/tarantool/tarantool/commit/03790ac5510648d1d9648bb2281857a7992d0593 6. https://github.com/tarantool/tarantool/issues/4225 7. https://github.com/tarantool/tarantool/commit/acf8745ed8fef47e6d1f1c31708c7c9d6324d2f3 Part of #5932
Showing
- .gitignore 1 addition, 0 deletions.gitignore
- extra/exports 475 additions, 0 deletionsextra/exports
- extra/exports_libcurl 84 additions, 0 deletionsextra/exports_libcurl
- extra/mkexports 27 additions, 0 deletionsextra/mkexports
- src/CMakeLists.txt 58 additions, 22 deletionssrc/CMakeLists.txt
- src/exports.c 0 additions, 116 deletionssrc/exports.c
- src/exports.h 0 additions, 532 deletionssrc/exports.h
- src/lib/crypto/crypto.c 54 additions, 0 deletionssrc/lib/crypto/crypto.c
- src/lua/crypto.lua 21 additions, 18 deletionssrc/lua/crypto.lua
- src/main.cc 0 additions, 4 deletionssrc/main.cc
- static-build/test/static-build/exports.test.lua 10 additions, 17 deletionsstatic-build/test/static-build/exports.test.lua
- test/box-tap/check_merge_source.c 2 additions, 1 deletiontest/box-tap/check_merge_source.c
- test/box-tap/gh-5932-symbol-visibility.test.lua 24 additions, 0 deletionstest/box-tap/gh-5932-symbol-visibility.test.lua
- test/box/gh-2971-symbol-visibility.result 0 additions, 22 deletionstest/box/gh-2971-symbol-visibility.result
- test/box/gh-2971-symbol-visibility.test.lua 0 additions, 14 deletionstest/box/gh-2971-symbol-visibility.test.lua
Loading
Please register or sign in to comment