-
Notifications
You must be signed in to change notification settings - Fork 88
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 (cross-)compiling for mingw64 #1810
base: master
Are you sure you want to change the base?
Conversation
That's great! Do you have a list of dependencies and a description about how the environment was set? I few like we should add this into the CI somehow. |
Revert "[cmake] windows: use non-installed binary for ctest" This reverts commit 9fc9fbc. This reverts commit 8dc9ec4. On Windows we need all the .dlls in the same path as esbmc.exe. libz3.dll is already configured by our CMake scripts to be installed there, but the following ones are still missing: - zlib1.dll -> /usr/x86_64-w64-mingw32/usr/bin/zlib1.dll - libboost_filesystem.dll -> /usr/x86_64-w64-mingw32/usr/lib/libboost_filesystem.dll - libboost_program_options.dll -> /usr/x86_64-w64-mingw32/usr/lib/libboost_program_options.dll - libbtor2parser.dll -> /usr/x86_64-w64-mingw32/usr/lib/libbtor2parser.dll - libgcc_s_seh-1.dll -> /usr/lib/gcc/x86_64-w64-mingw32/13/libgcc_s_seh-1.dll - libstdc++-6.dll -> /usr/lib/gcc/x86_64-w64-mingw32/13/libstdc++-6.dll - libwinpthread-1.dll -> /usr/x86_64-w64-mingw32/usr/bin/libwinpthread-1.dll
@rafaelsamenezes I've added a description at https://github.com/esbmc/esbmc/blob/fb/mingw/BUILDING-cross-mingw.md. Because I was using an Ubuntu-22.04 VM, unfortunately, I couldn't finish the last step, because the In case you want to give it a shot, please do. |
Well, I tried Ubuntu-24.04, and it is even less compatible than 22.04, because its x86_64-w64-mingw32 toolchain isn't built with UCRT anymore. There is no way to use the standard packages from that latest Ubuntu version. Fedora seems to have packaged a separate x86_64-w64-mingw32ucrt toolchain, but that won't help us since the Github CI doesn't provide Fedora (as far as I know). We could recompile Clang-14 (or maybe rather v13, see #1003 (comment)) with the toolchain file on Ubuntu-22.04... |
Hm, not sure what to do. IMO we should try to move forward into 24.04 since is the next LTS. It has from LLVM 14 up to 18. |
This PR contains the changes necessary for cross-compiling ESBMC from Gentoo to mingw64-11.0.0 using gcc-13.2.1 against Z3-4.13.0 (only, for now) and a mingw-build of Clang provided by @rafaelsamenezes in #1801 (comment). For reference, this is the CMake --toolchain file I used:
and this is the x86_64-w64-mingw32.cross-emu.sh: