[bug] [clang] Wrong the runtime flag for requirements
See original GitHub issueIf you use -s compiler.runtime=MT
or -s compiler.runtime=MTd
with Clang
on Windows, you will get the error:
lld-link: error: /failifmismatch: mismatch detected for 'RuntimeLibrary':
>>> src/CMakeFiles/reproduce-bugs.dir/main.cpp.obj has value MT_StaticRelease
>>> fmt.lib(format.cc.obj) has value MD_DynamicRelease
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Environment Details (include every applicable attribute)
- Operating System+version: Windows Server 2019
- Compiler+version: Clang 12.0.0 with GNU-like command-line
- Conan version: 1.39
- Python version: 3.9.6
Steps to reproduce (Include if Applicable)
I have prepared the branch with my changes.
Logs (Executed commands with output) (Include/Attach if Applicable)
lld-link: error: /failifmismatch: mismatch detected for 'RuntimeLibrary':
>>> src/CMakeFiles/reproduce-bugs.dir/main.cpp.obj has value MT_StaticRelease
>>> fmt.lib(format.cc.obj) has value MD_DynamicRelease
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
ERROR: conanfile.py (reproduce-bugs/0.0.0): Error in build() method, line 60
cmake.build()
ConanException: Error 1 while executing cmake --build D:\a\reproduce-bugs\reproduce-bugs\build -- -j2
Issue Analytics
- State:
- Created 2 years ago
- Comments:18 (10 by maintainers)
Top Results From Across the Web
Clang Compiler User's Manual
This information tells you the flag needed to enable or disable the diagnostic, either from the command line or through #pragma GCC diagnostic....
Read more >Clang linking error MacOS Big Sur | Apple Developer Forums
Hi All, I am trying to build my helloworld.cpp, but I am having problem since I updated to Big Sur. Below a verbose...
Read more >[RUNTIME][LLVM] _cc.create_shared error while run ...
it seems that /usr/bin/ld complains about relocation R_X86_64_32S against .rodata.cst16 and suggest add the -fPIC flag. is it because g++ not ...
Read more >Questions on linking with -fsanitize=address #1086 - GitHub
If the same ASAN runtime is loaded twice, does it emit Your ... [bug] [clang] Wrong the runtime flag for requirements conan-io/conan#9537.
Read more >The Best and Worst GCC Compiler Flags For Embedded
GCC and Clang have several warning flags which will enable a ... Typically, it's a very small set of changes required to fix...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @arttet
I have opened one issue to improve the Clang-runtime-flags management: https://github.com/conan-io/conan/issues/9895 I’ll keep you posted.
Hi @arttet
I just updated my open PR and it seems to be working now: https://github.com/arttet/reproduce-bugs/pull/3
I was able to dig deeper into the issue (I had to create a minimal
test.cpp
and make it run without Conan) and, finally, adding a simple-MT
to the CXXFLAGS was enough to work around the issue. I would like to open a new issue about improving the Clang runtime management because it’s true that Conan is not doing enough to handle it.