LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-28-2016, 06:17 AM   #1
danjlinuxq
LQ Newbie
 
Registered: Sep 2016
Posts: 3

Rep: Reputation: Disabled
Problem compiling binutils-2.27


Hi all,
So I am gong through linux from scratch and have hit this problem compiling binutils-2.27.

I was advised that the problem will be found around the line containing 'checking for C compiler...' in the created config.log file. Here are the relevant excerpts:

The 'checking for compiler...' line occurs twice in my config.log. First time I assume is fine:

Quote:
configure:4377: checking for C compiler version
configure:4386: gcc --version >&5
gcc (Debian 5.3.1-13) 5.3.1 20160323
Second time the 'checking for compiler...' occurs is where I guess the problem is:

Quote:
configure:4417: checking for C compiler default output file name
configure:4439: gcc conftest.c >&5
gcc: error trying to exec 'cc1': execvp: No such file or directory
configure:4443: $? = 1
configure:4480: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
I believe this test might help clarify the situation:

Quote:
$ cat > test.c << "EOF"
int
main ()
{

;
return 0;
}
EOF

$ gcc test.c
I was told I should have an a.out executable.

Quote:
$ ./a.out

$ echo $?
which should output 0 "

Here is what happened at this point:

Quote:
lfs@kali:/mnt/lfs/sources/binutils-2.27/build$ cat > test.c << "EOF" > int > main () > { > > ; > return 0; > } > EOF lfs@kali:/mnt/lfs/sources/binutils-2.27/build$ gcc test.c gcc: error trying to exec 'cc1': execvp: No such file or directory lfs@kali:/mnt/lfs/sources/binutils-2.27/build$ ./a.out bash: ./a.out: No such file or directory lfs@kali:/mnt/lfs/sources/binutils-2.27/build$ echo $? 127
Thanks again!
 
Old 09-28-2016, 11:11 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,289

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Code:
gcc: error trying to exec 'cc1': execvp: No such file or directory
That's the problem.

It's a generic symlink to the compiler. On my box (gcc-4.x), cc is a symlink to gcc in /usr/bin. I have cc1 in /usr/libexec/x86_64-slackware-linux/4.8.3/cc1, and it's an executable.

Binutils is your first compile, so I presume you're on chapter 5. Is that correct? It's trying to use the tools on your original install at this stage, and is not finding cc1 on the base system. Your setup is probably wrong. Go figure. That's the fun (& LEARNING CURVE) of LFS

Last edited by business_kid; 09-28-2016 at 11:29 AM.
 
1 members found this post helpful.
Old 09-28-2016, 03:56 PM   #3
danjlinuxq
LQ Newbie
 
Registered: Sep 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi, thanks for the reply - yes I'm on chapter 5. I thought I had followed the instructions to the letter but perhaps not.

When I search for cc1 find returns just this:

/usr/lib/gcc/i686-linux-gnu/6/cc1

I check the $PATH variable using this command:

su - 'user' -c env | grep PATH

and /usr/lib/... isn't in any $PATH.


Here is the output of versioncheck.sh. I was sure that I had everything lined up with regard to this:

bash, version 4.4.0(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils) 2.26.20160125
bison (GNU Bison) 3.0.4
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.25
diff (GNU diffutils) 3.5
find (GNU findutils) 4.7.0-git
GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4-p2, GNU MP 6.1.1)
/usr/bin/awk -> /usr/bin/gawk
gcc (Debian 6.1.1-11) 6.1.1 20160802
g++ (Debian 6.1.1-11) 6.1.1 20160802
(Debian GLIBC 2.23-5) 2.23
grep (GNU grep) 2.5.1
gzip 1.6
Linux version 4.6.0-kali1-686-pae (devel@kali.org) (gcc version 5.4.0 20160609 (Debian 5.4.0-6) ) #1 SMP Debian 4.6.4-1kali1 (2016-07-21)
m4 (GNU M4) 1.4.17
GNU Make 4.1
GNU patch 2.7.5
Perl version='5.22.2';
sed (GNU sed) 4.2.2
tar (GNU tar) 1.29
texi2any (GNU texinfo) 6.3
xz (XZ Utils) 5.1.0alpha
g++ compilation OK

I am guessing I need to make a symlink in somewhere like /usr/bin to link to here: /usr/lib/gcc/i686-linux-gnu/6/cc1

Does that sound reasonable?

Cheers
 
Old 09-29-2016, 01:34 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,289

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
yes, the symlink is the way to go and /usr/bin is the place to put it.
 
Old 09-29-2016, 09:06 AM   #5
danjlinuxq
LQ Newbie
 
Registered: Sep 2016
Posts: 3

Original Poster
Rep: Reputation: Disabled
Very sorry please ignore this post.

Immediately after posting something else occurred to me and it is better that I follow that idea through before posting again, and I don't see a delete post option... Thanks

Last edited by danjlinuxq; 09-29-2016 at 09:17 AM.
 
Old 09-30-2016, 01:39 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,289

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Just remember that it's not unknown for a mistake to slip into the LFS book, especially development books.
 
  


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
Problem compiling binutils m4mach Linux From Scratch 9 11-13-2013 05:20 PM
Problem in compiling Binutils-2.20.1-Pass 1 rkmv Linux From Scratch 4 02-05-2012 03:02 AM
Compiling Binutils 2.20.1 lfs_mm Linux From Scratch 19 11-09-2011 07:08 AM
error compiling binutils R03L Linux From Scratch 3 12-18-2008 03:10 PM
problem with compiling the binutils MabFan Linux From Scratch 0 07-31-2007 11:28 AM

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

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