[libcxx-commits] [PATCH] D140343: [libc++] List supported libcs

Alvin Wong via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 26 06:34:11 PST 2023


alvinhochun added inline comments.


================
Comment at: libcxx/docs/index.rst:122
+Linux           i386, x86_64, arm, arm64  glibc-2.24+
+Windows         i386, x86_64              MSVCRT-???, MinGW???   Both MSVC and MinGW style environments
+AIX             powerpc, powerpc64        ???-???
----------------
mstorsjo wrote:
> goncharov wrote:
> > mstorsjo wrote:
> > > goncharov wrote:
> > > > mstorsjo wrote:
> > > > > philnik wrote:
> > > > > > mstorsjo wrote:
> > > > > > > For the tested and supported C runtime on Windows, I'd just write `UCRT` - that's the one used both by MSVC and mingw setups (although with a little bit of different wrapping around it in the mingw case).
> > > > > > > 
> > > > > > > In mingw configurations, it's also buildable with msvcrt.dll - I do test building it regularly (every other day more or less), but that configuration doesn't pass all tests and isn't one of the formally supported configs.
> > > > > > Is there any versioning for UCRT, and if yes - which ones work currently?
> > > > > There is some versioning of it I think - as it's shipped as part of Windows and/or the Windows SDK, it does have version numbers matching the Windows builds, like e.g. `10.0.19041.0`. However the version number is seldom shown/used very visibly in UCRT contexts.
> > > > > 
> > > > > I'm not sure exactly which version ends up tested in the CI - it depends on whatever version of Windows is used in the CI base images/runners (which @goncharov maintains). I guess it'd be possible to dig it up somehow...
> > > > > 
> > > > > Practically, I would expect all versions of UCRT to "work" (it's been present since 2015 since the launch of Windows 10), while older ones might fail some corner case tests. (We also do have detection of some known UCRT bugs which is used to make the tests "pass" - so older versions might be considered passing to the same extent if we'd add similar detection for their issues.)
> > > > I see that cmake reports
> > > > 
> > > > -- The C compiler identification is MSVC 19.29.30141.0
> > > > -- The CXX compiler identification is MSVC 19.29.30141.0
> > > > -- The ASM compiler identification is MSVC
> > > > -- Found assembler: C:/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
> > > > 
> > > > is that what you are looking for?
> > > No, those are different numbers.
> > > 
> > > There's one version number for the version of the WinSDK (which is installed as part of MSVC), normally not very visibly printed but easy to locate on disk (e.g. in paths such as `Program Files (x86)/Windows Kits/10/lib/10.0.19041.0`), and one version number for the actual running version of the OS (easily visible in e.g. the control panel, not quite as easily accessible via code).
> > > 
> > > If we'd link the UCRT statically (the libcxx tests don't), the version of WinSDK would be what matters, but here, it's the OS build version that matters.
> > > 
> > > I guess the simplest would be to figure out a way to check the exact OS build version via code, somehow, and include that with a printout in a temporary patch triggering a CI run.
> > > 
> > sure, I can easily plug this to buildkite steps if that helps.
> > 
> > according to stackoverflow https://stackoverflow.com/questions/2665755/how-to-get-installed-windows-sdk-version 
> > is can be done by
> > $(Get-Item "hklm:\SOFTWARE\Microsoft\Microsoft SDKs\Windows").GetValue("CurrentVersion")
> > 
> > have not tried. Is that the value you are looking for?
> That would probably be the SDK version, but for the purposes of this document, we'd need to know the OS build version instead.
> 
> The `CurrentVersion ` key in `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion` should hold that value.
> 
> Other commands that would print the relevant info seem to be either of these:
> ```
> > wmic Path CIM_DataFile WHERE Name='c:\\windows\\explorer.exe' Get Version | find "10"
> > wmic os get BuildNumber
> > systeminfo | findstr /B /C:"OS Version"
> ```
It seems slightly more complicated than that, I think. See https://learn.microsoft.com/en-us/cpp/windows/universal-crt-deployment?view=msvc-170

For the system-deployed UCRT, it's only tied to the OS version starting from Windows 10. For Windows Vista though Windows 8.1 it was distributed via Windows Update, with the latest version being `10.0.14393`. But even for Windows 10 it's not exactly tied to the system version -- my Windows install is currently 21H2 (`10.0.19044.2486`) while `C:\Windows\System32\ucrtbase.dll` has the version `10.0.19041.789`. I believe the version of `ucrtbase.dll` is what matters.

(Local deployment is also possible, but the linked page states that it only works for Windows versions before 10, as Windows 10 and 11 will always use the system UCRT, so it doesn't change much.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140343/new/

https://reviews.llvm.org/D140343



More information about the libcxx-commits mailing list