[cmake-developers] [CMake 0013035]: Setting CMAKE_CXX_COMPILER=clang++ on Windows links to .lib files even though clang is built with/for MinGW(-w64)

Mantis Bug Tracker mantis at public.kitware.com
Sat Mar 10 07:57:03 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=13035 
====================================================================== 
Reported By:                rubenvb
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13035
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-03-10 07:57 EST
Last Modified:              2012-03-10 07:57 EST
====================================================================== 
Summary:                    Setting CMAKE_CXX_COMPILER=clang++ on Windows links
to .lib files even though clang is built with/for MinGW(-w64)
Description: 
When CMAKE_CXX_COMPILER is equal to clang++, CMake adds link flags to link with
libraries suffixed with ".lib", which does not work when the Clang used is built
for MinGW (which uses libbla.a instead of bla.lib)

Steps to Reproduce: 
Configuring the LLVM/clang build tree with

cmake ../../Source/LLVM -G"MinGW Makefiles" -DCMAKE_CXX_COMPILER=clang++

This runs fine and detects all the GNU binutils (ls, as, ar...), and uses
clang++ on PATH for the configure step.

When I run mingw32-make afterwards, on the first linked binary, it tries to link
with MSVC libraries:
m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.4/../../../../x86_64-w64-mingw32/bin/ld.exe:
cannot find -limagehlp.lib
m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.4/../../../../x86_64-w64-mingw32/bin/ld.exe:
cannot find -lpsapi.lib
m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.4/../../../../x86_64-w64-mingw32/bin/ld.exe:
cannot find -limagehlp.lib
m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.6.4/../../../../x86_64-w64-mingw32/bin/ld.exe:
cannot find -lpsapi.lib

Additional Information: 
These has to be a way to use Clang's triplet information (output when doing
"clang --version") to detect *-*-mingw* (MinGW(-w64)) vs *-*-win32 (MSVC). Or
just dump the .lib extension (which ought to work for MSVC too.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-03-10 07:57 rubenvb        New Issue                                    
======================================================================




More information about the cmake-developers mailing list