mstorsjo / llvm-mingw

An LLVM/Clang/LLD based mingw-w64 toolchain
Other
1.75k stars 176 forks source link

Support for pc-windows-msys #388

Open EngineLessCC opened 6 months ago

EngineLessCC commented 6 months ago

Current msys2/Cygwin clang are on 11.0.0/8.0.0 (very outdated) and generally unmaintained.

Atm i can get configure to work but during compile i end up with this issue during compile:

/bin/sh: line 1: ../../../bin/llvm-min-tblgen.exe: cannot execute binary file: Exec format error

Is there a way to get this repo running with msys2 (not mingw-w64)? Because I'd like/need to have clang on the msys2 runtime (LP64).

To avoid confusion.. Asking/Asked here because its the 'closest' repo on this matter given the experiences with mingw, which may have a different abi, but similar tooling.

mstorsjo commented 6 months ago

Current msys2/Cygwin clang are on 11.0.0/8.0.0 (very outdated) and generally unmaintained.

Yes, although there actually has been some recent activity on upstream LLVM from two different persons regarding Cygwin.

Atm i can get configure to work but during compile i end up with this issue during compile:

/bin/sh: line 1: ../../../bin/llvm-min-tblgen.exe: cannot execute binary file: Exec format error

Is there a way to get this repo running with msys2 (not mingw-w64)? Because I'd like/need to have clang on the msys2 runtime (LP64).

Sorry, this is kinda off topic for this particular project; this is mostly about building LLVM for targeting mingw. I guess this is mostly an upstream LLVM issue - how does one build LLVM to run on Cygwin/msys, and can LLVM generate code for that environment?

Overall, I think LLVM should support Cygwin - it should be buildable there. It should also be able to generate code for it. That target is not very actively maintained or used though so there can certainly be issues in generating code for more complex cases.

As for msys, I don’t think that’s supported. I don’t know how msys is identified in cmake - does it enable CYGWIN so that all the common Cygwin specific behaviors are picked? I don’t know. And for generating code for msys with it - I’m not sure but I think there’s no support for that. If I remember correctly, the msys2 support in gcc is also entirely a downstream patch.