Discussion:
[lfs-support] Cannot build first pass GCC in temporary toolchain
Michele Bucca
2018-06-25 09:19:11 UTC
Permalink
Hello, I'm trying to build a temporary toolchain using the LFS 8.2
book. I'm not a first time user The only deviation from the book that
I'm doing is that instead of installing inside everything in /tools
I'm installing it inside /mikeos.

the LFS_TGT variable is set to i686-mikeos-linux-gnu
the LFS variable is set to /mnt/lfs

Now I will post the configure commands:

Binutils-2.30

../configure --prefix=/mikeos --target=i686-mikeos-linux-gnu
--with-lib-path=/mikeos/lib --with-sysroot=/mnt/lfs --disable-nls
--disable-werror

GCC 7.3.0 - Pass 1

(GCC was patched using the instructions from the book, replacing
/tools with /mikeos. I'm attaching the patched files.)

../configure --target=i686-mikeos-linux-gnu --prefix=/mikeos
--with-glibc-version=2.11 --with-sysroot=/mnt/lfs --with-newlib
--without-headers --with-local-prefix=/mikeos
--with-native-system-header-dir=/mikeos/include --disable-nls
--disable-shared --disable-multilib --disable-decimal-float
--disable-threads --disable-libatomic --disable-libgomp
--disable-libmpx --disable-libquadmath --disable-libssp
--disable-libvtv --disable-libstdcxx --enable-languages=c,c++

Glibc 2.27

../configure --prefix=/mikeos --host=i686-mikeos-linux-gnu
--build=i686-pc-linux-gnu --enable-kernel=2.6.32
--with-headers=/mikeos/include libc_cv_forced_unwind=yes
libc_cv_c_cleanup=yes

i686-pc-linux-gnu is the output of $(../scripts/config.guess)

everything builds smoothly but when I try to compile dummy.c using

$LFS_TGT-gcc dummy.c it outputs this error and I can't continue.

/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ld:
cannot find crt1.o: No such file or directory
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ld:
cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status

the file that it's looking is inside /mikeos/lib
Here's the verbose output:

Using built-in specs.
COLLECT_GCC=i686-mikeos-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/lto-wrapper
Target: i686-mikeos-linux-gnu
Configured with: ../configure --target=i686-mikeos-linux-gnu
--prefix=/mikeos --with-glibc-version=2.11 --with-sysroot=/mnt/lfs
--with-newlib --without-headers --with-local-prefix=/mikeos
--with-native-system-header-dir=/mikeos/include --disable-nls
--disable-shared --disable-multilib --disable-decimal-float
--disable-threads --disable-libatomic --disable-libgomp
--disable-libmpx --disable-libquadmath --disable-libssp
--disable-libvtv --disable-libstdcxx --enable-languages=c,c++
Thread model: single
gcc version 7.3.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
/mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/cc1
-quiet -v -iprefix
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/ dummy.c
-quiet -dumpbase dummy.c -mtune=generic -march=pentiumpro -auxbase
dummy -version -o /tmp/ccLt7dlq.s
GNU C11 (GCC) version 7.3.0 (i686-mikeos-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version
4.0.1, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/include"
ignoring duplicate directory
"/mnt/lfs/mikeos/bin/../lib/gcc/../../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include"
ignoring duplicate directory
"/mnt/lfs/mikeos/bin/../lib/gcc/../../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include-fixed"
ignoring nonexistent directory
"/mnt/lfs/mikeos/bin/../lib/gcc/../../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/include"
ignoring duplicate directory "/mnt/lfs/mikeos/include"
#include "..." search starts here:
#include <...> search starts herecd ..:
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/include-fixed
/mnt/lfs/mikeos/include
End of search list.
GNU C11 (GCC) version 7.3.0 (i686-mikeos-linux-gnu)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version
4.0.1, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c1d3a69e3cae498aec5e9863f3833dd4
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/as
-v --32 -o /tmp/ccyJDQbI.o /tmp/ccLt7dlq.s
GNU assembler version 2.30 (i686-mikeos-linux-gnu) using BFD version
(GNU Binutils) 2.30
COMPILER_PATH=/mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/:/mnt/lfs/mikeos/bin/../libexec/gcc/:/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/
LIBRARY_PATH=/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/:/mnt/lfs/mikeos/bin/../lib/gcc/:/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/lib/:/mnt/lfs/mikeos/lib
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
/mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/collect2
-plugin /mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/liblto_plugin.so
-plugin-opt=/mnt/lfs/mikeos/bin/../libexec/gcc/i686-mikeos-linux-gnu/7.3.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccpJK4F0.res
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc --sysroot=/mnt/lfs --eh-frame-hdr -m
elf_i386 -dynamic-linker /mikeos/lib/ld-linux.so.2 crt1.o crti.o
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/crtbegin.o
-L/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0
-L/mnt/lfs/mikeos/bin/../lib/gcc
-L/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/lib
-L/mnt/lfs/mikeos/lib /tmp/ccyJDQbI.o -lgcc -lc -lgcc
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/crtend.o
crtn.o
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ld:
cannot find crt1.o: No such file or directory
/mnt/lfs/mikeos/bin/../lib/gcc/i686-mikeos-linux-gnu/7.3.0/../../../../i686-mikeos-linux-gnu/bin/ld:
cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status

linux.h.txt is the file gcc/config/linux.h
i386_linux.h.txt is the file gcc/config/i386/linux.h
i386_linux64.h.txt is the file gcc/config/i386/linux64.h
Xi Ruoyao
2018-06-25 09:59:30 UTC
Permalink
Post by Michele Bucca
Hello, I'm trying to build a temporary toolchain using the LFS 8.2
book. I'm not a first time user The only deviation from the book that
I'm doing is that instead of installing inside everything in /tools
I'm installing it inside /mikeos.
the LFS_TGT variable is set to i686-mikeos-linux-gnu
the LFS variable is set to /mnt/lfs
/* snip */
Post by Michele Bucca
linux.h.txt is the file gcc/config/linux.h
Next, we add our define statements which alter the default
prefix to the end of the file. Note that the trailing “/”
in “/tools/lib/” is required.
Apparently "/mikeos/lib" in linux.h should be "/mikeos/lib/".
Post by Michele Bucca
i386_linux.h.txt is the file gcc/config/i386/linux.h
i386_linux64.h.txt is the file gcc/config/i386/linux64.h
--
Xi Ruoyao <***@stu.xidian.edu.cn>
School of Aerospace Science and Technology, Xidian University
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing
Michele Bucca
2018-06-25 14:25:31 UTC
Permalink
Post by Xi Ruoyao
Post by Michele Bucca
Hello, I'm trying to build a temporary toolchain using the LFS 8.2
book. I'm not a first time user The only deviation from the book that
I'm doing is that instead of installing inside everything in /tools
I'm installing it inside /mikeos.
the LFS_TGT variable is set to i686-mikeos-linux-gnu
the LFS variable is set to /mnt/lfs
/* snip */
Post by Michele Bucca
linux.h.txt is the file gcc/config/linux.h
Next, we add our define statements which alter the default
prefix to the end of the file. Note that the trailing “/”
in “/tools/lib/” is required.
Apparently "/mikeos/lib" in linux.h should be "/mikeos/lib/".
Thank you! That solved the problem! ;)
Post by Xi Ruoyao
Post by Michele Bucca
i386_linux.h.txt is the file gcc/config/i386/linux.h
i386_linux64.h.txt is the file gcc/config/i386/linux64.h
--
School of Aerospace Science and Technology, Xidian University
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Do not top post on this list.
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
http://en.wikipedia.org/wiki/Posting_style
Loading...