LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-21-2011, 10:40 AM   #1
entz
Member
 
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453
Blog Entries: 3

Rep: Reputation: 40
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
 
Old 08-21-2011, 11:08 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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.

..

Last edited by knudfl; 08-21-2011 at 11:15 AM.
 
0 members found this post helpful.
Old 08-21-2011, 01:46 PM   #3
entz
Member
 
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453

Original Poster
Blog Entries: 3

Rep: Reputation: 40
Quote:
Originally Posted by knudfl View Post
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

Last edited by entz; 08-21-2011 at 01:49 PM.
 
Old 08-21-2011, 07:02 PM   #4
entz
Member
 
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453

Original Poster
Blog Entries: 3

Rep: Reputation: 40
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

Last edited by entz; 08-21-2011 at 07:04 PM.
 
1 members found this post helpful.
  


Reply

Tags
buildroot, glibc



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the location a module is loaded from without changing the default path zOSGuy Linux - Newbie 2 09-28-2010 02:43 PM
Changing default installation path for pirut vofka Linux - General 1 12-02-2009 10:16 AM
what is the path of smb.conf wlaw Linux - Networking 3 09-22-2007 02:59 AM
the "default" ( as we have in grub.conf ) option of lilo.conf ??? b0nd Linux - Newbie 4 09-14-2005 05:51 AM
Changing default OS in lilo.conf mecister Linux - General 1 06-27-2004 07:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration