Hi Tanya,
I have tried the 2.6 pre-release on the following host :
Windows XP pro SP2 with mingw/msys :
uname -a
MINGW32_NT-5.1 OLIVE 1.0.10(0.46/3/2) 2004-03-15 07:17 i686 unknown
gcc -v
Reading specs from d:/mingw/bin/…/lib/gcc/mingw32/3.4.5/specs
Configured with: …/gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw special)
- srcDir != objDir
- The build went fine. (configure and make)
- llvm make check : not possible under mingw (dejagnu…)
- clang make check fails :
Every call to clang binary ends like this :
./Release/bin/clang foo.c
Stack dump:
0. Program arguments: d:/llvm/llvm-2.6/build/Release/bin/clang-cc.exe -triple i386-pc-mingw32 -S -disable-free -main-file-name foo.c --relocation-model static --disable-fp-elim --unwind-tables=0 --mcpu=pentium4 --fmath-errno=1 -fdiagnostics-show-option -o C:/Temp/cc-000000.s -x c foo.c
77C42A16 (0x0022F958 0x0167C757 0x0022F988 0x0167CBE8), wscanf()+1872 bytes(s)
77C3F962 (0x0022F9B0 0x0167C757 0x0167CBE8 0xFFFFFFFF), sprintf()+0049 bytes(s)
0046DA0C (0x10202000 0x20101010 0x20202020 0x60404020)
01AED7D4 (0x015B9F80 0x015B8590 0x015B9070 0x0081BC20)
01107940 (0x95340800 0x24048901 0x71ECFBE8 0x0CC483FF)
C7102444 (0x00000000 0x00000000 0x00000000 0x00000000)
clang: error: compiler command failed due to signal 1073741819 (use -v to see invocation)
A debug build fails on the same problem :
./Debug/bin/clang foo.c
Stack dump:
0. Program arguments: d:/llvm/llvm-2.6/build_debug/Debug/bin/clang-cc.exe -triple i386-pc-mingw32 -S -disable-free -main-file-name foo.c --relocation-model static --disable-fp-elim --unwind-tables=0 --mcpu=pentium4 --fmath-errno=1 -fdiagnostics-show-option -o C:/Temp/cc-000000.s -x c foo.c
77C42A16 (0x0022F948 0x01354530 0x0022F978 0x121CC7A8), wscanf()+1872 bytes(s)
77C3F962 (0x0022F9A0 0x01354530 0x013548FD 0xFFFFFFFF), sprintf()+0049 bytes(s)
0043EC6D (0x013548FD 0x00000040 0x01354896 0x00000001)
0043F2C5 (0x003D4068 0x121CC1F4 0x0022FAD0 0x01354BC9)
0043F90C (0x121CC1F0 0x0022FB20 0x0022FD00 0x003D4068)
010C2752 (0x0022FC50 0x0022FE10 0x0022FD00 0x003D4068)
00406086 (0x00000013 0x003D3F90 0x003D3028 0x015CF000)
0040124B (0x00000001 0x00000009 0x0022FFF0 0x7C816FE7)
00401298 (0x002420A8 0x0022F1E8 0x7FFD7000 0xC0000005)
7C816FE7 (0x00401280 0x00000000 0x78746341 0x00000020), RegisterWaitForInputIdle()+0073 bytes(s)
clang: error: compiler command failed due to signal 1073741819 (use -v to see invocation)
Here is the stack trace, I try to re-build :
___mingw_CRTStartup
_main
(anonymous namespace)::DriverPreprocessorFactory::CreatePreprocessor()
clang::InitializePreprocessor(clang::Preprocessor&, clang::PreprocessorInitOptions const&)
clang::InitializePredefinedMacros(clang::TargetInfo const&, clang::LangOptions const&, std::vector<char, std::allocator >&)
clang::DefineTypeSize(char const*, unsigned int, char const*, bool, std::vector<char, std::allocator >&)
_sprintf
The “faulty” call to DefineTypeSize is the 5th. The one which used a “long long” type.
In the method DefineTypeSize, the call to sprintf is as follow :
sprintf(MacroBuf, “%s=%llu%s”, MacroName, MaxVal, ValSuffix);
and should be transformed to :
sprintf(MacroBuf, “%s=%I64u%s”, MacroName, MaxVal, ValSuffix);
as mingw toolchain don’t support “%llu” marker.
With this correction, clang seems to work on this platform.
I wanted to provide a patch but I’m not able to find something like “LLVM_ON_MINGW” macro definition. Sorry. 
.
Thanks for your work !
Cheers,
Olivier.