Florian Weimer wrote:
Is the /mingw/ part of the sysroot path, or is it within the
sysroot?
Would I use --sysroot=/usr/x86_64-w64-mingw32/sys-root or
--sysroot=/usr/x86_64-w64-mingw32/sys-root/mingw to build against the
sysroot?
I assumed the latter, but now I wonder if /mingw in the sysroot is the
analogue of /usr in GNU/Linux sysroots.
/mingw is a prefix like /usr. Where this comes from is the native MSYS/MSYS2
toolchains, where / (and if present, /usr) contains binaries dependent on
the MSYS DLL ("MSYS binaries"), whereas the subtree /mingw is what contains
"MinGW binaries", i.e., ones that do NOT require an MSYS DLL. The separation
helps MSYS because, if it invokes an MSYS binary, no path translation is
done and the binary receives POSIX paths, whereas a MinGW binary gets its
command line automatically translated to Windows paths. The rule is that
everything either outside of the MSYS root or inside the /mingw subdirectory
is assumed to be a MinGW (or MSVC) binary whereas everything with the MSYS
root but not under /mingw is assumed to be an MSYS binary.
Cross toolchains are not really affected by this feature, but since MinGW
build scripts written for MSYS(2) will generally assume native binaries to
be under /mingw, it is probably best to keep this subdirectory in the
sysroot.
Kevin Kofler