Problem in LFS chapter 5.4. Binutils-2.31.1 - Pass 1
Linux - NewbieThis 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
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.
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?
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
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?
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.