From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (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 5D4CB4696C8 for ; Sun, 12 Apr 2020 03:13:41 +0300 (MSK) Received: by smtp50.i.mail.ru with esmtpa (envelope-from ) id 1jNQFo-0005lJ-RM for tarantool-patches@dev.tarantool.org; Sun, 12 Apr 2020 03:13:41 +0300 From: Vladislav Shpilevoy Date: Sun, 12 Apr 2020 02:12:55 +0200 Message-Id: <10164d6ea942aadd0bb8e52cefb38a815aa5b8ec.1586650014.git.v.shpilevoy@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 15/43] build: export src/lua/tnt_iconv.c symbols List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Exports functions used by src/lua/iconv.lua via FFI. Also it appeared, that 'server' static library, owner of tnt_iconv.c, didn't add ICONV_LIBRARIES dependency, even though it used functions from there. That led to compilation errors, but strangely only with that patch. So they are in one commit. Part of #2971 --- extra/exports | 3 --- src/CMakeLists.txt | 2 +- src/lua/init.c | 4 ++++ src/lua/tnt_iconv.c | 11 +++++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/extra/exports b/extra/exports index cbf3906c9..b15096a57 100644 --- a/extra/exports +++ b/extra/exports @@ -6,9 +6,6 @@ ibuf_create ibuf_reinit ibuf_destroy ibuf_reserve_slow -tnt_iconv_open -tnt_iconv_close -tnt_iconv exception_get_string exception_get_int diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a8b670f2..feb26345a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -171,7 +171,7 @@ set_source_files_compile_flags(${server_sources}) add_library(server STATIC ${server_sources}) add_dependencies(server build_bundled_libs) target_link_libraries(server core coll http_parser bit uri uuid swim swim_udp - swim_ev crypto crc32) + swim_ev crypto crc32 ${ICONV_LIBRARIES}) # Rule of thumb: if exporting a symbol from a static library, list the # library here. diff --git a/src/lua/init.c b/src/lua/init.c index 35a7e5884..a004b1342 100644 --- a/src/lua/init.c +++ b/src/lua/init.c @@ -737,6 +737,9 @@ tarantool_lua_digest_export_syms(void); void ** tarantool_lua_socket_export_syms(void); +void ** +tarantool_lua_tnt_iconv_export_syms(void); + /** * Aggregator of all symbols defined in src/lua. */ @@ -747,6 +750,7 @@ tarantool_lua_export_syms(void) /* Submodules. */ (void *)tarantool_lua_digest_export_syms, (void *)tarantool_lua_socket_export_syms, + (void *)tarantool_lua_tnt_iconv_export_syms, /* Own symbols. */ (void *)tarantool_lua_slab_cache, diff --git a/src/lua/tnt_iconv.c b/src/lua/tnt_iconv.c index c91fef140..30b760d1e 100644 --- a/src/lua/tnt_iconv.c +++ b/src/lua/tnt_iconv.c @@ -19,3 +19,14 @@ tnt_iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, return iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft); } + +void ** +tarantool_lua_tnt_iconv_export_syms(void) +{ + static void *syms[] = { + (void *)tnt_iconv, + (void *)tnt_iconv_close, + (void *)tnt_iconv_open, + }; + return syms; +} -- 2.21.1 (Apple Git-122.3)