[tlbuild] Stripping the luatex binary

Peter Breitenlohner peb at mppmu.mpg.de
Tue Apr 5 12:31:27 CEST 2011


On Tue, 5 Apr 2011, Philipp Stephani wrote:

> OK, I downloaded the TeX Live source and generated the libtool script by
> running configure, so I hope it is the same thing we're talking about. 
> This script indeed accepts --export-dynamic, but that option is apparently
> a no-op: it appends $export_dynamic_flag_spec to the linker command, which
> is empty on my system.

Hi Philipp,

this is certainly part of the problem.

> From what I've tried so far, the concept of exported symbols seems indeed
> to be completely absent from OS X.

In the case of luatex we luckily use libtool, i.e., 'libtool --mode=link'
could arrange things such that 'libtool --mode=install' doesn't strip too
much.  For linux that implies 'strip --strip-unneeded' for shared and
'strip --strip-debug' for shared libraries.  When building libkpathsea as
static plus shared library, I get:

    /bin/sh ./libtool --mode=install $some_path/install -c -s  libkpathsea.la '$(DESTDIR)$(libdir)'
   libtool: install: $some_path/install -c .libs/libkpathsea.so.6.0.1 $(DESTDIR)$(libdir)/libkpathsea.so.6.0.1
   libtool: install: strip --strip-unneeded $(DESTDIR)$(libdir)/libkpathsea.so.6.0.1
   libtool: install: (cd $(DESTDIR)$(libdir) && { ln -s -f libkpathsea.so.6.0.1 libkpathsea.so.6 || { rm -f libkpathsea.so.6 && ln -s libkpathsea.so.6.0.1 libkpathsea.so.6; }; })
   libtool: install: (cd $(DESTDIR)$(libdir) && { ln -s -f libkpathsea.so.6.0.1 libkpathsea.so || { rm -f libkpathsea.so && ln -s libkpathsea.so.6.0.1 libkpathsea.so; }; })
   libtool: install: $some_path/install -c .libs/libkpathsea.lai $(DESTDIR)$(libdir)/libkpathsea.la
   libtool: install: $some_path/install -c .libs/libkpathsea.a $(DESTDIR)$(libdir)/libkpathsea.a
   libtool: install: strip --strip-debug $(DESTDIR)$(libdir)/libkpathsea.a

where './libtool --mode=install install -c -s  libkpathsea.la' actually
installs .libs/libkpathsea.so.6.0.1 and .libs/libkpathsea.a, and

    STRIPPROG='strip' /bin/sh ./libtool --mode=install /bin/sh ${top_srcdir}/build-aux/install-sh -c -s pdftex luatex '$(DESTDIR)$(bindir)'
   libtool: install: /bin/sh ${top_srcdir}/build-aux/install-sh -c -s .libs/pdftex $(DESTDIR)$(bindir)/pdftex
   libtool: install: /bin/sh ${top_srcdir}/build-aux/install-sh -c -s .libs/luatex $(DESTDIR)$(bindir)/luatex

where './libtool --mode=install install-sh -c -s pdftex' installs
.libs/pdftex and could for OS X similarly treat stripping of pdftex and
luatex differently.  The files ./pdftex and ./luatex are wrapper scripts for
the actual binaries in .libs/ used, e.g., to run the programs with
uninstalled shared libraries and the use of '--export dynamic' could
certainly be recorded in these wrapper scripts and cause differences when
stripping.  All this is, however, something to be worked out between the
Automake, Libtool, and OS X people.

> Or even an "install-sh" problem: install has no way of knowing that it
> shouldn't call strip for one specific binary.

Yes, it might be that libtool and install-sh have to cooperate.

> Or you could use a kludge: Replace "strip" by a shell script that strips
> everything but luatex.  On the other hand, you probably don't gain that
> much from removing the symbol table.  So compiling with -g0 and/or linking
> with -S -x might indeed suffice.

Well, given such a substitute for "strip" this could be done by configure or
maybe even from outside.

Regards
Peter Breitenlohner <peb at mppmu.mpg.de>


More information about the tlbuild mailing list