mingw-4.2 requires shared lib{gcc,stdc++} for cross-dll exceptions

Bug #195407 reported by Michael Hofmann
12
Affects Status Importance Assigned to Milestone
mingw32 (Debian)
Fix Released
Unknown
mingw32 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: mingw32

mingw32 (4.2.1.dfsg-1ubuntu1 on Hardy) compiled on Debian/Ubuntu does not include the shared versions of libgcc and libstdc++. This is necessary for cross-DLL exceptions and a regression from the packages in Gutsy (gcc 3.4), where no shared libraries were necessary for this functionality.

Related branches

Revision history for this message
Michael Hofmann (mh21) wrote :

A fixed version that works for me can be found in my ppa at http://ppa.launchpad.net/mh21/ubuntu/.

Changed in mingw32:
status: Unknown → New
Revision history for this message
Andrea Colangelo (warp10) wrote :

Subscribing ubuntu-universe-sponsors

Revision history for this message
Matthias Klose (doko) wrote :

this is based on 4.2.1, is there a 4.2.3 version available?

Revision history for this message
Michael Hofmann (mh21) wrote : Re: [Bug 195407] Re: mingw-4.2 requires shared lib{gcc, stdc++} for cross-dll exceptions

As far as I know that latest released gcc for mingw is 4.2.1
(http://sourceforge.net/project/showfiles.php?group_id=2435).

Revision history for this message
Andrea Colangelo (warp10) wrote :

Unsubscribing u-u-s, since there is no valid debdiff we can push into archives. Please, re-subscribe when a debdiff is available.

Revision history for this message
Michael Hofmann (mh21) wrote :

Could you please tell me what the problem is with the provided debdiff?

Revision history for this message
Michael Hofmann (mh21) wrote :

Resubscribing u-u-s as discussed on #ubuntu-devel.

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Could you please describe a test case such as example scripts, compilation instructions or whatever can be useful to review your debdiff? Thanks.

Changed in mingw32:
importance: Undecided → Low
Changed in mingw32:
status: Unknown → New
Changed in mingw32:
status: New → Incomplete
Revision history for this message
Michael Hofmann (mh21) wrote :

The attached tar file contains a test case:
- unpack with "tar -xzf mingw-shared-dll-testcase.tgz"
- make with "make"
- run the test cases:
  - ./main - linux test case, prints "Exception: catch me"
  - ./main.exe (uses wine) - statically linked runtime library, should print "Exception: catch me", but fails with "terminate called after throwing a..."
  - ./main-shared.exe (uses wine) - dynamically linked runtime library, prints "Exception: catch me"
  - ./main-shared2.exe (uses wine) - dynamically linked runtime and stdc++ library, prints "Exception: catch me", is a bit smaller

I'm not 100% sure that the dynamic linking to the stdc++ library (for main-shared2.exe) is done correctly in the example, because the reduction in executable size is less than what I would expect.
Nevertheless, it really is a bit smaller, depends on the stdc++ DLL and works as expected, so maybe I'm just paranoid.

James Westby (james-w)
Changed in mingw32:
status: Incomplete → Confirmed
Revision history for this message
Luca Falavigna (dktrkranz) wrote :

I get this error trying to compile your test case:

dktrkranz@utumno:~$ make
g++ -fPIC -shared library.cpp -o liblibrary.so
g++ -Wl,-rpath,. -L. -llibrary main.cpp -o main
i586-mingw32msvc-g++ -shared library.cpp -o liblibrary.dll
i586-mingw32msvc-g++ -L. -llibrary main.cpp -o main.exe
i586-mingw32msvc-g++ -shared library.cpp -shared-libgcc -o liblibrary-shared.dll
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
make: *** [liblibrary-shared.dll] Error 1
dktrkranz@utumno:~$

Changed in mingw32:
status: Confirmed → New
Revision history for this message
Iain Lane (laney) wrote :

Unsubscribing sponsors. Please resubscribe once the issues have been overcome. Thanks :)

Changed in mingw32:
status: New → Incomplete
Revision history for this message
Michael Hofmann (mh21) wrote :

Updated Makefile. Use "make unix static dynamic" if you use the updated package, and "make unix static" if you use the intrepid package (which does not provide dynamic linking to the standard library). Resubscribing sponsors.

Changed in mingw32 (Debian):
status: New → Confirmed
Benjamin Drung (bdrung)
Changed in mingw32 (Ubuntu):
status: Incomplete → New
Revision history for this message
Benjamin Drung (bdrung) wrote :

With the updated Makefile this patch works. I have updated the target distribution to lucid, updated the timestamp, and uploaded the package. Sorry for the long delay and thanks for the patch.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mingw32 - 4.2.1.dfsg-1ubuntu2

---------------
mingw32 (4.2.1.dfsg-1ubuntu2) lucid; urgency=low

  * Build shared libgcc and libstdc++ libraries (LP: #195407).
 -- Michael Hofmann <email address hidden> Sun, 03 Jan 2010 02:24:27 +0100

Changed in mingw32 (Ubuntu):
status: New → Fix Released
Revision history for this message
Michael Hofmann (mh21) wrote :

Thanks Benjamin!

Changed in mingw32 (Debian):
status: Confirmed → Fix Released
Changed in mingw32 (Debian):
status: Fix Released → Confirmed
Changed in mingw32 (Debian):
status: Confirmed → Fix Committed
Changed in mingw32 (Debian):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.