[tlbuild] asy & libgcc_s.so.1

Vladimir Volovich vvv at vsu.ru
Mon Oct 5 12:06:46 CEST 2009


"RK" == Reinhard Kotucha writes:

 RK> And I always thought that Peter's system is even older than
 RK> mine. :)

what's so cool in running an outdated os? :)

 RK> Does the binary I compiled work on your system?

 RK>    http://tug.org/~kotucha/asy.gz

no, it doesn't:

$ ./asy
./asy: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory

$ ldd ./asy 
	linux-vdso.so.1 =>  (0x00007fff3c933000)
	libGLU.so.1 => /usr/lib/libGLU.so.1 (0x00007f4fc008d000)
	libglut.so.3 => /usr/lib/libglut.so.3 (0x00007f4fbfe4a000)
	libfftw3.so.3 => /usr/lib/libfftw3.so.3 (0x00007f4fbfb4b000)
	libreadline.so.6 => not found
	librt.so.1 => /lib/librt.so.1 (0x00007f4fbf943000)
	libsigsegv.so.0 => not found
	libpthread.so.0 => /lib/libpthread.so.0 (0x00007f4fbf728000)
	libz.so.1 => /usr/lib/libz.so.1 (0x00007f4fbf511000)
	libncurses.so.5 => /lib/libncurses.so.5 (0x00007f4fbf2d2000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f4fbefc4000)
	libm.so.6 => /lib/libm.so.6 (0x00007f4fbed41000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f4fbeb27000)
	libc.so.6 => /lib/libc.so.6 (0x00007f4fbe7d6000)
	libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f4fbe559000)
	libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f4fbe348000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f4fbe00d000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f4fc02fe000)
	libdl.so.2 => /lib/libdl.so.2 (0x00007f4fbde09000)
	libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x00007f4fbdc04000)
	libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00007f4fbda02000)
	libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007f4fc03f1000)
	libdrm.so.2 => /usr/lib/libdrm.so.2 (0x00007f4fbd7f8000)
	libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f4fbd5f6000)
	libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f4fbd3da000)
	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f4fbd1d5000)

Your binary has too any shared library dependencies.

Here is a recipe i used to build asymptote to minimize shared library
dependencies:

===============================================

1) installed the necessary development packages with static libs
   (in particular, libglut3-dev, libglut3, zlib1g-dev)

2) downloaded gsl-1.12 sources from gnu site, configured it with --prefix=/tmp,
   compiled it and installed in /tmp/gsl, and also:

  export CPPFLAGS="-I/tmp/gsl/include"
  export LDFLAGS="-L/tmp/gsl/lib"

   (that's because the gsl shipped with debian etch was too old and
   unusable with asymptote)

3) built asy as described at http://tug.org/texlive/build.html#asymptote

mv .svn dot.svn && ./configure --prefix=/tmp/asyinst --enable-texlive-build && make && mv dot.svn .svn

4) relink asy with static libs:

   the last command when compiling asymptote, will be the link command, e.g.

g++ -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -DUSEGC  -I/tmp/gsl/include -g -O3  -o asy camperror.o path.o drawpath.o drawlabel.o picture.o psfile.o texfile.o util.o settings.o guide.o flatguide.o knot.o drawfill.o path3.o drawpath3.o drawsurface.o runtime.o runbacktrace.o runpicture.o runlabel.o runhistory.o runarray.o runfile.o runsystem.o runpair.o runtriple.o runpath.o runpath3d.o runstring.o runmath.o env.o genv.o main.o stm.o dec.o errormsg.o callable.o name.o symbol.o types.o entry.o exp.o newexp.o stack.o camp.tab.o lex.yy.o access.o virtualfieldaccess.o absyn.o record.o interact.o fileio.o builtin.o fftw++.o simpson.o coder.o coenv.o locate.o parser.o program.o application.o varinit.o fundec.o refaccess.o envcompleter.o process.o constructor.o array.o Delaunay.o predicates.o prc/PRCbitStream.o prc/oPRCFile.o prc/PRCdouble.o prc/writePRC.o glrender.o tr.o arcball.o algebra3.o quaternion.o svnrevision.o -L/tmp/gsl/lib -lGLU -lglut -lfftw3 -lreadline -lrt -lsigsegv -lpthread -lz -lm -lncurses -lgsl -lgslcblas   gc-7.1/.libs/libgc.a

now, before the first -l... option, i've added

  -nodefaultlibs -Wl,-Bstatic

and after the last one i added

  -lstdc++ -Wl,-Bdynamic -lgcc_s -lc

and also moved

  -lpthread -lm

outside of the static block, and added

  -lGL

which in my case resulted in

g++ -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -DUSEGC  -g -O3  -o asy camperror.o path.o drawpath.o drawlabel.o picture.o psfile.o texfile.o util.o settings.o guide.o flatguide.o knot.o drawfill.o path3.o drawpath3.o drawsurface.o runtime.o runbacktrace.o runpicture.o runlabel.o runhistory.o runarray.o runfile.o runsystem.o runpair.o runtriple.o runpath.o runpath3d.o runstring.o runmath.o env.o genv.o main.o stm.o dec.o errormsg.o callable.o name.o symbol.o types.o entry.o exp.o newexp.o stack.o camp.tab.o lex.yy.o access.o virtualfieldaccess.o absyn.o record.o interact.o fileio.o builtin.o fftw++.o simpson.o coder.o coenv.o locate.o parser.o program.o application.o varinit.o fundec.o refaccess.o envcompleter.o process.o constructor.o array.o Delaunay.o predicates.o prc/PRCbitStream.o prc/oPRCFile.o prc/PRCdouble.o prc/writePRC.o glrender.o tr.o arcball.o algebra3.o quaternion.o svnrevision.o -nodefaultlibs -Wl,-Bstatic -lGLU -lglut -lfftw3 -lreadline -lrt -lsigsegv -lz -lncurses -L/tmp/gsl/lib -lgsl -lgslcblas  gc-7.1/.libs/libgc.a -lstdc++ -Wl,-Bdynamic -lpthread -lm -lGL -lgcc_s -lc 

(if you will get a link error, install the missing development packages
with static libs.)

now, this binary has a minimal set of shared library dependencies.

5) strip asy

===============================================

i've built asymptote using gcc 3.4 opn debian etch, and now it will
likely work on your system, since now i get

$ strings -a asy | grep GCC_
GCC_3.3.1
GCC_3.3
GCC_3.0

compared to what it was before:

$ strings -a asy | grep GCC_
GCC_3.3.1
GCC_3.3
GCC_4.2.0
GCC_3.0

please try this binary on your system:

http://tug.org/~vvv/asy.gz

Best,
v.


More information about the tlbuild mailing list