An idea: isolate libs [was: Pure LFS]

torsten torsten at inetw.net
Thu Feb 6 10:13:05 PST 2003


On Fri the 07 Feb 2003 at 01 hours EST
ROCA wrote...
>
>Miguel Bazdresch wrote:
>> I don't yet fully understand everything that is involved in
>> what you're trying to do here, but while digesting it in my mind
>> I had an idea.
>>
>> It seems like we're trying to prevent, at all costs, from linking to
>the> host's libraries. So, why don't we make those libraries
>unreachable> before compilation? The easiest way is just to rename
>them. For example,> if there is a risk of something linking to a
>library in directory> /path/to/lib, first do a
>>
>> mv /path/to/lib /path/to/lib_
>
>The one problem you will find there is the host system's binaries need
>those
>libraries and expect to find them there. I suppose you could move them
>out the way but you'd have to set LD_LIBRARY_PATH which would defeat
>the purpose.

Here is a script given to me to fix the paths problem in libraries.  It
may work for binaries, but I hvae not tested it on either, because I
don't
understand it.

toshy:root:/home/torsten# cat `which fixlib`
#!/bin/sh

if [ -z "$*" ]; then
  echo "$0 badlib goodlib"
  exit
fi

#cd /vapp/lib
cd /usr/local/src/test/lib

grep $1 --binary-files=without-match * | while read l
do
  lib=`echo $l | cut -f1 -d':'`  
  cd /usr/local/src/test/lib/test
  liblocation=`find . -name $lib 2> /dev/null`  echo "Fixing
$liblocation"
  perl -pi -e's#'$1'#'$2'#' $liblocation
done
toshy:root:/home/torsten# 





Torsten
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list