LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-18-2019, 04:08 PM   #1
EphraimB
LQ Newbie
 
Registered: Feb 2019
Posts: 5

Rep: Reputation: Disabled
Problem in LFS chapter 5.4. Binutils-2.31.1 - Pass 1


After I type in the terminal
Code:
lfs@ephraimb-STK2M364CC:/mnt/lfs/sources/binutils-2.31.1/build$ ../configure --prefix=/tools \
--with-sysroot=$LFS \
--with-lib-path=/tools/lib \
--target=$LFS_TGT \
--disable-nls \
--disable-werror
I get the following error:
Code:
lfs@ephraimb-STK2M364CC:/mnt/lfs/sources/binutils-2.31.1/build$ ../configure --prefix=/tools            \
> --with-sysroot=$LFS        \
> --with-lib-path=/tools/lib \
> --target=$LFS_TGT          \
> --disable-nls              \
> --disable-werror
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-lfs-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... no
checking for mawk... mawk
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/mnt/lfs/sources/binutils-2.31.1/build':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
The Linux from Scratch book says to install Binutils before GCC. Am I doing anything wrong?

Last edited by EphraimB; 02-18-2019 at 04:16 PM.
 
Old 02-18-2019, 04:16 PM   #2
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 2,723
Blog Entries: 6

Rep: Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386
Since gcc was not found on your command path, the first thing you need to check is the value of $PATH. Remember that this environmental variable is set when you log in as the lfs user.

What is the output of "echo $PATH"? It should show /tools/bin at the beginning followed by /bin and /usr/bin. /usr/bin is where your current gcc should be. You did install the build-essential package before you started, didn't you?

By the way, I see that you don't have gawk; you have mawk instead. This is usual on Debian derivatives like Ubuntu, but you can't build LFS with that setup. You need to install gawk as well as build-essential, and to make sure that the /bin/sh symbolic link points to /bin/bash and not /bin/dash. Have you run the requirements script to check on all that stuff?

Last edited by hazel; 02-18-2019 at 04:20 PM. Reason: Added paragraph
 
Old 02-18-2019, 04:19 PM   #3
EphraimB
LQ Newbie
 
Registered: Feb 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
Since gcc was not found on your command path, the first thing you need to check is the value of $PATH. Remember that this environmental variable is set when you log in as the lfs user.

What is the output of "echo $PATH"? It should show /tools/bin at the beginning followed by /bin and /usr/bin. /usr/bin is where your current gcc should be. You did install the build-essential package before you started, didn't you?
Code:
lfs@ephraimb-STK2M364CC:/mnt/lfs/sources/binutils-2.31.1/build$ echo $PATH
/tools/bin:/bin:/usr/bin
 
Old 02-18-2019, 04:25 PM   #4
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 2,723
Blog Entries: 6

Rep: Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386
So is gcc present in /usr/bin?
 
Old 02-18-2019, 04:27 PM   #5
EphraimB
LQ Newbie
 
Registered: Feb 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
So is gcc present in /usr/bin?
I'm doing Linux From Scratch where i'm supposed to manually download and install each package. The book is telling me to install Binutils BEFORE GCC.
 
Old 02-18-2019, 06:22 PM   #6
Mike_Walsh
Member
 
Registered: Jul 2017
Location: King's Lynn, UK
Distribution: Puppy Linux, AntiX
Posts: 295

Rep: Reputation: 132Reputation: 132
@ EphraimB:-

Quote:
I'm doing Linux From Scratch where i'm supposed to manually download and install each package. The book is telling me to install Binutils BEFORE GCC.
You're a braver man than me. I've used Linux for several years, and become quite competent at scripting, package building, etc.....and I still wouldn't even contemplate attempting what you're doing !

I just wanted to say that a few years ago, one of our members on the Puppy Linux Forums built an upgrade package to 'upgrade' the glibc on an elderly, but popular 'Puppy' where members wanted to run the then current Chrome browser. This 'package' consisted of 6 or 7 small 'pets' (as we call them).....and his instructions were also to install binutils BEFORE gcc.

