https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104057
--- Comment #19 from cqwrteur <unlvsur at live dot com> --- (In reply to cqwrteur from comment #18) > (In reply to Andrew Pinski from comment #17) > > also multilib directories under ${prefix} for a cross does not use OS > > directories as most cross compilers have OS directories. > > Of course. I installed Linux kernel headers and glibc. > > they are installed in $PREFIX/$TARGET > > Since we need to build 32 glibc, x32 glibc, 64 glibc. I installed them into > separate dirs and copy files with each other. Or they will overwrite file. > > Then copy all headers to $PREFIX/$TARGET/include > > glibc32/lib to $PREFIX/lib32 $PREFIX/lib/32 > > glibc64/lib to $PREFIX/lib64 $PREFIX/lib > > glibcx32/lib to $PREFIX/libx32 $PREFIX/lib/x32 https://pete.akeo.ie/2010/07/compiling-mingw-w64-with-multilib-on.html Here was a similar result other people built 10 years ago. I find this issue happens for all targets, not just x86_64-w64-mingw32. The GCC just find different directories at build stage and after build.