An idea: isolate libs [was: Pure LFS]

Tushar Teredesai tushar at linuxfromscratch.org
Thu Feb 6 07:36:20 PST 2003


Ryan.Oliver at pha.com.au 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.
>  
>
A variation might work, though I am not in favor of that.

Just move all the *.so links to a temporary location. Leave the 
lib*.so.* links and files around coz those are the files that are needed 
in runtime. During compilation and linking, linker looks for libfoo.so 
but links to the soname of the lib found i.e. libfoo.so.N. So if 
libfoo.so is not found, the package won't link to libfoo but the 
previously compiled host packages will continue to run since libfoo.so.N 
exists.

But I think it would be easier to use the -notsdtinc and -nostdlib flags.

-- 
Tushar Teredesai
   http://www.linuxfromscratch.org/~tushar/
   http://www.geocities.com/tushar/


-- 
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