LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-23-2013, 04:56 AM   #1
AN28
Member
 
Registered: Apr 2013
Posts: 93

Rep: Reputation: 0
GCC compilation error


Hi,

i was happilly waiting while the gcc patch was being compiled when suddenly the power went off... (
i then powered the machine up again and mounted the partitions and tried to get back to where i stopped.

sadly when i run the

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


i get the output as
readelf: Error: 'a.out': No such file

what should I do ?
 
Old 04-23-2013, 08:57 AM   #2
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
First of all make sure that your filesystems are ok, by running fsck against them.
Second. I'm not sure what you mean by 'the gcc patch', but most sources come with a clean option for the makefile. So try something like 'make clean' or 'make distclean'. And then try compiling again.

Cheers
 
Old 04-23-2013, 09:11 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,120

Rep: Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270
and try to see what is in dummy.log (or post it)
 
Old 04-23-2013, 01:09 PM   #4
AN28
Member
 
Registered: Apr 2013
Posts: 93

Original Poster
Rep: Reputation: 0
Thanks guys I will check it out and keep u posted

Last edited by AN28; 04-23-2013 at 01:12 PM.
 
Old 04-24-2013, 12:53 AM   #5
AN28
Member
 
Registered: Apr 2013
Posts: 93

Original Poster
Rep: Reputation: 0
Hi,
i found out that the reason behind my previous question was because i had to re-initialize the chroot environment given in the begin of chapter 6. (stupid me )

however after that i encounted some other problems

#1
when searching for the correct header files i get the output that the terminal is ignoring some directories and

#2
when verifying that the new linker is being used with the correct search paths one directory is omitted as per the books result.

however i went ahead and the subsequent commands were successful but

#3 once again in the end of the compilation process when trying to move a misplaced file i get stuck coz it says no such directory

PLEASE tell me where i have gone wrong ...............

p.s. i have colour-coded each prob with my resulting output below

---------------------------------------------------------------------------------------------------------------------------------------------------

root:/sources/gcc-build# echo 'main(){}' > dummy.c
root:/sources/gcc-build# cc dummy.c -v -Wl,--verbose &> dummy.log
root:/sources/gcc-build# readelf -l a.out | grep ': /lib'
[Requesting program interpreter: /lib/ld-linux.so.2]
root:/sources/gcc-build# grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
/usr/lib/crt1.o succeeded
/usr/lib/crti.o succeeded
/usr/lib/crtn.o succeeded
root:/sources/gcc-build# grep -B4 '^ /usr/include' dummy.log
ignoring nonexistent directory "/tools/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../i686-pc-linux-gnu/include"
ignoring duplicate directory "/tools/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include

[COLOR="rgb(255, 0, 255)"]root:/sources/gcc-build# grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
SEARCH_DIR("/tools/i686-pc-linux-gnu/lib")
SEARCH_DIR("/usr/lib")
SEARCH_DIR("/lib")
;[/COLOR]
root:/sources/gcc-build# grep "/lib.*/libc.so.6 " dummy.log
attempt to open /lib/libc.so.6 succeeded
root:/sources/gcc-build# grep found dummy.log
found ld-linux.so.2 at /lib/ld-linux.so.2
root:/sources/gcc-build# rm -v dummy.c a.out dummy.log
removed 'dummy.c'
removed 'a.out'
removed 'dummy.log'
root:/sources/gcc-build# mkdir -pv /usr/share/gdb/auto-load/usr/lib
mkdir: created directory '/usr/share/gdb'
mkdir: created directory '/usr/share/gdb/auto-load'
mkdir: created directory '/usr/share/gdb/auto-load/usr'
mkdir: created directory '/usr/share/gdb/auto-load/usr/lib'
[COLOR="rgb(255, 140, 0)"]root:/sources/gcc-build# mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib
mv: cannot stat '/usr/lib/*gdb.py': No such file or directory
[/COLOR]

Last edited by AN28; 04-24-2013 at 01:14 AM.
 
Old 04-24-2013, 10:27 PM   #6
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
Your reference to chapter 6 did make me realise that you were working on linux from scratch. It would have been easier had you mentioned that in your first post. I'm curious which version of the book you're using?

Also I don't know if you noticed, but there is a specific sub-forum for LFS in the distribution forum.

Cheers
 
Old 04-30-2013, 02:02 AM   #7
AN28
Member
 
Registered: Apr 2013
Posts: 93

Original Poster
Rep: Reputation: 0
ohh ok thank you for that piece of info.. sorry but i wasn't aware

and i am using LFS 7.3

---------- Post added 04-30-13 at 01:02 AM ----------

ohh ok thank you for that piece of info.. sorry but i wasn't aware

and i am using LFS 7.3
 
  


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 4.4.3 compilation error pankajd Linux - Software 1 04-03-2010 10:50 AM
gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7) compilation error adhesh_19 Red Hat 0 01-05-2010 06:34 AM
have gcc compilation error during gcc installtion in linuxfromscratch vbshanmugaprakash Linux - General 3 12-13-2006 06:52 AM
gcc compilation error Proger Programming 1 03-22-2003 01:32 PM


All times are GMT -5. The time now is 08:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration