On Fri, Apr 28, 2023 at 9:13 AM Daniel P. Berrangé berrange@redhat.com wrote:
On Fri, Apr 28, 2023 at 01:41:05PM +0100, Richard W.M. Jones wrote:
On Fri, Apr 28, 2023 at 02:22:40PM +0200, Florian Weimer wrote:
Looking at
Information for RPM mingw64-zlib-1.2.13-2.fc38.noarch.rpm https://koji.fedoraproject.org/koji/rpminfo?rpmID=33118048
sysroot paths look like this:
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/zlib1.dll /usr/x86_64-w64-mingw32/sys-root/mingw/include/zconf.h /usr/x86_64-w64-mingw32/sys-root/mingw/include/zlib.h /usr/x86_64-w64-mingw32/sys-root/mingw/lib/libz.dll.a /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/zlib.pc
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.
FWIW:
$ x86_64-w64-mingw32-gcc -print-sysroot /usr/x86_64-w64-mingw32/sys-root
which would indicate that you are correct that /mingw is somehow "inside" the sysroot.
Then on the Meson side we define
root = '/usr/i686-w64-mingw32/sys-root/mingw'
in the /usr/share/mingw/toolchain-mingw32.meson spec, while with configure we invoke
configure \ --host=i686-w64-mingw32 \ --build=x86_64-redhat-linux-gnu \ --target=i686-w64-mingw32 \ --prefix=/usr/i686-w64-mingw32/sys-root/mingw \ --exec-prefix=/usr/i686-w64-mingw32/sys-root/mingw \ --bindir=/usr/i686-w64-mingw32/sys-root/mingw/bin \ --sbindir=/usr/i686-w64-mingw32/sys-root/mingw/sbin \ --sysconfdir=/usr/i686-w64-mingw32/sys-root/mingw/etc \ --datadir=/usr/i686-w64-mingw32/sys-root/mingw/share \ --includedir=/usr/i686-w64-mingw32/sys-root/mingw/include \ --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib \ --libexecdir=/usr/i686-w64-mingw32/sys-root/mingw/libexec \ --localstatedir=/usr/i686-w64-mingw32/sys-root/mingw/var \ --sharedstatedir=/usr/i686-w64-mingw32/sys-root/mingw/com \ --mandir=/usr/i686-w64-mingw32/sys-root/mingw/share/man \ --infodir=/usr/i686-w64-mingw32/sys-root/mingw/share/info \
is there any difference between the notion of the 'sysroot' vs the install 'prefix' ?
There is at least one minor difference which I recently encountered with musl packaging: The gcc/cpp/ld --sysroot option rewrites paths that include the configured /usr prefix, so e.g.
gcc --sysroot=/usr/x86_64-SYSROOT-linux-gnu -E -Wp,-v -xc /dev/null
shows that it will only search /usr/x86_64-SYSROOT-linux-gnu/usr/include for headers. It would be nice if all new sysroots standardized on a prefix of $SYSROOT/usr since it's useful for quickly building small things without needing a build system, but it's a minor detail overall.
Thanks.
David