-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Using non-MinGW Clang to build for MinGW ABI #8072
Comments
@mati865 might know I'm not sure if this is possible... |
Have a look at my CMake toolchain file for MinGW ABI cross-compilation for Archlinux, you might find some ideas to fix yours (https://github.com/Amphaal/rpgrpz/blob/master/cmake/toolchains/windows-ci.cmake) I've noticed that |
There should be no Is libc++abi coming from official LLVM installer or MSYS2 package? To be compatible with GCC ABI you will have to pass |
Thanks so much everyone! @Amphaal’s toolchain file got me in the right direction – I think the trick was simply to use a toolchain file instead of specifying the options on the command line, because toolchain options are also passed through to try_compile(). Here’s the full toolchain file I ended up with: Note that the sysroot path has to be a Windows-style path |
This is not strictly an issue with MinGW packages, but related – please let me know if there’s a better place to post this question. Thanks!
I am trying to use the non-MinGW Windows Clang/LLVM release (e.g. installed via
choco install llvm
) to build a CMake project for the MinGW ABI (e.g. target triplex86_64-w64-mingw64
), and am looking for a list of required CMake options to match the MinGW Clang package (which is built with a number of patches) as closely as possible.So far I’m using:
Unfortunately this does not seem to be sufficient for a certain
try_compile()
in my CMake project, even though I’m manually forwarding the above options totry_compile()
using theCMAKE_FLAGS
option, as I’m getting a number of linker errors outlined in gnustep/libobjc2#190 (comment).Are there any options I’m missing, or is there maybe a CMake toolchain file somewhere I could use for this purpose?
The goal of this is to be able to build and debug LLVM/Clang using Visual Studio in order to add support for targeting MinGW in the Objective-C runtime support in Clang (gnustep/libobjc2#190). I tried building LLVM in Visual Studio after applying the MinGW patches, but this lead to various issues including Clang crashing for some compilations (maybe because of differences between MSVC and GCC, which I gather is used for building the MinGW Clang package?).
Any help would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered: