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 A67C4442BAE for ; Sun, 12 Apr 2020 03:15:05 +0300 (MSK) Received: by smtp50.i.mail.ru with esmtpa (envelope-from ) id 1jNQHB-0005lJ-4F for tarantool-patches@dev.tarantool.org; Sun, 12 Apr 2020 03:15:05 +0300 From: Vladislav Shpilevoy Date: Sun, 12 Apr 2020 02:13:20 +0200 Message-Id: <22c6014165fd76c942f401990176d37e35b4f55c.1586650014.git.v.shpilevoy@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 38/43] build: export src/box/box.cc symbols List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Exports functions visible to the public C API and used by src/box/lua/schema.lua via FFI. It is worth mentioning why box_export_syms() does not aggregate all the other box_*_export_syms(). This is because there is a broken dependency between main.cc and 'box' static lib. 'box' uses functions 'tarantool_uptime()' and 'load_cfg()', which are defined in main.cc. When box_export_syms() tries to aggregate symbols from its submodules, this break explodes. And its fix is not as a trival as it seems, so it is postponed. Part of #2971 --- extra/exports | 14 -------------- src/box/box.cc | 22 ++++++++++++++++++++++ src/exports.c | 2 ++ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/extra/exports b/extra/exports index 51420a322..81c92f503 100644 --- a/extra/exports +++ b/extra/exports @@ -2,20 +2,6 @@ # Module API -box_return_tuple -box_space_id_by_name -box_index_id_by_name -box_select -box_insert -box_replace -box_delete -box_update -box_upsert -box_truncate -box_sequence_next -box_sequence_current -box_sequence_set -box_sequence_reset box_error_type box_error_code box_error_message diff --git a/src/box/box.cc b/src/box/box.cc index 0c15ba5e9..c8c78b3ce 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -2544,3 +2544,25 @@ box_reset_stat(void) engine_reset_stat(); space_foreach(box_reset_space_stat, NULL); } + +extern "C" void ** +box_export_syms(void) +{ + static void *syms[] = { + (void *)box_delete, + (void *)box_index_id_by_name, + (void *)box_insert, + (void *)box_replace, + (void *)box_return_tuple, + (void *)box_select, + (void *)box_sequence_current, + (void *)box_sequence_next, + (void *)box_sequence_reset, + (void *)box_sequence_set, + (void *)box_space_id_by_name, + (void *)box_truncate, + (void *)box_update, + (void *)box_upsert, + }; + return syms; +} diff --git a/src/exports.c b/src/exports.c index 7fc38f642..109398bf1 100644 --- a/src/exports.c +++ b/src/exports.c @@ -49,6 +49,7 @@ */ EXPORT(base64_export_syms); +EXPORT(box_export_syms); EXPORT(box_index_export_syms); EXPORT(box_key_def_export_syms); EXPORT(box_lua_export_syms); @@ -82,6 +83,7 @@ export_syms(void) { void *syms[] = { base64_export_syms, + box_export_syms, box_index_export_syms, box_key_def_export_syms, box_lua_export_syms, -- 2.21.1 (Apple Git-122.3)