I believe this is because the tools in the binutils package are required for building the 'C' compiler itself. I could also be completely wrong, of course..!

Just a wee anecdote.


Mike.

Last edited by Mike_Walsh; 02-18-2019 at 06:23 PM.
 
Old 02-18-2019, 06:26 PM   #7
EphraimB
LQ Newbie
 
Registered: Feb 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Mike_Walsh View Post
@ EphraimB:-



You're a braver man than me. I've used Linux for several years, and become quite competent at scripting, package building, etc.....and I still wouldn't even contemplate attempting what you're doing !

I just wanted to say that a few years ago, one of our members on the Puppy Linux Forums built an upgrade package to 'upgrade' the glibc on an elderly, but popular 'Puppy' where members wanted to run the then current Chrome browser. This 'package' consisted of 6 or 7 small 'pets' (as we call them).....and his instructions were also to install binutils BEFORE gcc.

I believe this is because the tools in the binutils package are required for building the 'C' compiler itself. I could also be completely wrong, of course..!

Just a wee anecdote.


Mike.
But it's saying that Binutils needs gawk, gcc, cc, and cl.exe to configure the Binutils package.
 
Old 02-18-2019, 07:23 PM   #8
EphraimB
LQ Newbie
 
Registered: Feb 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
By the way, I see that you don't have gawk; you have mawk instead. This is usual on Debian derivatives like Ubuntu, but you can't build LFS with that setup. You need to install gawk as well as build-essential, and to make sure that the /bin/sh symbolic link points to /bin/bash and not /bin/dash. Have you run the requirements script to check on all that stuff?
I thought Ubuntu comes with gcc, gawk,and the other missing packages. I think I finally figured out the answer.
 
Old 02-19-2019, 12:43 AM   #9
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 2,723
Blog Entries: 6

Rep: Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386
Quote:
Originally Posted by EphraimB View Post
I'm doing Linux From Scratch where i'm supposed to manually download and install each package. The book is telling me to install Binutils BEFORE GCC.
Well, as The Book says: "You need a compiler to compile a compiler."

But I think you are misunderstanding something on a basic level. When you start out building LFS, you have to use the build tools on your host system (in your case Ubuntu), because that's all you have to work with. So you need to have both gcc and binutils installed on the host, along with a number of other build tools such as make. All Debian derivatives have a package called build-essential which contains those tools. In chapter 5, you use these host tools to build a set of duplicate tools independent of the host. Then, in chapter 6, you use the toolkit that you have built to build your new system.

So it is the host's gcc and binutils that are used to build binutils for the /tools directory. Then the host's gcc and the new binutils are used to build a new gcc.

A complicating factor is that most distros do not include build tools in their default install, so you have to install them separately before you embark on LFS. Also Debian derivatives use mauk and dash where the LFS build requires gawk and bash, so that has to be corrected.

Early in the book, there is a list of the packages you need to have on your host system and how to test that you have them. You evidently did not go through this section and that is why you are having problems now.
 
1 members found this post helpful.
  


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
Clarification request on the instructions for chapter 5.9 binutils pass 2 engineer Linux From Scratch 2 12-17-2012 09:17 PM
[SOLVED] LFS: Error during Binutils-2.22 - Pass 1 (Section 5.4, LFS 7.2) erkant Linux From Scratch 4 11-26-2012 01:26 PM
[SOLVED] Chapter 5.9 Binutils Pass 2 - make install step failure daveLin Linux From Scratch 2 08-25-2012 02:19 PM
LFS 6.4 Chapter 5.4. Binutils-2.18 - Pass 1 gazza1z Linux From Scratch 2 01-23-2009 11:16 AM
binutils chapter 5 pass 2 qod Linux From Scratch 3 11-03-2003 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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