LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   "Locking in" Glibc (replace prob /lib/ld-linux.so.2 with /tools/lib/ld-linux.so.2 (http://www.linuxquestions.org/questions/linux-from-scratch-13/locking-in-glibc-replace-prob-lib-ld-linux-so-2-with-tools-lib-ld-linux-so-2-a-211737/)

irfanali 07-31-2004 01:19 AM

"Locking in" Glibc (replace prob /lib/ld-linux.so.2 with /tools/lib/ld-linux.so.2
 
Hi ALL,

Every thing was going right...and there was no error in installation of LFS 5.
In "Locking in"Glibc section ,the book says we need to djust linker and compiler's spec file.
after executing this command "make -C ld install" when i have treid to amend gcc spec file just by replacing "lib/ld-linux.so.2" with "/tools/lib/ld-linux.so.2" my existing system crashed and when i boot my machine from linux it says "Kernel panic something error..........."
i am very new to linux and LFS

Can anybody help to me to get rid of this kind of problem.. :newbie:

320mb 07-31-2004 09:41 AM

from the book........
Quote:

First install the adjusted linker by running the following from within the
binutils-build directory:

make -C ld install
did you issue this while 'inside' the binutils-build directory???


Quote:

The next thing to do is to amend our GCC specs file so that it points to
the new dynamic linker. A simple sed will accomplish this:

SPECFILE=/tools/lib/gcc-lib/*/*/specs &&
sed -e 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \
$SPECFILE > tempspecfile &&
mv -f tempspecfile $SPECFILE &&
unset SPECFILE

We recommend that you cut-and-paste the above rather than try and type it
all in. Or you can edit the specs file by hand if you want to: just
replace any occurrence of "/lib/ld-linux.so.2" with
"/tools/lib/ld-linux.so.2".

did you cut and paste like suggested?? it's very easy to type the info wrong!!!

irfanali 08-07-2004 12:24 AM

Yes, I Have installed the linker by running "make -C ld install within the binutils-build dir
and executed both commands by cut and paste " SPECFILE=/tools/........................unset SPECFILE" and "rm -f /tools/lib/gcc-lib/*/*/include/{pthread.h,bits/sigthread.h}"

now after excuting this
echo 'main(){}' > dummy.c
gcc dummy.c
readelf -l a.out | grep ': /tools'

this error is comming ---------------> "readelf: Error: Cannot stat input file a.out."

Could you help me again...? thnx

320mb 08-07-2004 01:18 AM

OK, copy/paste that SPECFILE just like you see it......
DONT change anything...........


</edit> did you apply the glibc-2.3.2-sscanf-1.patch??

and from the term window type .........

Code:

echo $LFS
what does it say??

Engmar 08-07-2004 03:39 PM

similar
 
I'm at very nearly the same situation. I'm in chapter 5 of unstable. I executed the sed script to change all instances of /lib/ld-linux.so.2 to /tools/lib/ld-linux.so.2 within the gcc spec file. I then visually inspected the spec file, and found only instances of the original /lib/ld-linux.so.2

The spec patch states it is intended for pass 2. Should I have applied it anyway? I won't polute the thread with my listings until irfanali's problems are ironed out, but am following with interest =)

320mb 08-07-2004 03:50 PM

LOL, sorry about that .......MY FAULT!!!.......
I meant to ask him about the sscanf patch.........

I changed it...........
the book is right........the spec patch is for "pass 2"
are you getting any other errors.......??

Engmar 08-07-2004 04:00 PM

I'm not getting any errors at all yet. I was afraid to proceed past this point, after visually inspecting the specs file and finding it unchanged. I should be looking at the specs file in /lfs/sources/gcc-build/gcc correct?

Other than reading a couple of quick tutorials, sed is beyond my pay grade - so far. I recieved no errors or warnings from the script. It did ... something. It didn't change the location of the linker to be used, though. I can just go ahead and edit it by hand, but am curious about what the script did when I ran it ...

320mb 08-07-2004 04:10 PM

Quote:

Originally posted by Engmar
I'm not getting any errors at all yet. I was afraid to proceed past this point, after visually inspecting the specs file and finding it unchanged. I should be looking at the specs file in /lfs/sources/gcc-build/gcc correct?


No, the Specfile is in /tools/lib/gcc-lib/*/*/
just like the script says..........I think that where irfanali went wrong, he
changed by hand and it was the wrong one............

Engmar 08-07-2004 04:44 PM

Wow. I should _always_ have my morning coffee before reading scripts =D
I was looking at the original, not the newly created. I will slink away now. Thank
you very much.

320mb 08-07-2004 08:15 PM

Hey, LFS can teach you alot.......when you finish, get the beyond LFS book
and continue on...............

http://linuxfromscratch.idge.net/hints/downloads/files/

the above is a directory for LFS/BLFS hints...........get the lfsbackup.txt
so you can save a tarball for later............LOL

Engmar 08-08-2004 01:08 AM

I'm definitely learning. I think I might need 2 or 3 runs through the process, using all related texts, to get as deep an understanding as I want. Then some intensive "poking around" sessions. BLFS is definitely in my future.

pradeepmenon777 06-29-2006 10:19 AM

thanks a lot!
 
This thread helped me a lot in my LFS project.
Thanks a lot!


All times are GMT -5. The time now is 02:30 PM.