LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 07-18-2007, 04:22 PM   #1
lukeiamyourfather
Member
 
Registered: Jul 2007
Distribution: Ubuntu, LFS, Fedora
Posts: 30

Rep: Reputation: 15
Exclamation gcc doesn't seem to be working...


okay, I am trying to build an LFS-6.2 system and have run into many bumps on the road, but this one is the hardest.

also, the host is an Ubuntu Dapper (6.06), i586 AMD-K62 500 MHz, 384 MBs RAM

I am in chapter 6, in the re-ajusting the toolchain (6.10) section. I get to the part where you make sure the compiler is working, and I do this:

echo 'main(){}' > dummy.c
cc dummy.c -Wl,--verbose &> dummy.log
readelf -l a.out | grep ': /lib'


then I get an error that there is no a.out file. it seems that gcc is not generating the executable.

this was a test to make sure that the compiler was working properly. well, apparently it failed.

then, I tried the next test:

grep -o '/usr/lib.*/crt[1in].* .*' dummy.log

the book tells me that this is the correct results:

/usr/lib/crt1.o succeeded
/usr/lib/crti.o succeeded
/usr/lib/crtn.o succeeded


I only got the first two. "/usr/lib/crtn.o" did not even show up.

thanks for any help you can provide.

EDIT: i got some more info:

i tried this:

cc dummy.c

and got this:

/tools/lib/gcc/i586-pc-linux-gnu/4.0.3/../../../../i586-pc-linux-gnu/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status


it looks like it can't find a library file.

what do i need to do?

Last edited by lukeiamyourfather; 07-18-2007 at 05:05 PM.
 
Old 07-19-2007, 01:28 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You should find the named library (libgcc_s), and then make sure the compiler can also find it. You can do this either by adding an appropriate -L switch to the compiler commandline, or by moving or linking the library to a default library location that will be searched by the compiler/linker.
--- rod.
 
Old 07-29-2007, 06:40 PM   #3
lukeiamyourfather
Member
 
Registered: Jul 2007
Distribution: Ubuntu, LFS, Fedora
Posts: 30

Original Poster
Rep: Reputation: 15
okay, i think i know what you meant. i have little experience working with libraries and stuff, so what commands/actions would i use?

thanks,
chris
 
Old 07-29-2007, 10:42 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
To find the library:
Code:
find / -name "*libgcc_s*"
To use the library:
Code:
gcc -L /directory/where/libgcc_s/was/found .....rest of gcc commandline.....
Just try to think like a compiler.

--- rod.
 
Old 07-30-2007, 07:59 AM   #5
lukeiamyourfather
Member
 
Registered: Jul 2007
Distribution: Ubuntu, LFS, Fedora
Posts: 30

Original Poster
Rep: Reputation: 15
alright, i wont get to try it right away, but thanks a million.
 
Old 07-30-2007, 09:22 AM   #6
help_a_newbie
Member
 
Registered: May 2007
Posts: 87

Rep: Reputation: 15
I had the exact same prob and I had to start over again! I hope you get that right!

[Posted by 87.202.46.7 via http://webwarper.net This is added while posting a message to avoid misuse.
Try: http://webwarper.net/webwarper.exe Example of viewing: http://webwarper.net/ww/~av/www.linu...splay.php?f=13 ]
 
Old 07-31-2007, 09:50 AM   #7
lukeiamyourfather
Member
 
Registered: Jul 2007
Distribution: Ubuntu, LFS, Fedora
Posts: 30

Original Poster
Rep: Reputation: 15
well, i am starting again. i had to delete that partition.

anyway, when i get paid from my job, (video editing and server administration [yes, i am fourteen]) i am going to buy myself a new motherboard and processor and RAM, plus my boss is giving me a bigger hard drive.

so good bye to 4 hour compilations on my amd k6 @ 474 MHz 384 MBs RAM!!!!

thank god i have a job...
 
Old 08-01-2007, 03:25 AM   #8
help_a_newbie
Member
 
Registered: May 2007
Posts: 87

Rep: Reputation: 15
hehe, that's nothing, I had to start over 2 times and now I'm stuck again at the less-394 package... lfs requires lot of patience I guess!

[Posted by 85.74.71.4 via http://algart.net/ww This is added while posting a message to avoid misuse.
Try: http://webwarper.net/webwarper.exe Example of viewing: http://webwarper.net/ww/~av/lycos.com ]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
gcc not working bluknight43 Programming 4 02-14-2005 01:15 PM
Installed GCC, but not working rangalo Linux - Software 2 02-02-2005 01:21 PM
gcc not working after LFS 6.0 ch 6.61 Barnette Linux From Scratch 1 01-11-2005 09:19 PM
gcc compile not working Norman Oklahoma Linux - Software 1 03-22-2004 10:20 AM
SCHED_FIFO not working with g++ but gcc ?! DocBexter Programming 0 09-09-2003 12:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 09:21 PM.

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