-
Vladislav Shpilevoy authored
dynamic-list (exported_symbols_list on Mac) was used to forbid export of all symbols of the tarantool executable except a given list. Motivation of that was to avoid hacking the linker with false usage of symbols needed to be exported. As a consequence, symbols not listed in these options became invisible. Before these options, when a symbol was defined, but not used in the final executable, the linker could throw it away, even though many symbols were used by Lua FFI, or should be visible for user's dynamic modules. Where the linker, obviously, can't see if they are needed. To make the linker believe the symbols are actually needed there was a hack with getting pointers at these functions and doing something with them. For example, assume we have 'test()' function in 'box' static library: int test(void); It is not used anywhere in the final executable. So to trick the linker there is a function 'export_syms()' declared, which takes a pointer at 'test()' and seemingly does something with it (or actually does - it does not matter): void export_syms() { void *syms[] = {test}; if (time(NULL) == 0) { syms[0](); syms[1](); ... } } Some users want to use not documented but visible symbols, so the patch removes the dynamic-list option, and returns the linker hack back. But with 0 dependencies in the export file. Closes #2971
Vladislav Shpilevoy authoreddynamic-list (exported_symbols_list on Mac) was used to forbid export of all symbols of the tarantool executable except a given list. Motivation of that was to avoid hacking the linker with false usage of symbols needed to be exported. As a consequence, symbols not listed in these options became invisible. Before these options, when a symbol was defined, but not used in the final executable, the linker could throw it away, even though many symbols were used by Lua FFI, or should be visible for user's dynamic modules. Where the linker, obviously, can't see if they are needed. To make the linker believe the symbols are actually needed there was a hack with getting pointers at these functions and doing something with them. For example, assume we have 'test()' function in 'box' static library: int test(void); It is not used anywhere in the final executable. So to trick the linker there is a function 'export_syms()' declared, which takes a pointer at 'test()' and seemingly does something with it (or actually does - it does not matter): void export_syms() { void *syms[] = {test}; if (time(NULL) == 0) { syms[0](); syms[1](); ... } } Some users want to use not documented but visible symbols, so the patch removes the dynamic-list option, and returns the linker hack back. But with 0 dependencies in the export file. Closes #2971