(no subject)

Hello!

Windows 7 x64,



<br>$ g++ --version<br>g++ (MinGW-builds: [http://sourceforge.net/projects/mingwbuilds/](http://sourceforge.net/projects/mingwbuilds/)) 4.7.0<br>Copyright (C) 2012 Free Software Foundation, Inc.<br>This is free software; see the source for copying conditions. There is NO<br>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br><br>$ clang --version<br>clang version 3.2 (trunk 161402)<br>Target: x86_64-w64-mingw32<br>Thread model: posix<br>

== Sample code:



<br>#include <iostream><br>



<br>int main( int argc, char ** argv ) {<br> try {<br> throw std::exception();<br> } catch ( std::exception & e ) {<br><br> }<br> return 0;<br>}<br><br>

== build-sample.cmd:
@echo off
setlocal
set LIBPATH=
set LIBPATH=%LIBPATH% -Lc:/mingw/bin/…/lib/gcc/x86_64-w64-mingw32/4.7.0
set LIBPATH=%LIBPATH% -Lc:/mingw/bin/…/lib/gcc
set LIBPATH=%LIBPATH% -Lc:/mingw/bin/…/lib/gcc/x86_64-w64-mingw32/4.7.0/…/…/…/…/x86_64-w64-mingw32/lib/…/lib
set LIBPATH=%LIBPATH% -Lc:/mingw/bin/…/lib/gcc/x86_64-w64-mingw32/4.7.0/…/…/…/…/lib
set LIBPATH=%LIBPATH% -Lc:/mingw/bin/…/lib/gcc/x86_64-w64-mingw32/4.7.0/…/…/…/…/x86_64-w64-mingw32/lib
set LIBPATH=%LIBPATH% -Lc:/mingw/bin/…/lib/gcc/x86_64-w64-mingw32/4.7.0/…/…/…
set LIBS=
set LIBS=%LIBS% -lmingw32
set LIBS=%LIBS% -lgcc_s
set LIBS=%LIBS% -lgcc
set LIBS=%LIBS% -lmoldname
set LIBS=%LIBS% -lmingwex
set LIBS=%LIBS% -lmsvcrt
set LIBS=%LIBS% -lpthread
set LIBS=%LIBS% -ladvapi32
set LIBS=%LIBS% -lshell32
set LIBS=%LIBS% -luser32
set LIBS=%LIBS% -lkernel32
set LIBS=%LIBS% -liconv
set LIBS=%LIBS% -lmingw32
set LIBS=%LIBS% -lgcc_s
set LIBS=%LIBS% -lgcc
set LIBS=%LIBS% -lmoldname
set LIBS=%LIBS% -lmingwex
set LIBS=%LIBS% -lmsvcrt
set LIBS=%LIBS% -lstdc++
set LLVM_ROOT=%USERPROFILE%\Documents\build-system\install\llvm
set MG_ROOT=C:\MinGW
set PATH=%LLVM_ROOT%\bin;%PATH%
set PATH=%MG_ROOT%\bin;%PATH%
set INCLUDE=
set INCLUDE=%INCLUDE% -I %MG_ROOT%\x86_64-w64-mingw32\include
set INCLUDE=%INCLUDE% -I %MG_ROOT%\lib\gcc\x86_64-w64-mingw32\4.7.0\include\c++
set INCLUDE=%INCLUDE% -I %MG_ROOT%\lib\gcc\x86_64-w64-mingw32\4.7.0\include\c++\x86_64-w64-mingw32
rem set INCLUDE=%INCLUDE% -I %LLVM_ROOT%\include
del test.o

clang++ --verbose -static -fexceptions -o test.exe %LIBPATH% %INCLUDE% test.cpp %LIBS% -v

== …and its fail:



~
…Temp/test-967321.o:fake:(.text+0xd9): undefined reference to _Unwind_Resume'<br>...Temp/test-967321.o:fake:(.eh_frame+0x63): undefined reference to __gxx_personality_v0’
~

== g++ has expected result:

$ g++ -o test.exe test.cpp -lstdc++
$ .\test.exe

Is there a problem with my hands?

Vasily,

Is there a problem with my hands?

No. Keep in mind that:

1. LLVM supports only dwarf-based EH on most targets, sjlj EH is
supported on arm/darwin only (so you need to use dw2 version of
mingw32 gcc).
2. EH on windows might be broken in many cases.

I see…
Thank you!