On 2019-03-20 02:41 -0700, Pei Jia wrote: > I'd love to report some other trivial bugs while building LFS: > > 1. > http://www.linuxfromscratch.org/lfs/view/development/chapter05/gcc-libstdc++.html > ../libstdc++-v3/configure \ > --host=$LFS_TGT \ > --prefix=/tools \ > --disable-multilib \ > --disable-nls \ > --disable-libstdcxx-threads \ > --disable-libstdcxx-pch \ > --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/8.3.0 > should be > ../configure \ > --host=$LFS_TGT \ > --prefix=/tools \ > --disable-multilib \ > --disable-nls \ > --disable-libstdcxx-threads \ > --disable-libstdcxx-pch \ > --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/8.3.0
Why? Did you "cd gcc-8.3.0/libstdc++-v3"? The book has a <note> saying you should "change to gcc-8.3.0 directory." Or did you rebuilt the entire GCC with this command? That would be totally wrong. In this stage GCC should have "--target=$LFS_TGT", not "--host=$LFS_TGT". > 2. > http://www.linuxfromscratch.org/lfs/view/development/chapter05/binutils-pass2.html > CC=$LFS_TGT-gcc \ > AR=$LFS_TGT-ar \ > RANLIB=$LFS_TGT-ranlib \ > ../configure \ > --prefix=/tools \ > --disable-nls \ > --disable-werror \ > --with-lib-path=/tools/lib \ > --with-sysroot > > better separate into two parts: > > CC=$LFS_TGT-gcc \ > AR=$LFS_TGT-ar \ > RANLIB=$LFS_TGT-ranlib > and > ../configure \ > --prefix=/tools \ > --disable-nls \ > --disable-werror \ > --with-lib-path=/tools/lib \ > --with-sysroot Again, why? And if you did this, did you remember to unset CC, AR, and RANLIB after finishing up Binutils? If you didn't, you'll make *every* packages in Chapter 5 to pick up them. That would be totally wrong. > Otherwise, I met some problem as > https://www.linuxquestions.org/questions/linux-from-scratch-13/ch-5-9-binutils-pass-2-error-cannot-run-c-compiled-programs-807747/ That's in 2010 with LFS 6.5 and we'd never know why exactly these guys had this issue. Maybe they just mistyped something. If you get "cannot run C compiled programs" just compile a C program and try to run it: echo "int main(){}" > dummy.c; $LFS_TGT-gcc dummy.c; ./a.out; Then investigate *why* this can not run, instead of messing up the instruction, continuing blindly, and complaining the book. I believe you are really trying to run when you don't know how to walk. Before trying to hack LFS onto a USB drive, you should build a LFS system without screwing it up, at first. -- Xi Ruoyao <[email protected]> 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
