LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS 8.3 Chpt. 5.2 toolchain issue (https://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-8-3-chpt-5-2-toolchain-issue-4175643814/)

mag911 12-07-2018 03:47 AM

LFS 8.3 Chpt. 5.2 toolchain issue
 
This is at least my third go at compiling the binaries using 8.3 instructions, but I'm having an issue with the toolchain.

My first ever go at compiling with LFS 8.3 and Ubuntu 18.10 (server ISO, Live CD) on a VM ran into problems at "6.7.1. Installation of Linux API Headers" make mrproper. I got an error message stating - "arch/x86/Makefile:184: *** Compiler lacks asm-goto support.. Stop.". I assumed it was because the VM crashed during compilation and it didn't like my restart of the process.

Back to the start, delete everything, and yet the same issue occured. :(

On my third go, I ditched Ubuntu 18.10 and went for 18.04.1 LTS. I've also scripted all the commands as presented in the LFS 8.3 book, so that everything is recorded and issued the same every time. To my frustration, I find the following:

In the tools folder, during glibc (Chpt. 5.7), I get 'x86_64-pc-linux-gnu' being created.
Additionally, if I check the dynamic linker information in those binaries, I get /lib64/.. rather than /tools/lib64.

Below are all the files that carry this error:

/mnt/lfs/tools/bin/addr2line has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/ar has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/as has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/c++ has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/c++filt has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/cc has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/cpp has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/elfedit has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/g++ has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/gcc has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/gcc-ar has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/gcc-nm has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/gcc-ranlib has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/gcov has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/gcov-dump has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/gcov-tool has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/gprof has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/ld has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/ld-new has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/ld.bfd has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/nm has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/objcopy has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/objdump has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/ranlib has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/readelf has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/size has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/strings has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
/mnt/lfs/tools/bin/strip has - [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]

What am I doing wrong, because I can't spot the obvious error?

As I say, my first few go were issuing the commands by hand with Ubuntu 18.10, and now I'm running a script with Ubuntu 18.04 with commands straight out of the LFS 8.3 pages.

Cheers for any useful insight you could share with me.

Keith Hedger 12-07-2018 08:42 AM

To start can you please post the output of the version-check.sh script here:
http://www.linuxfromscratch.org/lfs/.../hostreqs.html

Ubuntu is not LFS compliant out of the box and needs some tweaks.

mag911 12-07-2018 05:35 PM

My mistake, should've done that in the first post.

VirtualBox:~$ ./version-check.sh

bash, version 4.4.19(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.30
bison (GNU Bison) 3.0.4
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.28
diff (GNU diffutils) 3.6
find (GNU findutils) 4.7.0-git
GNU Awk 4.1.4, API: 1.1 (GNU MPFR 4.0.1, GNU MP 6.1.2)
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
(Ubuntu GLIBC 2.27-3ubuntu1) 2.27
grep (GNU grep) 3.1
gzip 1.6
Linux version 4.15.0-42-generic (buildd@lgw01-amd64-023) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #45-Ubuntu SMP Thu Nov 15 19:32:57 UTC 2018
m4 (GNU M4) 1.4.18
GNU Make 4.1
GNU patch 2.7.6
Perl version='5.26.1';
sed (GNU sed) 4.4
tar (GNU tar) 1.29
texi2any (GNU texinfo) 6.5
xz (XZ Utils) 5.2.2
g++ compilation OK

mag911 12-07-2018 06:42 PM

Well I got to the same place ("6.7.1. Installation of Linux API Headers" make mrproper) and got the same error message. arch/x86/Makefile:184: *** Compiler lacks asm-goto support.. Stop.

Time to delete it all again and try Debian 9 ..

mag911 12-08-2018 03:55 AM

I dunno. Is everyone else getting thru LFS8.3 ok??

I had to resort to the following, after trying my fourth attempt under Debian and still failing ...

At the end of Chapter 6.6, before starting work on Linux-4.18.5 API Headers :

ln -sv /tools/lib64/ld-linux-x86-64.so.2 /lib64

Seriously, I think the book is missing something.

spiky0011 12-08-2018 06:51 AM

No it dose build by the book I have not had a problem. Is everything mounted correctly in ch 6.2?
is LFS ste for root?

mag911 12-08-2018 07:40 AM

Maybe it's just me, but I found some more dramas.

In 6.9.1. Installation of Glibc, in theory you'd be in the following directory when issuing the commands:

[/mnt/lfs]/sources/glibc-2.28, or as the chroot environment sees it, /sources/glibc-2.28/

This block of code doesn't work right for me, as the ln statements don't refer to the right directory .....

case $(uname -m) in
i?86) GCC_INCDIR=/usr/lib/gcc/$(uname -m)-pc-linux-gnu/8.2.0/include
ln -sfv ld-linux.so.2 /lib/ld-lsb.so.3
;;
x86_64) GCC_INCDIR=/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/include
ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64
ln -sfv ../lib/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3
;;
esac

To get 6.9.1 working, I did a find for the "real" ld-linux-x86-64.so.2 and then symlinked those into lib64 and everything worked.

mag911 12-08-2018 07:42 AM

Sorry for the out of sequence reply spiky0011, and yep, everything mounted and as it should be.
$LFS set for root yes.

mag911 12-08-2018 05:18 PM

I must be on the right track despite some hiccups, as glibc compiled with only two of the expected fails.

misc/tst-ttyname is known to fail in the LFS chroot environment.
inet/tst-idna_name_classify is known to fail in the LFS chroot environment.


All times are GMT -5. The time now is 02:11 AM.