Subject: g++-mingw-w64-ucrt64: ucrt build fails to default to ucrtbase
Package: g++-mingw-w64-ucrt64
Version: 15.2.0-12+28.3
Severity: normal
Dear Maintainer,
Given a trivial main.cxx:
#include <windows.h>
int main(int argc, char **argv)
{
return 0;
}
Compilation using ucrt g++ defaults to the wrong crt.
(-plugin-opt=-pass-through=-lmsvcrt below)
x86_64-w64-mingw32ucrt-g++ -v main.cxx -o main.exe
COLLECT_GCC_OPTIONS='-v' '-o' 'main.exe' '-shared-libgcc' '-mtune=generic'
'-march=x86-64' '-dumpdir' 'main.'
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/collect2 -plugin
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/lto-wrapper
-plugin-opt=-fresolution=/t
mp/ccIMKscQ.res -plugin-opt=-pass-through=-lmingw32
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt
-plugin-opt=-p
ass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32
-plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32
-plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmingwex
-plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lk
ernel32 -m i386pep -Bdynamic -o main.exe
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/../../../../x86_64-w64-mingw32ucrt/lib/crt2.o
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/crtbegin.o
-L/usr/lib/gcc/x86_64-w64-m
ingw32ucrt/15
-L/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/../../../../x86_64-w64-mingw32ucrt/lib
/tmp/ccpCzx7f.o -lstdc++ -lmingw32 -lgcc_s -lgcc -lmingwex -lmsvcrt
-lkernel32 -lpthread -ladvapi32 -lshell32
-luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmingwex -lmsvcrt -lkernel32
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/crtend.o
Workaround available that forces what I would have considered to be the
correct default behavior. (-plugin-opt=-pass-through=-lucrtbase below)
x86_64-w64-mingw32ucrt-g++ -v main.cxx -o main.exe -mcrtdll=ucrtbase
COLLECT_GCC_OPTIONS='-v' '-o' 'main.exe' '-mcrtdll=ucrtbase'
'-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'main.'
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/collect2 -plugin
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/lto-wrapper
-plugin-opt=-fresolution=/t
mp/ccxEOLp0.res -plugin-opt=-pass-through=-lmingw32
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lucrtbase
-plugin-opt=
-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32
-plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel
32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmingwex
-plugin-opt=-pass-through=-lucrtbase -plugin-opt=-pass-through
=-lkernel32 -m i386pep -Bdynamic -o main.exe
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/../../../../x86_64-w64-mingw32ucrt/lib/crt2.o
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/crtbegin.o -L/usr/lib/gcc/x86_64-w
64-mingw32ucrt/15
-L/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/../../../../x86_64-w64-mingw32ucrt/lib
/tmp/ccI4fIwx.o -lstdc++ -lmingw32 -lgcc_s -lgcc -lmingwex -lucrtbase
-lkernel32 -lpthread -ladvapi32 -ls
hell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmingwex -lucrtbase
-lkernel32 /usr/lib/gcc/x86_64-w64-mingw32ucrt/15/crtend.o
COLLECT_GCC_OPTIONS='-v' '-o' 'main.exe' '-mcrtdll=ucrtbase'
'-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'main.'
-- System Information:
Debian Release: 13.6
APT prefers stable
APT policy: (990, 'stable'), (500, 'stable-updates'), (500,
'stable-security'), (100, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.12.96+deb13-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE
not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: SELinux: enabled - Mode: Enforcing - Policy name: default
Versions of packages g++-mingw-w64-ucrt64 depends on:
ii gcc-mingw-w64-base 15.2.0-12+28.3
ii gcc-mingw-w64-ucrt64 15.2.0-12+28.3
ii gcc-mingw-w64-ucrt64-runtime 15.2.0-12+28.3
ii libc6 2.42-17
ii libgmp10 2:6.3.0+dfsg-3
ii libisl23 0.27-1
ii libmpc3 1.3.1-1+b3
ii libmpfr6 4.2.2-1
ii libzstd1 1.5.7+dfsg-1
ii zlib1g 1:1.3.dfsg+really1.3.1-1+b1
g++-mingw-w64-ucrt64 recommends no packages.
Versions of packages g++-mingw-w64-ucrt64 suggests:
pn gcc-15-locales <none>
-- no debconf information