erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.14k stars 2.92k forks source link

Use llvm-mingw or clang-cl to compile Erlang for Windows 64 #5634

Open fire opened 2 years ago

fire commented 2 years ago

Is your feature request related to a problem? Please describe. I want to compile Erlang for Windows on a Linux machine.

Describe alternatives you've considered There is currently no way to compile Erlang for Windows on Linux.

Additional context I think it is possible to use llvm-mingw or clang-cl on Fedora Linux to compile Erlang.

Has anyone tried?

LINKFLAGS='-Wl,-pdb=' CCFLAGS='-g -gcodeview' allow generating pdbs for the dlls with mingw-llvm

garazdawi commented 2 years ago

I did some experimentation a couple of years ago and the problem then was that there was no simple way to get access to the headers and dll's needed to compile Erlang/OTP. It would be great if we could cross compile from linux to Winwdows, so if anyone wants to explore this that would be awesome!

fire commented 2 years ago

Are you able to provide support? Can I can contact you in an interactive channel?

garazdawi commented 2 years ago

Are you able to provide support?

I'll try to answer any questions that you may have in this issue. I don't know anything about how to cross-compile to windows, but I do know quite a bit about how the Erlang/OTP cross-compile support works.

One large problem I think will be to cross-compile crypto (and wxwidgets if you want that).

fire commented 2 years ago

Gathering the WSL1 steps to compile Erlang from desktop for a future date.

Reference

https://github.com/elixir-desktop/deployment

fire commented 2 years ago

Can reference this https://github.com/diodechain/otp/blob/diode/beta/.github/workflows/main.yaml for an otp build.

max-au commented 2 years ago

I wonder if there is a chance of swapping back from WSL1 to something that works in Docker for Windows. It would allow me to easily add Windows support for CI/CD for OTP. Have you tried recovering MSYS2? http://erlang.org/documentation/doc-11.0-rc3/doc/installation_guide/INSTALL-WIN32.html