bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with libtool and mingw 4.4 with dwarf exceptions.


From: mefyl
Subject: Problem with libtool and mingw 4.4 with dwarf exceptions.
Date: Thu, 10 Sep 2009 18:48:26 +0200
User-agent: KMail/1.12.1 (Linux/2.6.29-gentoo-r5; KDE/4.3.1; i686; ; )

I'm facing a problem with libtool and gcc mingw 4.4 with dwarf exceptions.

I use a minimal test case with a dll defining a simple function that raises an 
exception, and a program calling the function (from the dll) and catching the 
exception.

When linking 'normally', by hand, it works fine. However, libtool uses 
-nostdlib and links the program with standard libraries manually. The 
exception becomes then impossible to catch - the try block is ignored and the 
program aborts. Note that this happens only if the exception traverses a DLL 
boundary.

| # Works fine
| g++.exe -shared file.o -o file.dll
|
| # Fails (unable to catch the exception)
| g++.exe -shared file.o -o file.dll                                    \
| -nostdlib somewhere/dllcrt2.o somewhere/crtbegin.o                    \
| -lstdc++ -lgcc_s -lgcc -lmingwex -lmsvcrt -luser32                    \
| -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lmoldname

I have no idea whether the problems comes from libtool or the compiler. Any 
clue about this problem's origin?

Here are my libtool and g++ versions. Output of libtool --config attached.

$ libtool --version
libtool (GNU libtool 1.3117 2009-09-07) 2.2.7a
$ g++.exe -v
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.4.0/configure --enable-
languages=c,ada,c++,fortran,java,objc,obj-c++ --disable-sjlj-exceptions --
enable-shared --enable-libgcj --enable-libgomp --with-dwarf2 --disable-win32-
registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --
prefix=/mingw --with-gmp=/mingw/src/gmp/root --with-mpfr=/mingw/src/mpfr/root 
--build=mingw32
Thread model: win32
gcc version 4.4.0 (GCC)
$

Thanks in advance,

-- 
mefyl  - R&D engineer at Gostai - http://www.gostai.com

Attachment: libtool-config
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]