[cfe-dev] clang on WinXP + MinGW

Jason Sachs jmsachs at gmail.com
Tue Mar 13 11:23:27 PDT 2012


On Tue, Mar 13, 2012 at 1:50 PM, Jason Sachs <jmsachs at gmail.com> wrote:
> I'm having a horrible time trying to get clang to work on Windows. I'm
> on WinXP and have installed the latest version of MinGW
> http://voxel.dl.sourceforge.net/project/mingw/Installer/mingw-get-inst/mingw-get-inst-20111118/mingw-get-inst-20111118.exe
>

Never mind, I figured out how to use -emit-llvm properly. Would be
nice if the error message for -emit-llvm said something to the effect
of "this is just supposed to be used with the compiler and the -S
flag, not the linker."

C:\tmp\llvm>clang -S -emit-llvm -I c:\appl\mingw\20111118\include test.cpp

C:\tmp\llvm>type test.s
; ModuleID = 'test.cpp'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f
2:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32

target triple = "i386-pc-mingw32"

@.str = private unnamed_addr constant [10 x i8] c"hi there\0A\00"

define i32 @main(i32 %argc, i8** %argv) nounwind {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i8**, align 4
  store i32 0, i32* %1
  store i32 %argc, i32* %2, align 4
  store i8** %argv, i8*** %3, align 4
  %4 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.st
, i32 0, i32 0))
  ret i32 0
}

declare i32 @printf(i8*, ...) nounwind



More information about the cfe-dev mailing list