[tlbuild] Stripping the luatex binary
Philipp Stephani
st_philipp at yahoo.de
Wed Mar 30 10:48:16 CEST 2011
Am 30.03.2011 um 09:31 schrieb Taco Hoekwater:
>> At the moment all installed programs are automatically stripped. We could
>> certainly find a mechanism to prevent that, but then only for all
>> programs. However, not stripping any Mac OS X programs would seem
>> somewhat extreme.
>
> Agreed.
>
> Perhaps it is just that the mac linker needs -E always?
ld on OS X has no -E option. (In general, all linker options are different from the Linux linker options.)
Linking Lua on OS X has no special requirements. For example, the official Lua distribution just does
gcc -o lua lua.o liblua.a -lm -lreadline
(lua.o is the interpreter, liblua.a is the Lua library = liblua51.a in LuaTeX)
Then the public symbols from the library stay in the executable:
$ nm lua | grep lua_call
0000000100003150 T _lua_call
And the dynamic loader needs them to load extension modules.
Extension modules have to be linked with -undefined dynamic_lookup because by default, the OS X linker resolves symbols while linking when building a dynamic library (unlike Linux), but the Lua library and executable have no such requirements.
Extension modules need only those symbols that are described in the Lua manual. So it should suffice to keep all symbols starting with _lua.
More information about the tlbuild
mailing list