[Debian-au] compiling for old glibc

Tim Connors tconnors at astro.swin.edu.au
Wed May 21 08:43:34 UTC 2003


On Wed, 21 May 2003, Tim Connors wrote:

> LD_TRACE_LOADED_OBJECTS='' \
> LD_PRELOAD='/home/office/tconnors/lib/usr/lib/Linux/glibc-2.3.1/ld-linux.so.2 \
> /home/office/tconnors/lib/usr/lib/Linux/glibc-2.3.1/libc.so.6' \
> .../mogrify

Haha! Got it. Not quite sure how this differs to what I had, maybe the
phase of the moon changed, or something.

In the interests of google, the problem was how to execute a program
linked against a new glibc on a system using an old glibc (or vice-versa),
without resorting to static linking. This is so you can compile some code
on your home system with all the (semi-modern) developement libraries
installed, and you can run the program on your work computer which is
suffering a bit from old age, and lack of installed developement/header
files.

You will probably have to recompile the thing on your home computer
though, to specify your own --prefix, so that you don't have to be root to
install on the work system (If I was, I would just install debian on the
work computer instead ;)

Replace paths as appropriate

21912> cat bin/runnewglibc
#!/bin/sh
# -*- Mode: shell-script -*-
#template by ~tconnors/bin/newshscript
#Wed May 21 17:30:34 EST 2003

if [ $# -eq 0 ] ; then
   echo "Usage: $0 <glibc-2.3.1-prog> <args> ..." 1>&2
   exit 1
fi

PATH=$HOME/usr/bin/Linux/glibc-2.3.1 \
LD_LIBRARY_PATH=${LD_NEWGLIBC_LIBRARY_PATH}:$HOME/usr/lib/Linux/glibc-2.3.1 \
LD_PRELOAD=${LD_NEWGLIBC_PRELOAD} $HOME/usr/lib/Linux/glibc-2.3.1/ld-2.3.1.so \
"$@"

-- 
TimC -- http://astronomy.swin.edu.au/staff/tconnors/

I'm not a procrastinator! I'm temporally challenged!





More information about the debian-au mailing list