Skip to content
Snippets Groups Projects
Commit d4d28094 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Add a hack to keep FFI symbols in optimized binary

parent f2fe7202
No related merge requests found
......@@ -74,6 +74,7 @@ set (common_sources
opts.c
cpu_feature.c
fiob.c
ffisyms.cc
lua/fiber.cc
lua/trigger.cc
lua/admin.cc
......
#include <bit/bit.h>
#include <lib/msgpuck/msgpuck.h>
/*
* A special hack to cc/ld to keep symbols in an optimized binary.
* Please add your symbols to this array if you plan to use it from LuaJIT FFI.
*/
void *ffi_symbols[] = {
(void *) bswap_u32,
(void *) bswap_u64,
(void *) mp_bswap_float,
(void *) mp_bswap_double
};
......@@ -571,6 +571,13 @@ tarantool_free(void)
fclose(cfg_out);
free(cfg_log);
}
/* A hack for cc/ld, see ffisyms.c */
if (time(NULL) == 0) {
/* never executed */
extern void *ffi_symbols[];
write(0, ffi_symbols, 0);
}
}
int
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment