On Mon, 2022-03-14 at 18:43 -0400, Benjamin Lovy wrote: /* snip */ > Now, I would like to build a fresh GCC using the previously build GCC, > this > glib, and the GMP/MPC/MPFR libraries I just built: > > /build/gcc-11.2.0/configure \ > CFLAGS="-Wl,-dynamic-linker=/lib/ld-linux-x86-64.so.2 -Wl,-rpath,/lib > -I/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include -I/usr/include > -I/usr/include/linux -I/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include- > fixed > -B/bin" \ I think these FLAGS are mistaken. --sysroot won't expand -I/usr/include to search $SYSROOT/usr/include for example. And, Without "-O2" your GCC will be built without optimization, which will make a stupidly slow compiler. > --prefix=/bootstrap/gcc \ > --host=x86_64-pc-linux-gnu \ > --with-sysroot=/bootstrap \ You need --with-build-sysroot instead of --with-sysroot. Read https://gcc.gnu.org/install/configure.html for their difference. Please note --sysroot is mostly for cross-compilation. If you are not building a GCC which is meant to run in a new OS tree (chroot or container, or even reboot into a new OS tree), it's likely you shouldn't use sysroot at all. -- Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx> School of Aerospace Science and Technology, Xidian University