https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101823
--- Comment #5 from bootmgr at 163 dot com <bootmgr at 163 dot com> --- (In reply to niXman from comment #4) > please provide the step-by-step instruction you used. 1. Extract binutils gcc mingw-w64 files to any where Extract gmp mpfr mpc isl to gcc source directory note: please make sure no subdirectories are included under gcc-x.x.x/{gmp,mpfr,mpc,isl}. these file can be found here http://ftp.gnu.org/gnu/binutils/ http://ftp.gnu.org/gnu/gcc/ https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/ https://gmplib.org/#DOWNLOAD https://www.mpfr.org/mpfr-current/#download https://www.multiprecision.org/mpc/download.html https://libisl.sourceforge.io/ 2. Clone the windows default manifest (git://cygwin.com/git/cygwin-apps/windows-default-manifest.git) 3. These instructions are used to build cross toolchain and install to /mingw (can be changed to other directory). note: use "make -j$(nproc)" instead "make" to use more CPU cores. 1) Set PREFIX and PATH variables export PREFIX=/mingw export PATH=$PATH:$PREFIX/bin note: if you are not root, please run "sudo mkdir /mingw && sudo chmod 777 /mingw" 2) chdir to gcc source directory and run "sed -i 's/${prefix}\/mingw\//${prefix}\//g' configure" see also https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-gcc/PKGBUILD#L155 3) Build binutils ../binutils-2.40/configure --disable-nls --disable-rpath --enable-64-bit-bfd --enable-deterministic-archives --enable-install-libiberty --target=x86_64-w64-mingw32 --prefix=$PREFIX make && make install-strip 4) Install mingw-w64 headers ../mingw-w64-v10.0.0/mingw-w64-headers/configure --host=x86_64-w64-mingw32 --prefix=$PREFIX/x86_64-w64-mingw32 make && make install -j16 5) Build GCC core compiler ../gcc-12.2.0/configure --disable-multilib --disable-nls --disable-rpath --disable-symvers --enable-languages=c,c++,lto --enable-mingw-wildcard --enable-threads=posix --enable-libgomp --disable-libstdcxx-verbose --enable-fully-dynamic-string --target=x86_64-w64-mingw32 --prefix=$PREFIX make all-gcc && make install-strip-gcc 6) Build mingw-w64 ../mingw-w64-v10.0.0/configure --enable-experimental --disable-lib32 --host=x86_64-w64-mingw32 --prefix=$PREFIX/x86_64-w64-mingw32 make && make install-strip 7) Build winpthreads (pthread support for windows) ../mingw-w64-v10.0.0/mingw-w64-libraries/winpthreads/configure --host=x86_64-w64-mingw32 --prefix=$PREFIX/x86_64-w64-mingw32 8) Build windows default manifest x86_64-w64-mingw32-windres -F pe-x86-64 ./windows-default-manifest/default-manifest.rc -o $PREFIX/x86_64-w64-mingw32/lib/default-manifest.o note: this has the same effect as the following command ../windows-default-manifest/configure --host=x86_64-w64-mingw32 --prefix=$PREFIX/x86_64-w64-mingw32 make && make install 9) Build GCC compiler chdir to build gcc directory and run "make && make install-strip" 4.Now we have a mingw-w64 cross toolchain (without zstd libiconv support) So we can build canadian toolchain easily 1) Build binutils ../binutils-2.40/configure --disable-nls --disable-rpath --enable-64-bit-bfd --enable-deterministic-archives --enable-install-libiberty --host=x86_64-w64-mingw32 --prefix=$PREFIX 2) Build GCC ../gcc-12.2.0/configure --disable-multilib --disable-nls --disable-rpath --disable-symvers --disable-win32-registry --enable-languages=c,c++,lto --enable-mingw-wildcard --enable-threads=posix --enable-libgomp --disable-libstdcxx-verbose --enable-fully-dynamic-string --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=$PREFIX 3) Build mingw-w64, winpthreads and windows default manifest ../mingw-w64-v10.0.0/configure --enable-experimental --disable-lib32 --host=x86_64-w64-mingw32 --prefix=$PREFIX ../mingw-w64-v10.0.0/mingw-w64-libraries/winpthreads/configure --host=x86_64-w64-mingw32 --prefix=$PREFIX x86_64-w64-mingw32-windres -F pe-x86-64 ./windows-default-manifest/default-manifest.rc -o install_dir/lib/default-manifest.o