LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   error after tools check glibc chapter 5.7 (http://www.linuxquestions.org/questions/linux-from-scratch-13/error-after-tools-check-glibc-chapter-5-7-a-4175440928/)

Lancelot1 12-11-2012 03:45 AM

error after tools check glibc chapter 5.7
 
Ok I have been toying around with LFS now for some time and seem to keep getting stuck at the same point with the tools check on 5.7

bash, version 4.2.37(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.22.90.20120924
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.13
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
(Ubuntu EGLIBC 2.15-0ubuntu20) 2.15
grep (GNU grep) 2.12
gzip 1.5
Linux version 3.5.0-19-generic (buildd@aatxe) (gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) ) #30-Ubuntu SMP Tue Nov 13 17:49:53 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.0alpha
gcc compilation OK

The error I get is that some of the files are not found while they are there in the Tools directory

the errors are:

lfs@kubuntu-P8610:~$ echo 'main(){}' > dummy.c
lfs@kubuntu-P8610:~$ $LFS_TGT-gcc dummy.c
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find /LFS/tools/lib/libc.so.6 inside /LFS
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find /LFS/tools/lib/libc_nonshared.a inside /LFS
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find /LFS/tools/lib/ld-linux.so.2 inside /LFS
collect2: error: ld returned 1 exit status

Any help would be great

tx

PS is gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 > 4.7.1 a very big issue?

druuna 12-11-2012 04:23 AM

Quote:

Originally Posted by Lancelot1 (Post 4846780)
Ok I have been toying around with LFS now for some time and seem to keep getting stuck at the same point with the tools check on 5.7

Which LFS version are you trying to build?

Quote:

bash, version 4.2.37(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.22.90.20120924
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.13
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
(Ubuntu EGLIBC 2.15-0ubuntu20) 2.15
grep (GNU grep) 2.12
gzip 1.5
Linux version 3.5.0-19-generic (buildd@aatxe) (gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) ) #30-Ubuntu SMP Tue Nov 13 17:49:53 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.0alpha
gcc compilation OK
That looks OK, although some version are higher then mentioned.

Quote:

The error I get is that some of the files are not found while they are there in the Tools directory

the errors are:

lfs@kubuntu-P8610:~$ echo 'main(){}' > dummy.c
lfs@kubuntu-P8610:~$ $LFS_TGT-gcc dummy.c
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find /LFS/tools/lib/libc.so.6 inside /LFS
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find /LFS/tools/lib/libc_nonshared.a inside /LFS
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find /LFS/tools/lib/ld-linux.so.2 inside /LFS
collect2: error: ld returned 1 exit status
The bold parts don't look correct. I do believe it should reflect the content of the LFS variable ($LFS), which holds /mnt/lfs in most cases.

I don't have any idea where this might have gone wrong.

Quote:

PS is gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 > 4.7.1 a very big issue?
I don't think it is.

Lancelot1 12-11-2012 04:31 AM

Quote:

Originally Posted by druuna (Post 4846790)
Which LFS version are you trying to build?

The version is 7.2

That looks OK, although some version are higher then mentioned.

Quote:

Originally Posted by druuna (Post 4846790)
The bold parts don't look correct. I do believe it should reflect the content of the LFS variable ($LFS), which holds /mnt/lfs in most cases.

This is ok, I have made export LFS=/LFS

Quote:

Originally Posted by druuna (Post 4846790)
I don't have any idea where this might have gone wrong.

I don't think it is.


druuna 12-11-2012 04:55 AM

Can you post the ouput of the following (log in as user lfs):
Code:

$ cat ~/.bash_profile
$ cat ~/.bashrc
$ uname -m
$ echo $PATH


Lancelot1 12-11-2012 05:02 AM

Quote:

Originally Posted by druuna (Post 4846803)
Can you post the ouput of the following (log in as user lfs):
Code:

$ cat ~/.bash_profile
$ cat ~/.bashrc
$ uname -m
$ echo $PATH


lfs@kubuntu-P8610:~$ $ cat ~/.bash_profile
$: command not found
lfs@kubuntu-P8610:~$ $ cat ~/.bashrc
$: command not found
lfs@kubuntu-P8610:~$ $ uname -m
$: command not found
lfs@kubuntu-P8610:~$ $ echo $PATH
$: command not found

Now I know that I did ch4.4 yesterday when I came upon the issue, and I did it again today so I don't know why I get this outcome

Lancelot1 12-11-2012 05:05 AM

oh yeah I do correct the scripts when they have LFS=/mnt/lfs to LFS=/LFS

druuna 12-11-2012 05:12 AM

Quote:

Originally Posted by Lancelot1 (Post 4846806)
lfs@kubuntu-P8610:~$ $ cat ~/.bash_profile
$: command not found
lfs@kubuntu-P8610:~$ $ cat ~/.bashrc
$: command not found
lfs@kubuntu-P8610:~$ $ uname -m
$: command not found
lfs@kubuntu-P8610:~$ $ echo $PATH
$: command not found

Now I know that I did ch4.4 yesterday when I came upon the issue, and I did it again today so I don't know why I get this outcome

The $ in my request signifies the prompt, don't type it......

druuna 12-11-2012 05:13 AM

Quote:

Originally Posted by Lancelot1 (Post 4846808)
oh yeah I do correct the scripts when they have LFS=/mnt/lfs to LFS=/LFS

It is your choice to use /LFS instead of /mnt/lfs, but why deviate from the book? It also makes toruble-shooting more problematic (for those that want to help that is)

Lancelot1 12-11-2012 05:16 AM

ok lol its early here:

lfs@kubuntu-P8610:~$ cat ~/.bash_profile
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash

lfs@kubuntu-P8610:~$ cat ~/.bash_profile
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
lfs@kubuntu-P8610:~$ cat ~/.bashrc
set +h
umask 022
LFS=/LFS
LC_ALL=POSIX
LFS_TGT=$(uname -m)-lfs-linux-gnu
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL LFS_TGT PATH

lfs@kubuntu-P8610:~$ uname -m
i686

lfs@kubuntu-P8610:~$ echo $PATH
/tools/bin:/bin:/usr/bin
lfs@kubuntu-P8610:~$

druuna 12-11-2012 05:44 AM

That looks OK.

Can you post the output of the following command:
Code:

$ $LFS_TGT-gcc -v dummy.c

Lancelot1 12-11-2012 05:45 AM

Quote:

Originally Posted by druuna (Post 4846832)
That looks OK.

Can you post the output of the following command:
Code:

$ $LFS_TGT-gcc -v dummy.c

lfs@kubuntu-P8610:~$ $LFS_TGT-gcc -v dummy.c
Using built-in specs.
COLLECT_GCC=i686-lfs-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/LFS/tools/libexec/gcc/i686-lfs-linux-gnu/4.7.1/lto-wrapper
Target: i686-lfs-linux-gnu
Configured with: ../gcc-4.7.1/configure --target=i686-lfs-linux-gnu --prefix=/LFS/tools --with-sysroot=/LFS --with-newlib --without-headers --with-local-prefix=/LFS/tools --with-native-system-header-dir=/tools/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath --enable-languages=c --with-mpfr-include=/LFS/sources/gcc-build/../gcc-4.7.1/mpfr/src --with-mpfr-lib=/LFS/sources/gcc-build/mpfr/src/.libs
Thread model: single
gcc version 4.7.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
/LFS/tools/libexec/gcc/i686-lfs-linux-gnu/4.7.1/cc1 -quiet -v dummy.c -quiet -dumpbase dummy.c -mtune=generic -march=pentiumpro -auxbase dummy -version -o /tmp/ccQQ2V3N.s
GNU C (GCC) version 4.7.1 (i686-lfs-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1, MPC version 1.0
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/LFS/LFS/tools/include"
ignoring nonexistent directory "/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/include
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/include-fixed
/LFS/tools/include
End of search list.
GNU C (GCC) version 4.7.1 (i686-lfs-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1, MPC version 1.0
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 23a9a2534477ca5e18ac97d603f37cb3
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/as -v --32 -o /tmp/ccYshmAz.o /tmp/ccQQ2V3N.s
GNU assembler version 2.22 (i686-lfs-linux-gnu) using BFD version (GNU Binutils) 2.22
COMPILER_PATH=/LFS/tools/libexec/gcc/i686-lfs-linux-gnu/4.7.1/:/LFS/tools/libexec/gcc/i686-lfs-linux-gnu/4.7.1/:/LFS/tools/libexec/gcc/i686-lfs-linux-gnu/:/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/:/LFS/tools/lib/gcc/i686-lfs-linux-gnu/:/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/
LIBRARY_PATH=/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/:/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/lib/:/LFS/tools/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
/LFS/tools/libexec/gcc/i686-lfs-linux-gnu/4.7.1/collect2 --sysroot=/LFS --eh-frame-hdr -m elf_i386 -dynamic-linker /tools/lib/ld-linux.so.2 /LFS/tools/lib/crt1.o /LFS/tools/lib/crti.o /LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/crtbegin.o -L/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1 -L/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/lib -L/LFS/tools/lib /tmp/ccYshmAz.o -lgcc -lc -lgcc /LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/crtend.o /LFS/tools/lib/crtn.o
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find /LFS/tools/lib/libc.so.6 inside /LFS
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find /LFS/tools/lib/libc_nonshared.a inside /LFS
/LFS/tools/lib/gcc/i686-lfs-linux-gnu/4.7.1/../../../../i686-lfs-linux-gnu/bin/ld: cannot find /LFS/tools/lib/ld-linux.so.2 inside /LFS
collect2: error: ld returned 1 exit status
lfs@kubuntu-P8610:~$

druuna 12-11-2012 05:59 AM

This looks suspicious:
Quote:

Configured with: ../gcc-4.7.1/configure --target=i686-lfs-linux-gnu --prefix=/LFS/tools --with-sysroot=/LFS --with-newlib --without-headers --with-local-prefix=/LFS/tools --with-native-system-header-dir=/tools/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath --enable-languages=c --with-mpfr-include=/LFS/sources/gcc-build/../gcc-4.7.1/mpfr/src --with-mpfr-lib=/LFS/sources/gcc-build/mpfr/src/.libs
Shouldn't that be:
Code:

--prefix=/LFS/tools -> --prefix=/tools
--with-local-prefix=/LFS/tools -> --with-local-prefix=/tools

This snippet from chapter 5.5:
Code:

../gcc-4.7.1/configure        \
    --target=$LFS_TGT          \
    --prefix=/tools            \
    --with-sysroot=$LFS        \
    --with-newlib              \
    --without-headers          \
    --with-local-prefix=/tools \
.
.

You might have made a mistake adding/editing the /LFS parts.

I would suggest to start from scratch and don't deviate from the book (/LFS vs /mnt/lfs being one example), especially if this is your first attempt to successfully build LFS.

Lancelot1 12-11-2012 06:31 AM

yeah i suspect it had to do with the GCC compilation.

Will rebuild and let you know if it fixes anything

druuna 12-11-2012 06:47 AM

Quote:

Originally Posted by Lancelot1 (Post 4846869)
yeah i suspect it had to do with the GCC compilation.

Will rebuild and let you know if it fixes anything

Just to make sure: Don't just rebuild GCC. You might have used the --prefix=/LFS/tools in other chapters as well.

Lancelot1 12-11-2012 11:32 AM

ok rebuild everything now starting from ch4 and everything was ok

thanks for the help druuna


All times are GMT -5. The time now is 05:52 AM.