LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 08-11-2012, 03:04 PM   #1
gibran
Member
 
Registered: Jul 2005
Location: California
Posts: 36

Rep: Reputation: 15
Question gcc compilation failed in version-check.sh script


Under the page http://www.linuxfromscratch.org/lfs/.../hostreqs.html there is a script that checks versions:
Code:
cat > version-check.sh << "EOF" #!/bin/bash # Simple script to list version numbers of critical development tools  export LC_ALL=C bash --version | head -n1 | cut -d" " -f2-4 echo "/bin/sh -> `readlink -f /bin/sh`" echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3- bison --version | head -n1 if [ -e /usr/bin/yacc ];   then echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`";    else echo "yacc not found"; fi  bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6- echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 diff --version | head -n1 find --version | head -n1 gawk --version | head -n1 if [ -e /usr/bin/awk ];   then echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`";    else echo "awk not found"; fi  gcc --version | head -n1 ldd --version | head -n1 | cut -d" " -f2-  # glibc version grep --version | head -n1 gzip --version | head -n1 cat /proc/version m4 --version | head -n1 make --version | head -n1 patch --version | head -n1 echo Perl `perl -V:version` sed --version | head -n1 tar --version | head -n1 echo "Texinfo: `makeinfo --version | head -n1`" xz --version | head -n1  echo 'main(){}' > dummy.c && gcc -o dummy dummy.c if [ -x dummy ]    then echo "gcc compilation OK";   else echo "gcc compilation failed"; fi rm -f dummy.c dummy EOF  bash version-check.sh
When running that script I have the following returned:

Code:
bash, version 4.2.24(1)-release
/bin/sh -> /bin/dash
Binutils: (GNU Binutils) 2.22
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.13
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
(Ubuntu EGLIBC 2.15-0ubuntu10) 2.15
grep (GNU grep) 2.10
gzip 1.4
Linux version 3.2.0-29-generic (buildd@roseapple) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #46-Ubuntu SMP Fri Jul 27 17:04:05 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.0alpha
/tools/bin/ld: this linker was not configured to use sysroots
collect2: ld returned 1 exit status
gcc compilation failed
I have searched a lot trying to find any hits that would lead me toward an answer at why this is happening, but could anyone possibly guide me in a direction to identifying why it returns that the linker was not configured/collect2/gcc comp. failed?

Any help much appreciated, thank you!
 
Old 08-11-2012, 03:23 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by gibran View Post
Under the page http://www.linuxfromscratch.org/lfs/.../hostreqs.html there is a script that checks versions:

When running that script I have the following returned:

Code:
bash, version 4.2.24(1)-release
/bin/sh -> /bin/dash
Binutils: (GNU Binutils) 2.22
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.13
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
(Ubuntu EGLIBC 2.15-0ubuntu10) 2.15
grep (GNU grep) 2.10
gzip 1.4
Linux version 3.2.0-29-generic (buildd@roseapple) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #46-Ubuntu SMP Fri Jul 27 17:04:05 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.0alpha
/tools/bin/ld: this linker was not configured to use sysroots
collect2: ld returned 1 exit status
gcc compilation failed
I have searched a lot trying to find any hits that would lead me toward an answer at why this is happening, but could anyone possibly guide me in a direction to identifying why it returns that the linker was not configured/collect2/gcc comp. failed?
You need to fix the bold blue part. /bin/sh should point to /bin/bash and not bin/dash

The brown part looks very odd. You are checking your host and I see a directory that points to /tools/bin? How did that happen. /tools is part of LFS and not relevant at this point (and surely unwanted!).
 
1 members found this post helpful.
Old 08-11-2012, 05:03 PM   #3
gibran
Member
 
Registered: Jul 2005
Location: California
Posts: 36

Original Poster
Rep: Reputation: 15
Thumbs up

Quote:
Originally Posted by druuna View Post
You need to fix the bold blue part. /bin/sh should point to /bin/bash and not bin/dash

The brown part looks very odd. You are checking your host and I see a directory that points to /tools/bin? How did that happen. /tools is part of LFS and not relevant at this point (and surely unwanted!).
I went to far in the guide and had to backtrack to fix another error. At least thats what I believe made this happen...
At this point it would probably be easier to just start from the beginning. Obviously I strayed from the guide to get myself to this point so I will accept my defeat

