-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ucrt C library via MSYS2 UCRT64 on Windows #44006
Comments
There is currently a comment referencing Lines 505 to 516 in 8bdb045
|
It would be interesting to hear if someone can get |
It looks like the MSYS2 UCRT64 environment has a gcc, so perhaps they have already addressed that part? |
We have not supported msys2 in a couple years, but that is probably a good starting point |
Migrating MinGW to UCRT requires 5 steps on Arch linux (should be similar for Cygwin and other Linux):
Then we can use the new UCRT is definitely better than old msvcrt because it supports more modern C features, so it can reduce a lot of cross-platform hacks especially for Windows. However, I am afraid that the whole Windows toolchain and all Windows artifacts in |
The near term objective is just to get Julia to build with UCRT. |
How should we deal with prebuilt third-party dependency? |
Yes, I understand. I'm not suggesting that we start distributing Julia linked to UCRT. I'm just suggesting that the first goal is to develop the ability to build Julia linked to UCRT. On Linux, BinaryBuilder currently supports both glibc and musl, so perhaps we eventually develop a similar capability. |
I agree with you. |
We need a new triplet for Maybe: ref: Environments - MSYS2 |
Yes, it is incompatible with old binary artifacts depending on msvcrt.dll. |
Another thing is that we may have to fix the MinGW/MSYS2 compilation environment first. |
I think (You can also use a ucrt-enabled cross gcc toolchain on Linux to compile Julia.) According to msys2/MSYS2-packages#3040 |
Patch that enabled building under MSys2 UCRT64.
Needed a version of PR 48640
Edit: Tim S. |
It seems that only msys2 currently has support for ucrt (why don't they upstream it?) so we can't support it in binary builder and change the ecosystem to it. |
Currently trying USE_BINARYBUILDER=0 and USE_SYSTEM_CSL = 1 with the below because of build errors; most already know and reported by others. Edit in issue 45645
|
The support for ucrt already exists in upstream mingw64, it is turned on by rebuilding the whole toolchain from scratch with |
Apparently to add a new triplet we should send a pull request to modify this file: Lines 640 to 644 in e3d366f
Another question about this platform, are we sticking with gcc or is anyone thinking about clang? My inclination would be to stick with gcc at the moment. Thus the UCRT64 msys2 environment looks like the target. |
CLANG64 gives the below output
|
After building most deps from source tests fail below plus the normal three of InteractiveUtils, FileWatching, and REPL.
|
I am building Cygwin git master branch with llvm copy patch using USE_BINARYBUILDER=0.
I picked libucrtbase.a to build UCRT64 because google searches implied it might be more correct. One of the other two might be better. Once, the current Cygwin build finishes could take a day or so. Esp. if I need to re-start it. Edit: Turns out linking to ucrt with an Toolchain not designed to use UCRT results in linker errors most often and when it does not seems to have run-time errors. Tim S. |
Cross reference #49867 (comment) |
xref: Background: We need high-quality implementations of
|
POC(Proof Of Concept) for compiling from source code using the UCRT64 environment. Env
julia souce with patchs: based on master, https://github.com/inkydragon/julia/tree/cyhan/win-ucrt64 diff: 1b183b9...inkydragon:julia:cyhan/win-ucrt64 deps: pacman -S cmake diffutils git m4 make patch tar p7zip curl python
pacman -S mingw-w64-ucrt-x86_64-gcc
pacman -S unzip mingw-w64-ucrt-x86_64-gcc-fortran mingw-w64-ucrt-x86_64-nasm
# pacman -S mingw-w64-ucrt-x86_64-cmake
# https://github.com/JuliaLang/julia/issues/51740
override HAVE_SSP := 0
# new flag
USE_WIN_UCRT := 1
USE_BINARYBUILDER=0
# TODO: build p7zip from source
USE_BINARYBUILDER_P7ZIP:=1 build steps
I get
NOTE: build llvm takes a loooong time, for me, it's 30~40 min. testIf you use ldd to check the shared libraries... ldd bug in UCRT64 env
You may want to use EXCEPTION_ACCESS_VIOLATION when test
Test Summary Log
TODO: fix libz install |
Please add "MSYS2" label. This UCRT seem like good to support (not just the float parsing bug, that has a better/easier workaround), it's the future, for Windows10+, i.e. all supported Julia platforms, available for Vista+ (also latest version still available there?), though I see "Runtime library support for Windows XP is no longer available in the latest Visual C++ Redistributable for Visual Studio 2015, 2017, 2019 and 2022. The last redistributable to support Windows XP is version 16.7 (file version 14.27.29114.0)." that I think concerns no one... |
On Microsoft Windows, there is a new C runtime "libc" called "ucrt". Many of the changes support ISO C99 conformance..
https://devblogs.microsoft.com/cppblog/introducing-the-universal-crt/
https://docs.microsoft.com/en-us/cpp/porting/upgrade-your-code-to-the-universal-crt?view=msvc-170
UCRT deployment was backported to Windows XP, although Windows XP is no longer supported:
https://docs.microsoft.com/en-us/cpp/windows/universal-crt-deployment?view=msvc-170
MSYS2 provides a UCRT64 build environment:
https://www.msys2.org/docs/environments/
MSYS2 currently has a julia package, with many packages:
https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-julia
For the near term, I propose that we develop build instructions and improve compatibility with the MSYS2 UCRT64 build environment. This may be beneficial by also making Julia buildable on other MSYS2 platforms such as aarch64.
The text was updated successfully, but these errors were encountered: