[SOLVED] gcc compilation failed in version-check.sh script
Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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!).
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
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
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.