[Tarantool-patches] [PATCH 15/43] build: export src/lua/tnt_iconv.c symbols

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Apr 12 03:12:55 MSK 2020


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)



More information about the Tarantool-patches mailing list