Conversation
|
Thank you for your pull request. We require contributors to agree to our Contributor License Agreement (https://exaloop.io/legal/cla), and we don't have @K0lb3 on file. In order for us to review and merge your code, please email info@exaloop.io to get yourself added. |
|
My first milestone for this PR is that the codon target compiles successfully. |
|
llvm and MinGW from choco might be "incompatible" for this project, as the llvm package seems to be targeting msvc. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
Small update. GCC x LLVM is quite the pain on Windows. For GCC and its libs MinGW can be used just fine, but LLVM in combination with that is annoying.
llvm-mingw doesn't include some header files used by codon, |
|
Well, more fun. llvm-openmp uses an masm format asm for Windows (32x and 64x), and MinGW doesn't ship an masm assembler. At the very least arm isn't affected by this, as llvm seems to use a (linux) gcc based asm for it. Oh, and to add on top, |
|
long long story |
|
My latest compile history is this (2025/7/18).
|
|
I also started to adjust some of the dependencies in the Using read.c & allloc.c instead of mmapio.c & mmap.c for backtrace, |
|
@K0lb3 Do you joined exaloop/codon's DC server? maybe we can have a chat there |
@K0lb3 have you tried using MSYS2? I see they have the package mingw-w64-x86_64-llvm-openmp in their repository. If you install base-devel package (its dependencies are installed automatically) it provides you with a *nix development environment, but produces native Windows executables. You can install both GCC and clang. P.S.: don't forget to check this page: Environments. |
@TaiXeflar obviously you don't know what MSYS2 is and didn’t bother to look at the links I included in my message, did you? MSYS2 packages are usually precompiled binaries. I quote from MSYS2 home page:
Follow this link to mingw-w64-x86_64-llvm-openmp package: you'll see there is a separate link to sources and under "Build Dependencies" you'll see there another MSYS2 package listed, mingw-w64-x86_64-uasm, a free MASM-compatible assembler based on JWasm (mingw-w64). If required, the software can be rebuilt from sources from within MSYS2. |
|
Super interesting @K0lb3 ! +1 for trying msys2 and a clang only toolchain. Any reason you did not start with such a setup? Any thoughts/ideas/recommendations on using MSVC? |
|
I quickly tried with clang and this is what I get in the end. Any clues? Looks like missing symbols in an external lib, which is weird. |
Missing GC static libraries. |
@adam-urbanczyk I guess you don't have the Boehm Garbage Collector library available in your path. pacman -S mingw-w64-x86_64-gcand then try to recompile. |
|
Hm, AFAICT bdwgc is compiled as a submodule of this project via CPM. Maybe wrong configuration then?
If I understand this correctly, I need to at least build a custom OpenMP runtime and link against it. |
|
@adam-urbanczyk oh yes, I now see that in deps.cmake and they are using a local fork in exaloop/bdwgc, not the canonical source in bdwgc/bdwgc. They also have exaloop/llvm-project, that is an LLVM fork based on LLVM 20 (instruction to build it) and exaloop/openmp, a LLVM OpenMP fork with GC hooks. But at the moment I can't find how this custom version of OpenMP is imported by Codon. |
|
Is it an option to we get windows compiling without openmp at first? So the scope is smaller and the task is more likely to be done .. ever? |
|
Ya'll may have to change the PR title to '2026' soon. Really do appreciate all the work that's been going in to make this possible tho. |
|
Progress on #69. Windows work will be need lot of fix and adjustments on both C/C++ source and CMake files. Currently I use a Here is a screenshot of There's several tricks as hint you may want to know/try: Hint 1:
BELIEVE ME, I'VE TRIED.On the build failure reasons might be: cannot pass with Hint 2:
Hint 3:
Hint 4:
Hint 5:
Hint 6:
Hint 7:
Hint 8: You need to handle Hint 9: You will need to adjust a lot of source codes (like adding Others may need for many times compile to find more problems there that I cant post all. |
|
@TaiXeflar Any reason for not using the MSVC compiler? I remember getting this project to build natively on Windows with MSVC about a year ago. I was able to run it and compile with it executables, but I got tired getting all the tests passing, and the test suite was also pretty slow. |
|
@TaiXeflar wrote:
You are conflating different things:
A common misconception is that software written for Unix-like systems can be built unchanged in the MSYS2 MinGW64/UCRT64 environment. In reality, these toolchains do not provide a POSIX API; they target the native Windows API, so Unix-specific code must be adapted or replaced for the build to succeed. |
|
@MaD70 When this develop start, I and K0lb3 have already disscussed it before and we selected MSVC as our compiler. So we're really confused why here we need change the toolchain to GCC/JWasm/uasm.
Can you provide the build details? I'm using MSVC at all. |

This PR is a new attempt to make codon work on Windows (#69 )
It isn't a continuation of the (very) dated #403 .
At the moment this PR doesn't work yet, serving primarily as visible progress and for communication.
The commits marked as WIP should be removed/squashed before this draft PR becomes a real PR.
The setup I'm using is MinGW (13.2), LLVM (20.1.8), CMake (4.1.0), all installed via chocolatey.
The value of CODON_SYSTEM_LIBRARIES is currently irrelevant for Windows and the functionality might have to be adjusted slightly.
#675 might help a lot for making codon work well on Windows, as non-system shared libraries are a bit iffy on Windows, and well, actually even system ones due to some rare few breaking changes.
TODO:
[x] no compile errors
[ ] no linking errors
[ ] tests pass
[ ] lib copying works