LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   changing glibc's default ld.so.conf path (https://www.linuxquestions.org/questions/linux-software-2/changing-glibcs-default-ld-so-conf-path-898628/)

entz 08-21-2011 10:40 AM

changing glibc's default ld.so.conf path
 
hi folks,

compiled and packaged glibc into an rpm....CHECK
installed it into a test directory ...CHECK
chroot into the test directory....FAILED!

the reason is because glibc seems to be looking for ld.so.cache or ld.so.conf in the wrong directories (namely the BUILDROOT directory of the rpm system which is of course different from the test chroot directory)

the question is , how can i stop glibc from hardwiring the default location for those cache and config files or at least change those locations post-compilation ?

when running ldconfig of the newly installed glibc , the error is made clear but i don't know how to correct it...help is needed ;)

cheers

knudfl 08-21-2011 11:08 AM

Please have a look into a glibc.spec from a glibc.SRC.RPM.

Example Fedora 15 glibc-2.13.90-9.src.rpm
http://download.fedora.redhat.com/pu...3.90-9.src.rpm


$ grep -n ld.so.cache glibc.spec :

533:> $RPM_BUILD_ROOT/etc/ld.so.cache
987:%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache

etc. etc. : 1050 lines spec file to build glibc.

..

entz 08-21-2011 01:46 PM

Quote:

Originally Posted by knudfl (Post 4449391)
Please have a look into a glibc.spec from a glibc.SRC.RPM.

Example Fedora 15 glibc-2.13.90-9.src.rpm
http://download.fedora.redhat.com/pu...3.90-9.src.rpm


$ grep -n ld.so.cache glibc.spec :

533:> $RPM_BUILD_ROOT/etc/ld.so.cache
987:%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache

etc. etc. : 1050 lines spec file to build glibc.

..

Okay ...and how exactly is that supposed to solve my problem?
the fact that fedora's glibc specs file is 10 times bigger and more complicated than mine (with less than 50 lines) , is just one reason why i don't find it useful to peek at other people's work , second reason is that my distro is nothing like Fedora and the third being that you're missing the Woods for the Trees.

to recap , i've a very specific problem which is that , during configuration autoconf script is told via the rpm specs file and the config parameter file to install the files into specific locations for later packaging by rpm (which is obviously BUILDROOT)

E.X
Quote:

./configure --prefix=$RPM_BUILD_ROOT/usr ....bla bla
and with configparam in BUILD directory containing something like:
Quote:

slibdir=$RPM_BUILD_ROOT/lib (alternatively lib64)
THE PROBLEM , is that during compilation the libc object libraries are apparently given the above path (i.e $RPM_BUILD_ROOT/etc ) to be hardwired into them , meaning that once glibc is packaged and installed/relocated into its final directory it will no longer find ld.so.conf or ld.so.cache .

NOTE: needless to say this problem would not arise if RPM wasn't involved.

so the Question is : How can i tell the Autoconf script to NOT hardwire the above given path into them when looking for the conf/cache files or at least to hardwire something else (i.e the correct path) ??

cheers

entz 08-21-2011 07:02 PM

Well i've found the solution myself.

and that is to use the 'install_root' argument with 'make install' such as in:
Quote:

make install_root=$RPM_BUILD_ROOT/usr install
while setting all other arguments in configparam or in the configure as if the installation will go into / by default !

this will relocate glibc into the chroot or test directory without messing up the hardwired scripts paths .

cheers


All times are GMT -5. The time now is 05:29 AM.