From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH 43/43] build: export public Lua symbols
Date: Sun, 12 Apr 2020 02:13:26 +0200 [thread overview]
Message-ID: <c4d2fe40a1c655fb3ace0a40695c5698f4dee27c.1586650014.git.v.shpilevoy@tarantool.org> (raw)
In-Reply-To: <cover.1586650013.git.v.shpilevoy@tarantool.org>
Exports functions which may be used by dynamic C modules via
public Lua C API and via Tarantool public C API.
Closes #2971
---
| 148 -------------------
src/lua/init.c | 153 ++++++++++++++++++++
test/box/gh-2971-symbol-visibility.result | 22 +++
test/box/gh-2971-symbol-visibility.test.lua | 14 ++
4 files changed, 189 insertions(+), 148 deletions(-)
delete mode 100644 extra/exports
create mode 100644 test/box/gh-2971-symbol-visibility.result
create mode 100644 test/box/gh-2971-symbol-visibility.test.lua
diff --git a/extra/exports b/extra/exports
deleted file mode 100644
index 2341b0861..000000000
--- a/extra/exports
+++ /dev/null
@@ -1,148 +0,0 @@
-# Symbols exported by the main Tarantool executable
-
-# Lua / LuaJIT
-
-lua_newstate
-lua_close
-lua_newthread
-lua_atpanic
-lua_gettop
-lua_settop
-lua_pushvalue
-lua_remove
-lua_insert
-lua_replace
-lua_checkstack
-lua_xmove
-lua_isnumber
-lua_isstring
-lua_iscfunction
-lua_isuserdata
-lua_type
-lua_typename
-lua_equal
-lua_rawequal
-lua_lessthan
-lua_tonumber
-lua_tointeger
-lua_toboolean
-lua_tolstring
-lua_objlen
-lua_tocfunction
-lua_touserdata
-lua_tothread
-lua_topointer
-lua_pushnil
-lua_pushnumber
-lua_pushinteger
-lua_pushlstring
-lua_pushstring
-lua_pushvfstring
-lua_pushfstring
-lua_pushcclosure
-lua_pushboolean
-lua_pushlightuserdata
-lua_pushthread
-lua_gettable
-lua_getfield
-lua_rawget
-lua_rawgeti
-lua_createtable
-lua_newuserdata
-lua_getmetatable
-lua_getfenv
-lua_settable
-lua_setfield
-lua_rawset
-lua_rawseti
-lua_setmetatable
-lua_setfenv
-lua_call
-lua_pcall
-lua_cpcall
-lua_load
-lua_dump
-lua_yield
-lua_resume
-lua_status
-lua_gc
-lua_error
-lua_next
-lua_concat
-lua_getallocf
-lua_setallocf
-lua_getstack
-lua_getinfo
-lua_getlocal
-lua_setlocal
-lua_getupvalue
-lua_setupvalue
-lua_sethook
-lua_gethook
-lua_gethookmask
-lua_gethookcount
-lua_upvalueid
-lua_upvaluejoin
-lua_loadx
-
-luaopen_base
-luaopen_math
-luaopen_string
-luaopen_table
-luaopen_io
-luaopen_os
-luaopen_package
-luaopen_debug
-luaopen_bit
-luaopen_jit
-luaopen_ffi
-
-luaL_openlibs
-luaL_openlib
-luaL_register
-luaL_getmetafield
-luaL_callmeta
-luaL_typerror
-luaL_argerror
-luaL_checklstring
-luaL_optlstring
-luaL_checknumber
-luaL_optnumber
-luaL_checkinteger
-luaL_optinteger
-luaL_checkstack
-luaL_checktype
-luaL_checkany
-luaL_newmetatable
-luaL_checkudata
-luaL_where
-luaL_error
-luaL_checkoption
-luaL_ref
-luaL_unref
-luaL_loadfile
-luaL_loadbuffer
-luaL_loadstring
-luaL_newstate
-luaL_gsub
-luaL_findtable
-luaL_fileresult
-luaL_execresult
-luaL_loadfilex
-luaL_loadbufferx
-luaL_traceback
-luaL_setfuncs
-luaL_pushmodule
-luaL_testudata
-luaL_setmetatable
-luaL_buffinit
-luaL_prepbuffer
-luaL_addlstring
-luaL_addstring
-luaL_addvalue
-luaL_pushresult
-
-luaJIT_setmode
-luaJIT_profile_start
-luaJIT_profile_stop
-luaJIT_profile_dumpstack
diff --git a/src/lua/init.c b/src/lua/init.c
index f115bd2c9..a891afeee 100644
--- a/src/lua/init.c
+++ b/src/lua/init.c
@@ -749,6 +749,158 @@ tarantool_lua_socket_export_syms(void);
void **
tarantool_lua_string_export_syms(void);
+static void **
+tarantool_lua_lua_export_syms(void)
+{
+ static void *syms[] = {
+ (void *)lua_newstate,
+ (void *)lua_close,
+ (void *)lua_newthread,
+ (void *)lua_atpanic,
+ (void *)lua_gettop,
+ (void *)lua_settop,
+ (void *)lua_pushvalue,
+ (void *)lua_remove,
+ (void *)lua_insert,
+ (void *)lua_replace,
+ (void *)lua_checkstack,
+ (void *)lua_xmove,
+ (void *)lua_isnumber,
+ (void *)lua_isstring,
+ (void *)lua_iscfunction,
+ (void *)lua_isuserdata,
+ (void *)lua_type,
+ (void *)lua_typename,
+ (void *)lua_equal,
+ (void *)lua_rawequal,
+ (void *)lua_lessthan,
+ (void *)lua_tonumber,
+ (void *)lua_tointeger,
+ (void *)lua_toboolean,
+ (void *)lua_tolstring,
+ (void *)lua_objlen,
+ (void *)lua_tocfunction,
+ (void *)lua_touserdata,
+ (void *)lua_tothread,
+ (void *)lua_topointer,
+ (void *)lua_pushnil,
+ (void *)lua_pushnumber,
+ (void *)lua_pushinteger,
+ (void *)lua_pushlstring,
+ (void *)lua_pushstring,
+ (void *)lua_pushvfstring,
+ (void *)lua_pushfstring,
+ (void *)lua_pushcclosure,
+ (void *)lua_pushboolean,
+ (void *)lua_pushlightuserdata,
+ (void *)lua_pushthread,
+ (void *)lua_gettable,
+ (void *)lua_getfield,
+ (void *)lua_rawget,
+ (void *)lua_rawgeti,
+ (void *)lua_createtable,
+ (void *)lua_newuserdata,
+ (void *)lua_getmetatable,
+ (void *)lua_getfenv,
+ (void *)lua_settable,
+ (void *)lua_setfield,
+ (void *)lua_rawset,
+ (void *)lua_rawseti,
+ (void *)lua_setmetatable,
+ (void *)lua_setfenv,
+ (void *)lua_call,
+ (void *)lua_pcall,
+ (void *)lua_cpcall,
+ (void *)lua_load,
+ (void *)lua_dump,
+ (void *)lua_yield,
+ (void *)lua_resume,
+ (void *)lua_status,
+ (void *)lua_gc,
+ (void *)lua_error,
+ (void *)lua_next,
+ (void *)lua_concat,
+ (void *)lua_getallocf,
+ (void *)lua_setallocf,
+ (void *)lua_getstack,
+ (void *)lua_getinfo,
+ (void *)lua_getlocal,
+ (void *)lua_setlocal,
+ (void *)lua_getupvalue,
+ (void *)lua_setupvalue,
+ (void *)lua_sethook,
+ (void *)lua_gethook,
+ (void *)lua_gethookmask,
+ (void *)lua_gethookcount,
+ (void *)lua_upvalueid,
+ (void *)lua_upvaluejoin,
+ (void *)lua_loadx,
+
+ (void *)luaopen_base,
+ (void *)luaopen_math,
+ (void *)luaopen_string,
+ (void *)luaopen_table,
+ (void *)luaopen_io,
+ (void *)luaopen_os,
+ (void *)luaopen_package,
+ (void *)luaopen_debug,
+ (void *)luaopen_bit,
+ (void *)luaopen_jit,
+ (void *)luaopen_ffi,
+
+ (void *)luaL_openlibs,
+ (void *)luaL_openlib,
+ (void *)luaL_register,
+ (void *)luaL_getmetafield,
+ (void *)luaL_callmeta,
+ (void *)luaL_typerror,
+ (void *)luaL_argerror,
+ (void *)luaL_checklstring,
+ (void *)luaL_optlstring,
+ (void *)luaL_checknumber,
+ (void *)luaL_optnumber,
+ (void *)luaL_checkinteger,
+ (void *)luaL_optinteger,
+ (void *)luaL_checkstack,
+ (void *)luaL_checktype,
+ (void *)luaL_checkany,
+ (void *)luaL_newmetatable,
+ (void *)luaL_checkudata,
+ (void *)luaL_where,
+ (void *)luaL_error,
+ (void *)luaL_checkoption,
+ (void *)luaL_ref,
+ (void *)luaL_unref,
+ (void *)luaL_loadfile,
+ (void *)luaL_loadbuffer,
+ (void *)luaL_loadstring,
+ (void *)luaL_newstate,
+ (void *)luaL_gsub,
+ (void *)luaL_findtable,
+ (void *)luaL_fileresult,
+ (void *)luaL_execresult,
+ (void *)luaL_loadfilex,
+ (void *)luaL_loadbufferx,
+ (void *)luaL_traceback,
+ (void *)luaL_setfuncs,
+ (void *)luaL_pushmodule,
+ (void *)luaL_testudata,
+ (void *)luaL_setmetatable,
+ (void *)luaL_buffinit,
+ (void *)luaL_prepbuffer,
+ (void *)luaL_addlstring,
+ (void *)luaL_addstring,
+ (void *)luaL_addvalue,
+ (void *)luaL_pushresult,
+
+ (void *)luaJIT_setmode,
+ (void *)luaJIT_profile_start,
+ (void *)luaJIT_profile_stop,
+ (void *)luaJIT_profile_dumpstack,
+ };
+ return syms;
+}
+
void **
tarantool_lua_tnt_iconv_export_syms(void);
@@ -766,6 +918,7 @@ tarantool_lua_export_syms(void)
(void *)tarantool_lua_buffer_export_syms,
(void *)tarantool_lua_digest_export_syms,
(void *)tarantool_lua_error_export_syms,
+ (void *)tarantool_lua_lua_export_syms,
(void *)tarantool_lua_msgpack_export_syms,
(void *)tarantool_lua_socket_export_syms,
(void *)tarantool_lua_tnt_iconv_export_syms,
diff --git a/test/box/gh-2971-symbol-visibility.result b/test/box/gh-2971-symbol-visibility.result
new file mode 100644
index 000000000..9f91a4edf
--- /dev/null
+++ b/test/box/gh-2971-symbol-visibility.result
@@ -0,0 +1,22 @@
+-- test-run result file version 2
+ffi = require('ffi')
+ | ---
+ | ...
+
+--
+-- gh-2971: Tarantool should not hide symbols. Even those which
+-- are not a part of the public API.
+--
+
+-- This symbol is not public, but should be defined.
+ffi.cdef[[ \
+bool \
+box_is_configured(void); \
+]]
+ | ---
+ | ...
+
+ffi.C.box_is_configured()
+ | ---
+ | - true
+ | ...
diff --git a/test/box/gh-2971-symbol-visibility.test.lua b/test/box/gh-2971-symbol-visibility.test.lua
new file mode 100644
index 000000000..f19effeba
--- /dev/null
+++ b/test/box/gh-2971-symbol-visibility.test.lua
@@ -0,0 +1,14 @@
+ffi = require('ffi')
+
+--
+-- gh-2971: Tarantool should not hide symbols. Even those which
+-- are not a part of the public API.
+--
+
+-- This symbol is not public, but should be defined.
+ffi.cdef[[ \
+bool \
+box_is_configured(void); \
+]]
+
+ffi.C.box_is_configured()
--
2.21.1 (Apple Git-122.3)
next prev parent reply other threads:[~2020-04-12 0:16 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-12 0:12 [Tarantool-patches] [PATCH 00/43] Unhide symbols Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 01/43] cmake: remove double usage of some source files Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 10/43] build: export src/lib/core/fiber.c symbols Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 11/43] build: export src/lua/init.c symbols Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 12/43] build: export src/lib/core/port.c symbols Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 13/43] build: export src/lib/csv/csv.c symbols Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 14/43] build: export src/title.c symbols Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 15/43] build: export src/lua/tnt_iconv.c symbols Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 16/43] build: export src/lib/core/exception.cc symbols Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 17/43] build: export src/lib/uuid/tt_uuid.c symbols Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 18/43] build: export src/lib/core/say.c symbols Vladislav Shpilevoy
2020-04-12 0:12 ` [Tarantool-patches] [PATCH 19/43] build: export src/lib/uri/uri.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 02/43] cmake: remove dynamic-list linker option Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 20/43] build: export third_party/PMurHash.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 21/43] build: export src/crc32.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 22/43] build: export src/lua/msgpack.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 23/43] build: export src/main.cc symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 24/43] build: export src/box/space.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 25/43] build: export src/box/schema.cc symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 26/43] build: export src/lib/crypto/crypto.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 27/43] build: export src/lua/buffer.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 28/43] build: export src/lib/swim/swim.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 29/43] build: export src/lib/core/fiber_cond.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 03/43] build: export src/lib/core/clock.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 30/43] build: export src/lib/core/coio.cc symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 31/43] build: export src/lua/utils.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 32/43] build: export src/box/lua/tuple.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 33/43] build: export src/lua/error.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 34/43] build: export src/box/txn.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 35/43] build: export src/box/key_def.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 36/43] build: export src/box/tuple.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 37/43] build: export src/box/index.cc symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 38/43] build: export src/box/box.cc symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 39/43] build: export src/box/error.cc symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 04/43] build: export src/scramble.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 40/43] build: export src/lib/core/diag.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 41/43] build: export src/lib/core/latch.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 42/43] build: export src/lua/string.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` Vladislav Shpilevoy [this message]
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 05/43] build: export src/lua/socket.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 06/43] build: export third_party/base64.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 07/43] build: export src/lua/digest.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 08/43] build: export src/lib/salad/guava.c symbols Vladislav Shpilevoy
2020-04-12 0:13 ` [Tarantool-patches] [PATCH 09/43] build: export src/lib/core/random.c symbols Vladislav Shpilevoy
2020-04-14 18:14 ` Timur Safin
2020-04-12 11:34 ` [Tarantool-patches] [PATCH 00/43] Unhide symbols Konstantin Osipov
2020-04-12 14:05 ` Vladislav Shpilevoy
2020-04-13 9:40 ` Konstantin Osipov
2020-04-13 9:42 ` Konstantin Osipov
2020-04-13 13:53 ` Vladislav Shpilevoy
2020-04-13 14:15 ` Konstantin Osipov
2020-04-13 14:21 ` Vladislav Shpilevoy
2020-04-13 19:49 ` Sergey Ostanevich
2020-04-13 21:01 ` Vladislav Shpilevoy
2020-04-13 21:38 ` Konstantin Osipov
2020-04-14 18:01 ` Timur Safin
2020-04-14 18:26 ` Timur Safin
2020-04-14 20:41 ` 'Konstantin Osipov'
2020-04-15 10:28 ` Mons Anderson
2020-04-15 10:40 ` Mons Anderson
2020-04-15 10:50 ` sergos
2020-04-15 21:58 ` Vladislav Shpilevoy
2020-04-16 12:13 ` Cyrill Gorcunov
2020-04-16 20:30 ` Vladislav Shpilevoy
2020-04-17 7:48 ` Timur Safin
2020-04-17 8:29 ` Cyrill Gorcunov
2020-04-15 11:27 ` Konstantin Osipov
2020-04-12 14:25 ` Vladislav Shpilevoy
2020-04-12 20:18 ` Vladislav Shpilevoy
2020-04-13 14:26 ` Vladislav Shpilevoy
2020-04-13 16:44 ` Cyrill Gorcunov
2020-04-13 17:57 ` Vladislav Shpilevoy
2020-04-13 18:17 ` Cyrill Gorcunov
2020-04-14 1:15 ` Vladislav Shpilevoy
2020-04-14 1:27 ` [Tarantool-patches] [PATCH 44/43] build: export src/box/lua/console.c symbols Vladislav Shpilevoy
2020-04-15 23:15 ` [Tarantool-patches] [PATCH 00/43] Unhide symbols Vladislav Shpilevoy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c4d2fe40a1c655fb3ace0a40695c5698f4dee27c.1586650014.git.v.shpilevoy@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH 43/43] build: export public Lua symbols' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox