[tlbuild] Stripping the luatex binary

Philipp Stephani st_philipp at yahoo.de
Wed Mar 30 12:23:16 CEST 2011


Am 30.03.2011 um 11:05 schrieb Taco Hoekwater:

> On 03/30/2011 10:48 AM, Philipp Stephani wrote:
> 
>> Extension modules need only those symbols that are described in the
>> Lua manual. So it should suffice to keep all symbols starting with
>> _lua.
> 
> 
> Right. But the question is how to do that while still using strip,
> as strip has the habit of removing unused function (labels) altogether.

strip accepts an exception list. The manpage says

       If the executable loads objects, however, the global symbols that the objects reference from the executable also must  not  be  stripped.
       In  this case, you should list the global symbols that the executable wants to allow the objects to reference in a file, and those global
       symbols are then saved when the executable is stripped. For example:
              % strip -u -r -s interface_symbols executable
       where the file interface_symbols would contain only those global symbols from the executable that the executable wants the loaded objects
       to have access to.

However, strip gives a warning if I try to use the -s option, and since on OS X the linker can do the stripping, calling the strip program should probably be avoided in all cases on OS X. The needed symbols should be kept if you link with the following flags:

    -S -x -exported_symbols_list keepsymbols.lst

where keepsymbols.lst contains only the line

    _lua*

(the linker recognizes wildcards)


More information about the tlbuild mailing list