LFS 9.0: Cannot make gcc, multiple errors in config.log
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.
I'm not familiar with Makefiles other than conceptually that they run tasks called "recipes" (I've lightly used other build systems before so I understand the principle) but since the compilation errors reference two lines in the Makefile I jumped to those in less and extracted what I believe to be the recipes (since there are blank lines before and after these excerpts):
Compile errors again:
Code:
checking for suffix of object files... configure: error: in `/mnt/lfs/sources/gcc-9.2.0/build/x86_64-lfs-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
Makefile:12427: recipe for target 'configure-target-libgcc' failed
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory '/mnt/lfs/sources/gcc-9.2.0/build'
Makefile:939: recipe for target 'all' failed
make: *** [all] Error 2
From what I can see in VirtualBox it reports the OS is running 64 bit and there is nothing I can see stating that VirtualBox is emulating a 32 bit architecture, so it appears to be fully 64 bit.
To be thorough, here's the Vagrantfile used to manage the VM. It's just the default tweaked to specify the Ubuntu box to use and configure its disk space / update apt / inject a single environment variable.
The Vagrantfile is only relevant during the box build, once it is built it is a VM indistinguishable from one manually built via VirtualBox.
Code:
# encoding: utf-8
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Box / OS
VAGRANT_BOX = 'ubuntu/bionic64'
# Memorable name for your
VM_NAME = 'lfs-host'
# VM User — 'vagrant' by default
# VM_USER = 'vagrant'
# Username on your Mac
MAC_USER = 'dave'
# Host folder to sync
HOST_PATH = '/Users/' + MAC_USER + '/' + VM_NAME
# Where to sync to on Guest — 'vagrant' is the default user name
#GUEST_PATH = '/home/' + VM_USER + '/' + VM_NAME
# # VM Port — uncomment this to use NAT instead of DHCP
# VM_PORT = 8080
Vagrant.configure(2) do |config|
# Vagrant box from Hashicorp
config.vm.box = VAGRANT_BOX
config.disksize.size = '30GB'
# Actual machine name
config.vm.hostname = VM_NAME
# Set VM name in Virtualbox
config.vm.provider "virtualbox" do |v|
v.name = VM_NAME
v.memory = 8192
end
# Install tools
config.vm.provision "shell", inline: <<-SHELL
apt-get update # update list of available packages
apt-get upgrade -y # install newer versions of existing packages
apt-get install -y git
apt-get autoremove -y
# set LFS env var, per chapter 2.6
echo "export LFS='/mnt/lfs'" >> /etc/profile.d/lfs.sh
SHELL
end
It certainly is (or at least was) possible to use Ubuntu in Vagrant, here's a git repo showing a largely automated build for LFS 7 using Ubuntu 16.04 through Vagrant: https://github.com/Yibo-Li/linuxfromscratch
Not sure what you mean by lfs output drive..? All LFS work is performed within the Ubuntu VM. I created the Ubuntu VM specifically for this LFS project, spun it up, logged into it, and have performed all of the LFS tasks within the Ubuntu VM. There is a /mnt/lfs directory within the Ubuntu VM (where all of the work has taken place) and an lfs user within the Ubuntu VM which I use for all of the LFS prep and build work.
In LFS terms the Ubuntu VM is the host, not the Mac. So there should be nothing about the Mac itself that is polluting the build environment, since the build environment is 100% encapsulated within the VM running Ubuntu 18.04 x64. I'm just reporting it to give an accurate view of my full stack: Mac running Ubuntu VM which in turn is the build host for LFS.
I mean I could be wrong, if so please let me know.
Edit: The Ubuntu VM's disk is a single 30GB VMDK file, in two partitions as per the LFS instructions.
I was checking to make sure you are writing to the LFS partition, not the Ubuntu drive.
Honestly, I am stumped. If this was my LFS, I would start again from the beginning. I already have to do this with an x64 build where Perl started going wonky.
You can always ignore conftest failures. They are just exploratory tests; they're meant to fail. But I must admit, I don't see what is going wrong here. We are talking about first pass gcc, aren't we? Chapter 5.5? There's not much that can go wrong at such an early stage of the LFS build unless you have done Chapter 4 wrong.
I think you should delete your $LFS/tools directory (there's nothing in it right now except binutils) and recreate it empty. Then go back to the beginning of Chapter 4. Go through the initial steps carefully; it's easy to leave something out. Check that variables like $LFS, $LFS_TGT and $PATH have the required values. Look at the .bashrc and .bash_profile files for the lfs user and make sure they are as they should be and that you are actually logged on as lfs and not as yourself.
Then start Chapter 5 again. It's better than going round and round in circles and getting frustrated.
Thanks all. It seems obvious there is something very wrong so I'm starting over with a completely fresh VM install of Ubuntu and going from there. I ran into another issue of interest but I'll raise it in a separate thread.
The first LFS build often fails, and the cause is usually a failure to do everything exactly as the book says, especially at the preparation stage (chapter 4). When you're at this stage, you're raring to go and actually start building your new system so it's easy to be careless. It's usually impossible to find out retrospectively what precisely went wrong, let alone correct it. Better to cut your losses while you have only one or two built tools and not a lot of work invested.
I advise against trying to type the instructions. It's too easy to mistype. Use copy-and-paste instead.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154
Rep:
As an aside, if you need to use 'sudo' whilst building the tool chain, you HAVE done something wrong, you should ONLY run commands as root when the book tells you to.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.