Fail when building llvm2.9 using MinGW64

I was building llvm2.9 using MinGW64 on windows, msys was 32 bit so I specified --host option for a cross compiling. Following are my configure options:

…/llvm2.9/configure --prefix=/home/AutoESL/llvm-obj

The error:

make[1]: Entering directory /home/AutoESL/llvm-obj/lib/VMCore' make[1]: *** No rule to make target /usr/home/AutoESL/llvm-obj/BuildTools/Debug/bin/tblgen.exe’, needed by /usr/home/AutoESL/llvm-obj/lib/VMCore/Debug/Intrinsics.gen.tmp'. make[1]: Target all’ not remade because of errors.
make[1]: Target all' not remade because of errors. make[1]: Nothing to be done for all’.
make[1]: Leaving directory `/home/AutoESL/llvm-obj/lib/VMCore’
make: *** [all] Error 1

The gcc version:
AutoESL@autoesl-06eb92d ~/llvm-obj
$ gcc -v
Using built-in specs.
Target: x86_64-w64-mingw32
Configured with: …/…/src/gcc-4.5.2/configure --build=x86_64-w64-mingw32 --enab
le-targets=all --enable-languages=c,c++,fortran,objc,obj-c++ --enable-libgomp –
enable-lto --enable-libstdcxx-debug --enable-version-specific-runtime-libs --ena
ble-fully-dynamic-string --with-gnu-ld --disable-werror --disable-nls --disable-
win32-registry --prefix=/mingw64tdm --with-local-prefix=/mingw64tdm --with-pkgve
rsion=tdm64-1 --with-bugurl=
Thread model: win32
gcc version 4.5.2 (tdm64-1)

Any idea?



../llvm2.9/configure --prefix=/home/AutoESL/llvm-obj

Please try with "--build=x86_64-w64-mingw32", not "--host".

If you would still have any troubles, make sure your
x86_64-w64-g++.exe can generate correct PE+ executable.

And, please post your environments as below (could be gzip-ed if they
would be bigger);

  - config.log
  - Makefile.config
  - the log of "make VERBOSE=1"

Please note, Windows x64 support on llvm-(at least 2.9) would be immature.
Feel free to ask us (on the list) if you got any troubles.

Thank you, ...Takumi

Thanks for the response!

I have tried using --build, the build failed and windows reported tblgen execution error, see attachment.
I am not sure what you mean by PE+ executable, is that 64 bit executable? On my 64 bit PC, the g++ works well and a simple 64bit hello-world can run.


2011/5/16 NAKAMURA Takumi <>

error.log.tar.gz (94.9 KB)

Chen, see


ps. Excuse me, PE+ (aka pep) means "Executable file format for WIndows x64".

I can successfully build llvm 2.9 with MinGW64 now, by adding "LDFLAGS=-Wl,--stack,16777216" to configuration. LLVM “getting started” has the following tip but I was not aware of it.

  1. To compile SPU backend, you need to add "LDFLAGS=-Wl,--stack,16777216" to configure.

Thanks for your help, Takumi !

在 2011年5月16日 下午5:46,NAKAMURA Takumi <>写道: