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
Compiler detection is incorrect for native LLVM/Clang install on Windows #2560
Comments
Native Clang on Windows can target both MSVC and mingw-w64 (I think they started out targeting MinGW, then added support for MSVC, and now MSVC is the default). Clang also supplies clang-cl, a cli that is compatible with MSVC cl.exe. I've had some issues getting both options to work with CMake on AppVeyor (see for instance the squash AppVeyor script). So I would love if meson were able to support both. |
Yes. Support for this would be great. Preferably with an option to choose either the GNU compatible (clang/clang++) or the msvc adapter (clang-cl). |
Ping? |
That only really works for pull requests, not issues. See also, "help wanted" label. ;) We'd be happy to review a PR that fixes this and adds a test for it so we can properly support GNU clang (easy) and clang-cl (harder). |
fwiw, on windows it looks like both "clang" and "clang++" always compile using the msvc abi, the difference is in how they parse arguments and how good they are at figuring out how to link the C library. You can see this by taking the following program namespace test {
void testfunction(int t) {
}
}
int main(int argc, char** argv) {
test::testfunction(4);
} and compiling it with if you compile with |
note that it's likely that if you configure/build clang with gcc on windows or with gcc on unix targeting windows then you'll get a clang.exe that defaults to x86_64-pc-windows-gnu! |
AND if you have visual studio installed you may have a version of clang that's neither of these and that is the clang parser with C2 (microsoft's backend) output!!!! For all intents this should be similar to clang with x86_64-pc-windows-msvc |
@jon-turney, is this closable now? |
Not yet fixed. Possibly a duplicate of #4232, though. |
ClangCompiler.get_soname_args
assumes that Clang on Windows is running under MINGW. It then tries to generate-Wl,-soname
options, which are incompatible with Clang 5.0.0.0 running natively on Windows.CompilerArgs.to_native
adds groups via-Wl,--start-group
and-Wl,--end-group
(asget_compiler_uses_gnuld
returnstrue
for Clang on Windows).CCompiler.gen_import_library_args
adds the-Wl,--out-implib
option.CCompiler.build_rpath_args
adds the-Wl,-rpath
option.Related options
-Wl,--as-needed
and-Wl,--no-undefined
aren't supported either, but they can be disabled via theb_asneeded
andb_lundef
flags, respectively.The text was updated successfully, but these errors were encountered: