[cfe-dev] building LLVM/Clang on Windows 7 x64 using MinGW/MSYS

Dennis Cote DennisC at harding.ca
Wed Oct 9 16:15:47 PDT 2013


Hello,

 

I have been trying to build the SVN trunk head revision of LLVM/Clang in
order to use the latest static analyzer. I have reinstalled the latest
MinGW/MSYS with GCC 4.8.1 and updated all components. I am using the
Cmake build tools to build LLVM/Clang. I have CMake 2.8.10.2 installed.
Cmake generates build files for MSYS Makefiles.

 

When I run make everything seems to go well until it tries to link
liblibclang (at about 91% of the build I believe). This link fails with
an APPCRASH error being caught by Windows (ld.exe has stopped
working...). The problem details reported by Windows 7 are:

 

Problem signature:

  Problem Event Name:                        APPCRASH

  Application Name:                             ld.exe

  Application Version:                           0.0.0.0

  Application Timestamp:                     5222b8a9

  Fault Module Name:                          ld.exe

  Fault Module Version:                        0.0.0.0

  Fault Module Timestamp:                  5222b8a9

  Exception Code:                                  c0000005

  Exception Offset:                                00034d98

  OS Version:
6.1.7601.2.1.0.256.48

  Locale ID:                                             4105

  Additional Information 1:                  7151

  Additional Information 2:
7151a73bf833b82e616f341fb6bc2635

  Additional Information 3:                  7b98

  Additional Information 4:
7b98c89d9ec70855f86cad8f1de194c2

 

When I select "close the program" I get the following error report:

 

collect2.exe: error: ld returned 5 exit status

 

Which causes the build to fail. I have attached a copy of the verbose
output of the link command as out2.txt. 

 

This appears to be an access violation problem with ld.exe from MInGW.
Has anyone built the head of LLVM/Clang using the latest MinGW tools? Is
this a known problem with the current MinGW? Is there a work around to
get this link to succeed?

 

Since I had successfully built an older version of LLVM/Clang with and
older version of MinGW (4.7.2 if my memory is correct), I tried to build
the last release version, release 3.3, of LLVM/Clang using the same
MinGW 4.8.1 and Cmake. This time I get a compiler error attached as
error.txt while building clangBasic.

 

The name _stat64i32 is defined in the file stat.h included from
MinGW/include/sys/stat.h. It looks like FileManager.h is declaring these
functions before stat.h is included, and then FileManager.cpp is
defining them after stat.h is included which causes the stat type to be
replaced by _stat64i32 by macro definitions. I don't see how this is
supposed to work. Again is this a known problem with release 3.3 and
MInGW? 

 

I noticed that the signature of this function has been changed in head
revision to use a type FileData instead of the struct stat directly, so
perhaps this problem has been addressed already. 

 

Any insight anyone can provide will be greatly appreciated. 

 

Thanks.

 

--

Dennis Cote

Harding Instruments

780-462-7100 x34

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131009/a2a379b1/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: out2.txt
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131009/a2a379b1/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: error.txt
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131009/a2a379b1/attachment-0001.txt>


More information about the cfe-dev mailing list