xiao Wu
xiao Wu

Reputation: 1

lfs gcc cannot compile

I am trying to make the gcc according Linux From Scratch. But I meet an error.
error screen capture

Additonal information that might be of use:
0. lfs manual version 7.7-systemd
1. I am running ubuntu linux uname -r : 4.4.0-142-generic 2. I have checked the version and library

 bash, version 4.3.11(1)-release
 /bin/sh -> /bin/dash
 Binutils: (GNU Binutils for Ubuntu) 2.24
 bison (GNU Bison) 3.0.2
 /usr/bin/yacc -> /usr/bin/bison.yacc
 bzip2,  Version 1.0.6, 6-Sept-2010.
 Coreutils:  8.21
 diff (GNU diffutils) 3.3
 find (GNU findutils) 4.4.2
 GNU Awk 4.0.1
 /usr/bin/awk -> /usr/bin/gawk
 gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4
 g++ (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4
 (Ubuntu EGLIBC 2.19-0ubuntu6.14) 2.19
 grep (GNU grep) 2.16
 gzip 1.6
 Linux version 4.4.0-142-generic (buildd@lcy01-amd64-006) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4) ) #168~14.04.1-Ubuntu SMP Sat Jan 19 11:26:28 UTC 2019
 m4 (GNU M4) 1.4.17
 GNU Make 3.81
 GNU patch 2.7.1
 Perl version='5.18.2';
 sed (GNU sed) 4.2.2
 tar (GNU tar) 1.27.1
 makeinfo (GNU texinfo) 5.2
 xz (XZ Utils) 5.1.0alpha
 g++ compilation OK
 ibgmp.la: not found
 libmpfr.la: not found
 libmpc.la: not found

This is the code I am running

../gcc-4.9.2/configure                             \
    --target=$LFS_TGT                              \
    --prefix=/tools                                \
    --with-sysroot=$LFS                            \
    --with-newlib                                  \
    --without-headers                              \
    --with-local-prefix=/tools                     \
    --with-native-system-header-dir=/tools/include \
    --disable-nls                                  \
    --disable-shared                               \
    --disable-multilib                             \
    --disable-decimal-float                        \
    --disable-threads                              \
    --disable-libatomic                            \
    --disable-libgomp                              \
    --disable-libitm                               \
    --disable-libquadmath                          \
    --disable-libsanitizer                         \
    --disable-libssp                               \
    --disable-libvtv                               \
    --disable-libcilkrts                           \
    --disable-libstdc++-v3                         \
    --enable-languages=c,c++

UPDATE
It is first toolchain build in chapter 5, and i unpacked the gcc sources and working this fresh ones.

Upvotes: 0

Views: 1119

Answers (1)

rsm
rsm

Reputation: 2560

First, I strongly advise to use current version of LFS Book (9.0 as of time of writing). Version 7.7 you use is almost 5 years old now.

Second, your host system (Ubuntu) does not meet LFS requirements:

  1. /bin/sh should be a link to /bin/bash. In your case, it's linked to /bin/dash. Simple fix would be to manually change it. As root:
rm /bin/sh
ln -sv /bin/bash /bin/sh
  1. Your host system uses EGLIBC instead of GLIBC. EGLIBC was designed for embedded devices, attempting to be compatible with standard glibc, and it's discontinued since beginning of 2014 https://en.wikipedia.org/wiki/Embedded_GLIBC. Unfortunatelly I have no idea if it's possible to change EGLIBC to GLIBC on Ubuntu (installing glibc and then removing eglibc could work).

Upvotes: 0

Related Questions