On Fri, 2021-11-12 at 08:09 +0000, Jonathan Wakely via Gcc-help wrote: > On Fri, 12 Nov 2021, 02:28 Bill Cunningham via Gcc-help, < > gcc-help@xxxxxxxxxxx> wrote: > > > I have this error when trying to build a c++ end onto a gcc > > "cross" > > compiler already built in a small way. What I am doing is building a > > "cross" compiler by following some of lfs's instructions. I want a > > "cross" compiler but maybe I should just build a native compiler > > with > > bootstrapping disabled. I will eventually need a gcc compiler with > > everything because any type of testing is done with a "full suite" > > compiler, is my understanding. But, one thing at a time. > > > It seems to me that just building a full GCC would be simpler than > your > piecemeal approach. > > https://gcc.gnu.org/wiki/Installing GCC Note that even a x86_64 -> x86_64 cross compiler is still different from a native compiler. For example, cross compiler can produce executable linking to a newer libc in a sysroot by default, so the executable will not run on your native environment (you'll need to run it in a chroot). So if you want a native compiler, just build a native compiler. It's just like if you want a duck, just buy a duck instead of buy a chicken and put it into water :). /* snip */ > I am going into gcc-11.2.0/libstdc++-v3 and running the configure > > script there. That might not be good idea. > > Don't do that then. Run the top-level configure instead. The command in LFS is highly customized for our special purpose, to build a Linux system from source code. It's not a tutorial to build GCC or a general tutorial to build a cross toolchain. If you use LFS for other purpose without a fully knowledge of what you are doing, you're likely to encounter problems. Even if you follow the LFS book strictly, the toolchain produced by Chapter 5 is still not a full cross toolchain. For example, our libstdc++ in Chapter 5 has no thread support, that's why we will rebuild it in Chapter 7. If you want a tutorial for building a cross toolchain, you can easily find one online with Google or something. Again don't assume a chicken to be a duck. > -- Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx> School of Aerospace Science and Technology, Xidian University