Thank you for the quick reply
 
Old 08-12-2012, 03:07 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by gibran View Post
I went to far in the guide and had to backtrack to fix another error. At least thats what I believe made this happen...
At this point it would probably be easier to just start from the beginning. Obviously I strayed from the guide to get myself to this point so I will accept my defeat

Thank you for the quick reply
If these are leftovers from previous attempts then you should start from scratch again (and make sure all lfs related is removed).

Can you put up the [SOLVED] tag if this is resolved.
first post -> Thread Tools -> Mark this thread as solved
 
Old 09-25-2015, 07:34 PM   #5
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Rep: Reputation: Disabled
i m also having an error in this

this is the output of the bash version-check.sh

Code:
sarthak@sarthak:~$ bash version-check.sh
bash, version 4.3.11(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils) 2.25
bison (GNU Bison) 3.0.2
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.21
diff (GNU diffutils) 3.3
find (GNU findutils) 4.4.2
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
(Ubuntu EGLIBC 2.19-0ubuntu6.6) 2.19
grep (GNU grep) 2.16
gzip 1.6
Linux version 3.16.0-49-generic (buildd@lgw01-52) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #65~14.04.1-Ubuntu SMP Wed Sep 9 10:03:23 UTC 2015
m4 (GNU M4) 1.4.17
GNU Make 3.81
GNU patch 2.7.1
Perl version='5.18.2';
sed (GNU sed) 4.2.2
tar (GNU tar) 1.27.1
makeinfo (GNU texinfo) 5.2
xz (XZ Utils) 5.1.0alpha
/usr/local/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status
g++ compilation failed
please help.. thankyou
 
Old 09-25-2015, 09:05 PM   #6
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Install binutils.
 
Old 09-26-2015, 04:19 AM   #7
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Rep: Reputation: Disabled
Quote:
Install binutils.
what do you mean by this please explain as on my host system, binutils is installed and this is the command on 1.5.1 of the LFS 7.7.
thankyou
 
Old 09-26-2015, 04:31 AM   #8
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
Re #7.

? May be you didn't install a complete "binutils", but only the run time files ?

$ sudo apt-get install binutils-dev
 
Old 09-26-2015, 05:09 AM   #9
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Rep: Reputation: Disabled
after installing this there is no improvement
output remains the same
 
Old 09-26-2015, 05:42 AM   #10
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
Re #9.

Which output remains the same ?


Quote:
/usr/local/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status
g++ compilation failed
1) You are not supposed to have any "/usr/local/bin/ld". Please uninstall or hide away.
2) Install g++ : $ sudo apt-get install g++
.. And run ./version-check.sh
.. to check that things improved.

When everything is OK : Start from scratch with chapter 5.4, Binutils-2.25 - Pass 1


-

Last edited by knudfl; 09-26-2015 at 05:43 AM.
 
Old 09-26-2015, 06:31 AM   #11
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Rep: Reputation: Disabled
Quote:
1) You are not supposed to have any "/usr/local/bin/ld". Please uninstall or hide away.
can you please tell me how to hide it or uninstall it.

Quote:
2) Install g++ : $ sudo apt-get install g++
when i am doing this it is showing that g++ is already the newest version.

please help
 
Old 09-26-2015, 06:47 AM   #12
Sarthak
LQ Newbie
 
Registered: Sep 2015
Posts: 25

Rep: Reputation: Disabled
thanks for every help you all have given to me
i found my answer and corrected it. now building it from scratch
 
  


Reply



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
"CC version check failed" gcc 4.2.3 and gcc 4.1 barbuceanu Linux - Newbie 12 04-23-2008 06:24 PM
gcc version check failed - installing LAN/audio drivers piccolo solo Linux - Software 8 04-09-2006 05:53 PM
nvidia drivers, gcc-version-check failed Seiken Slackware 26 02-25-2005 09:50 PM
GCC version in kernel compilation Alpha_Beta Linux - Newbie 3 09-29-2003 11:39 PM
check glibc version used by gcc carboncopy Slackware 3 08-12-2003 05:24 AM

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

All times are GMT -5. The time now is 01:15 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