Hi, > I think the important distinction here is to make between building the > compiler itself (which is a binary which you build using your existing > toolchain, > using the CRT that is default/usable there), and building the runtimes > (libgcc, > libstdc++, libada) which the compiler will be using later. > > The compiler itself can't be built linking to UCRT (which is what you are > doing > in effect, even though you are linking to the old plain msvcrt.dll, and the > libgcc/libstdc++ you'll be linking also is for msvcrt.dll), but you only want > to > build the runtimes (libgcc, libstdc++, libada) that way. > > In my own setup for bootstrapping a mingw cross compiler on linux, I do the > following: > > - Build binutils with --target=<arch>-w64-mingw32 --prefix=<prefix> > - Install mingw-w64-headers with --prefix=<prefix>/<arch>-w64-mingw32 > - Build the compiler part of gcc with --target=<arch>-w64-mingw32 > --prefix=<prefix> --enable-languges=c,c++, but only compile the compiler > itself (by "make all-gcc; make install-gcc") > - Build the mingw-w64-crt with --prefix=<prefix>/<arch>-w64-mingw32 > --host=<arch>-w64-mingw32 > - Build the rest of gcc with "make; make install" in the gcc directory > > I don't know if the gcc configure script has got a special place to inject > extra > flags only for building the runtimes. > > But setting up the newly installed mingw headers and crt with --with-default- > msvcrt= (especially if you are installing this into a separate sysroot > different > from your existing compiler) should at least work, since the build of the > runtimes should end up using those headers. > > Or maybe gcc has got a way of setting them separately from the flags for the > compiler itself?
OK, I built GCC as follows: ./configure --prefix=/mingw64 --enable-languages=c,c++,ada --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-multiarch --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include make all-gcc make install-gcc Then I built the MinGW-w64 CRT as follows ./configure --prefix=/mingw64/x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-multiarch --with-default-msvcrt=ucrt --disable-lib32 --with-libraries=all make make install Then I went back to the GCC directory and ran make This failed. IT for some reason wanted to go back to stage-1, and the --disable-multiarch is no longer in effect - it tried to build a 32-bit libgcc, which failed because it could find a 32-bit libkernel.a. I don't want 32-bit support at this time. I am going to try without the Ada compiler in the mix and see what washes out but I don't have a good feeling about this. Any ideas? _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
