LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-25-2019, 01:42 PM   #16
davecan
Member
 
Registered: Nov 2019
Posts: 45

Original Poster
Rep: Reputation: Disabled

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
Makefile recipes:

Code:
  12423 .PHONY: configure-target-libgcc maybe-configure-target-libgcc
  12424 maybe-configure-target-libgcc:
  12425 maybe-configure-target-libgcc: configure-target-libgcc
  12426 configure-target-libgcc:
  12427         @r=`${PWD_COMMAND}`; export r; \
  12428         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  12429         echo "Checking multilib configuration for libgcc..."; \
  12430         $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc; \
  12431         $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null; \
  12432         if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \
  12433           if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \
  12434             rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \
  12435           else \
  12436             rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \
  12437             mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \
  12438           fi; \
  12439         else \
  12440           mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \
  12441         fi; \
  12442         test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \
  12443         $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc; \
  12444         $(NORMAL_TARGET_EXPORTS)  \
  12445         echo Configuring in $(TARGET_SUBDIR)/libgcc; \
  12446         cd "$(TARGET_SUBDIR)/libgcc" || exit 1; \
  12447         case $(srcdir) in \
  12448           /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
  12449           *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \
  12450                 sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
  12451         esac; \
  12452         module_srcdir=libgcc; \
  12453         rm -f no-such-file || : ; \
  12454         CONFIG_SITE=no-such-file $(SHELL) \
  12455           $$s/$$module_srcdir/configure \
  12456           --srcdir=$${topdir}/$$module_srcdir \
  12457           $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
  12458           --target=${target_alias}  \
  12459           || exit 1
Code:
    936 # The target built for a native non-bootstrap build.
    937 .PHONY: all
    938 all:
    939         @: $(MAKE); $(unstage)
    940         @r=`${PWD_COMMAND}`; export r; \
    941         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
    942           $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \
    943         && :

Last edited by davecan; 11-25-2019 at 01:44 PM.
 
Old 11-25-2019, 02:10 PM   #17
rsmereka
Member
 
Registered: Jul 2003
Location: Southwestern Ontario, Canada
Distribution: LFS, OpenBSD, UBPorts, MX
Posts: 69
Blog Entries: 3

Rep: Reputation: 16
The more I dig into this, the more I think it is some kind of interaction.

If your host is Ubuntu 18.04, your host must be 64 bit... correct?

Please confirm that you are building for 64 bit.

Please give me the host gcc version number (you can get with 'gcc -v)'.

Please run these lines:

echo 'int main(){}' >dummy.c
cc dummy.c

Do these lines complete normally?
 
Old 11-25-2019, 02:17 PM   #18
davecan
Member
 
Registered: Nov 2019
Posts: 45

Original Poster
Rep: Reputation: Disabled
Yes it is a 64 bit host. The physical box is a 2018 Mac Mini with i7 processor running MacOS 10.14.6.

Ubuntu of course will only see what the VirtualBox VM gives it. I'll research to see whether VirtualBox is presenting as 32 bit to the Ubuntu OS.

gcc -v:

Code:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
Yes the "cc dummy.c" command appears to compile, no output is returned to the console.

I added the verbose switch resulting in:

Code:
lfs@lfs-host:/mnt/lfs/sources/gcc-9.2.0/build$ cc -v dummy.c
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.4.0-1ubuntu1~18.04.1' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/7/cc1 -quiet -v -imultiarch x86_64-linux-gnu dummy.c -quiet -dumpbase dummy.c -mtune=generic -march=x86-64 -auxbase dummy -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccgmAytU.s
GNU C11 (Ubuntu 7.4.0-1ubuntu1~18.04.1) version 7.4.0 (x86_64-linux-gnu)
	compiled by GNU C version 7.4.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/7/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C11 (Ubuntu 7.4.0-1ubuntu1~18.04.1) version 7.4.0 (x86_64-linux-gnu)
	compiled by GNU C version 7.4.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: fa57db1fe2d756b22d454aa8428fd3bd
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 as -v --64 -o /tmp/ccaA8nzi.o /tmp/ccgmAytU.s
GNU assembler version 2.32 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.32
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/cc9sJKFG.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. /tmp/ccaA8nzi.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 
Old 11-25-2019, 02:23 PM   #19
davecan
Member
 
Registered: Nov 2019
Posts: 45

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-25-2019, 02:24 PM   #20
davecan
Member
 
Registered: Nov 2019
Posts: 45

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-25-2019, 02:43 PM   #21
rsmereka
Member
 
Registered: Jul 2003
Location: Southwestern Ontario, Canada
Distribution: LFS, OpenBSD, UBPorts, MX
Posts: 69
Blog Entries: 3

Rep: Reputation: 16
Let's talk about your build environment,

You have an iMac mini running Mojave and a VM running Ubuntu 18.04 x64. Where is the lfs output drive?
 
Old 11-25-2019, 02:48 PM   #22
davecan
Member
 
Registered: Nov 2019
Posts: 45

Original Poster
Rep: Reputation: Disabled
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.

Last edited by davecan; 11-25-2019 at 03:10 PM.
 
Old 11-25-2019, 04:22 PM   #23
rsmereka
Member
 
Registered: Jul 2003
Location: Southwestern Ontario, Canada
Distribution: LFS, OpenBSD, UBPorts, MX
Posts: 69
Blog Entries: 3

Rep: Reputation: 16
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.
 
Old 11-26-2019, 12:54 AM   #24
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
Login as the lfs user and then do this:

Code:
printenv

Last edited by Luridis; 11-26-2019 at 01:15 AM.
 
Old 11-26-2019, 07:03 AM   #25
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware, OpenBSD
Posts: 4,039
Blog Entries: 11

Rep: Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233
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.

Last edited by hazel; 11-26-2019 at 07:05 AM.
 
Old 11-26-2019, 04:32 PM   #26
davecan
Member
 
Registered: Nov 2019
Posts: 45

Original Poster
Rep: Reputation: Disabled
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.
 
Old 02-14-2020, 02:47 AM   #27
ghvbn
LQ Newbie
 
Registered: Feb 2020
Posts: 1

Rep: Reputation: Disabled
I meet an extremely similar problem with yours. I wonder if you have solved this problem.
 
Old 02-14-2020, 07:19 AM   #28
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware, OpenBSD
Posts: 4,039
Blog Entries: 11

Rep: Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233
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.
 
Old 02-16-2020, 10:34 AM   #29
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 2,762

Rep: Reputation: 684Reputation: 684Reputation: 684Reputation: 684Reputation: 684Reputation: 684
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.
 
  


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
[SOLVED] LFS 6.7 : $LFS/sources and $LFS/tools folders missing prakashsince92 Linux From Scratch 5 12-09-2010 03:26 PM
LFS 6.3 .... 6.12.1. Installation of GCC make errors Axo Linux From Scratch 4 03-29-2008 03:18 AM
Errors, Errors, and more Errors (KDE 3.4.x GUI Errors) Dralnu Linux - Software 2 05-13-2006 09:30 AM
Multiple errors in config.log after ./configure for GLIB 2.4.4 eckerww Linux - Software 0 07-22-2004 11:55 PM
LFS Chap 5 - gcc first make command errors antken Linux From Scratch 3 03-17-2003 11:38 PM

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

All times are GMT -5. The time now is 02:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration