Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
c9d88d5f
Commit
c9d88d5f
authored
9 years ago
by
Roman Tsisyk
Browse files
Options
Downloads
Patches
Plain Diff
Fix #984: add jit.* library to the binary
parent
9481a731
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
cmake/luajit.cmake
+2
-2
2 additions, 2 deletions
cmake/luajit.cmake
cmake/utils.cmake
+1
-1
1 addition, 1 deletion
cmake/utils.cmake
src/CMakeLists.txt
+13
-0
13 additions, 0 deletions
src/CMakeLists.txt
src/lua/init.cc
+32
-3
32 additions, 3 deletions
src/lua/init.cc
with
48 additions
and
6 deletions
cmake/luajit.cmake
+
2
−
2
View file @
c9d88d5f
...
@@ -178,7 +178,7 @@ macro(luajit_build)
...
@@ -178,7 +178,7 @@ macro(luajit_build)
add_custom_command
(
OUTPUT
${
PROJECT_BINARY_DIR
}
/third_party/luajit/src/libluajit.a
add_custom_command
(
OUTPUT
${
PROJECT_BINARY_DIR
}
/third_party/luajit/src/libluajit.a
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
/third_party/luajit
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
/third_party/luajit
COMMAND $
(
MAKE
)
${
luajit_buildoptions
}
clean
COMMAND $
(
MAKE
)
${
luajit_buildoptions
}
clean
COMMAND $
(
MAKE
)
-C src
${
luajit_buildoptions
}
libluajit.a
COMMAND $
(
MAKE
)
-C src
${
luajit_buildoptions
}
DEPENDS
${
CMAKE_SOURCE_DIR
}
/CMakeCache.txt
DEPENDS
${
CMAKE_SOURCE_DIR
}
/CMakeCache.txt
)
)
else
()
else
()
...
@@ -189,7 +189,7 @@ macro(luajit_build)
...
@@ -189,7 +189,7 @@ macro(luajit_build)
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
/third_party/luajit
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
/third_party/luajit
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
PROJECT_SOURCE_DIR
}
/third_party/luajit
${
PROJECT_BINARY_DIR
}
/third_party/luajit
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
PROJECT_SOURCE_DIR
}
/third_party/luajit
${
PROJECT_BINARY_DIR
}
/third_party/luajit
COMMAND $
(
MAKE
)
${
luajit_buildoptions
}
clean
COMMAND $
(
MAKE
)
${
luajit_buildoptions
}
clean
COMMAND $
(
MAKE
)
-C src
${
luajit_buildoptions
}
libluajit.a
COMMAND $
(
MAKE
)
-C src
${
luajit_buildoptions
}
DEPENDS
${
PROJECT_BINARY_DIR
}
/CMakeCache.txt
${
PROJECT_BINARY_DIR
}
/third_party/luajit
DEPENDS
${
PROJECT_BINARY_DIR
}
/CMakeCache.txt
${
PROJECT_BINARY_DIR
}
/third_party/luajit
)
)
endif
()
endif
()
...
...
This diff is collapsed.
Click to expand it.
cmake/utils.cmake
+
1
−
1
View file @
c9d88d5f
...
@@ -56,7 +56,7 @@ function(lua_source varname filename)
...
@@ -56,7 +56,7 @@ function(lua_source varname filename)
COMMAND
${
ECHO
}
'\;' >>
${
tmpfile
}
COMMAND
${
ECHO
}
'\;' >>
${
tmpfile
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
tmpfile
}
${
dstfile
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
tmpfile
}
${
dstfile
}
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
tmpfile
}
COMMAND
${
CMAKE_COMMAND
}
-E remove
${
tmpfile
}
DEPENDS
${
srcfile
}
txt2c
)
DEPENDS
${
srcfile
}
txt2c
libluajit
)
set
(
var
${${
varname
}}
)
set
(
var
${${
varname
}}
)
set
(
${
varname
}
${
var
}
${
dstfile
}
PARENT_SCOPE
)
set
(
${
varname
}
${
var
}
${
dstfile
}
PARENT_SCOPE
)
...
...
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
13
−
0
View file @
c9d88d5f
...
@@ -31,6 +31,19 @@ lua_source(lua_sources lua/tap.lua)
...
@@ -31,6 +31,19 @@ lua_source(lua_sources lua/tap.lua)
lua_source
(
lua_sources lua/fio.lua
)
lua_source
(
lua_sources lua/fio.lua
)
lua_source
(
lua_sources lua/strict.lua
)
lua_source
(
lua_sources lua/strict.lua
)
lua_source
(
lua_sources ../third_party/luafun/fun.lua
)
lua_source
(
lua_sources ../third_party/luafun/fun.lua
)
# LuaJIT jit.* library
lua_source
(
lua_sources ../third_party/luajit/src/jit/bc.lua
)
lua_source
(
lua_sources ../third_party/luajit/src/jit/bcsave.lua
)
lua_source
(
lua_sources ../third_party/luajit/src/jit/dis_x86.lua
)
lua_source
(
lua_sources ../third_party/luajit/src/jit/dis_x64.lua
)
lua_source
(
lua_sources ../third_party/luajit/src/jit/dump.lua
)
lua_source
(
lua_sources ../third_party/luajit/src/jit/vmdef.lua
)
lua_source
(
lua_sources ../third_party/luajit/src/jit/v.lua
)
if
(
EXISTS ../third_party/luajit/src/jit/p.lua
)
# Profiler LuaJIT 2.1+
lua_source
(
lua_sources ../third_party/luajit/src/jit/p.lua
)
lua_source
(
lua_sources ../third_party/luajit/src/jit/zone.lua
)
endif
()
add_custom_target
(
generate_lua_sources
add_custom_target
(
generate_lua_sources
WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
/src/box
WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
/src/box
...
...
This diff is collapsed.
Click to expand it.
src/lua/init.cc
+
32
−
3
View file @
c9d88d5f
...
@@ -88,7 +88,18 @@ extern char strict_lua[],
...
@@ -88,7 +88,18 @@ extern char strict_lua[],
help_lua
[],
help_lua
[],
help_en_US_lua
[],
help_en_US_lua
[],
tap_lua
[],
tap_lua
[],
fio_lua
[];
fio_lua
[],
/* jit.* library */
vmdef_lua
[],
bc_lua
[],
bcsave_lua
[],
dis_x86_lua
[],
dis_x64_lua
[],
dump_lua
[],
v_lua
[];
#if LUAJIT_VERSION_NUM >= 20100
/* LuaJIT 2.1+ */
extern
char
p_lua
[],
zone_lua
[];
#endif
/* LuaJIT 2.1+ */
static
const
char
*
lua_modules
[]
=
{
static
const
char
*
lua_modules
[]
=
{
/* Make it first to affect load of all other modules */
/* Make it first to affect load of all other modules */
...
@@ -109,6 +120,19 @@ static const char *lua_modules[] = {
...
@@ -109,6 +120,19 @@ static const char *lua_modules[] = {
"tap"
,
tap_lua
,
"tap"
,
tap_lua
,
"help.en_US"
,
help_en_US_lua
,
"help.en_US"
,
help_en_US_lua
,
"help"
,
help_lua
,
"help"
,
help_lua
,
/* jit.* library */
"jit.vmdef"
,
vmdef_lua
,
"jit.bc"
,
bc_lua
,
"jit.bcsave"
,
bcsave_lua
,
"jit.dis_x86"
,
dis_x86_lua
,
"jit.dis_x64"
,
dis_x64_lua
,
"jit.dump"
,
dump_lua
,
"jit.v"
,
v_lua
,
#if LUAJIT_VERSION_NUM >= 20100
/* LuaJIT 2.1+ */
/* Profiler */
"jit.p"
,
p_lua
,
"jit.zone"
,
zone_lua
,
#endif
/* LuaJIT 2.1+ */
NULL
NULL
};
};
...
@@ -366,8 +390,13 @@ tarantool_lua_init(const char *tarantool_bin, int argc, char **argv)
...
@@ -366,8 +390,13 @@ tarantool_lua_init(const char *tarantool_bin, int argc, char **argv)
if
(
luaL_loadbuffer
(
L
,
modsrc
,
strlen
(
modsrc
),
modfile
))
if
(
luaL_loadbuffer
(
L
,
modsrc
,
strlen
(
modsrc
),
modfile
))
panic
(
"Error loading Lua module %s...: %s"
,
panic
(
"Error loading Lua module %s...: %s"
,
modname
,
lua_tostring
(
L
,
-
1
));
modname
,
lua_tostring
(
L
,
-
1
));
lua_call
(
L
,
0
,
1
);
lua_pushstring
(
L
,
modname
);
lua_setfield
(
L
,
-
3
,
modname
);
/* package.loaded.modname = t */
lua_call
(
L
,
1
,
1
);
if
(
!
lua_isnil
(
L
,
-
1
))
{
lua_setfield
(
L
,
-
3
,
modname
);
/* package.loaded.modname = t */
}
else
{
lua_pop
(
L
,
1
);
/* nil */
}
lua_pop
(
L
,
1
);
/* chunkname */
lua_pop
(
L
,
1
);
/* chunkname */
}
}
lua_pop
(
L
,
1
);
/* _LOADED */
lua_pop
(
L
,
1
);
/* _LOADED */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment