> -----Original Message----- > From: gcc-help-owner@xxxxxxxxxxx [mailto:gcc-help-owner@xxxxxxxxxxx] On > Behalf Of Kai Ruottu > Sent: Montag, 16. Januar 2012 11:54 > To: gcc-help@xxxxxxxxxxx > Subject: Re: freebsd gcc cross compiler creates binaries that crash > when using c++ exceptions > > 16.1.2012 11:30, Markus Henschel kirjoitti: > > > What I did so far was attaching gdb and seeing that it crashes in > > libgcc > > in __cxa_end_catch. I guess I'll have to build libgcc with debug > symbols > then. > > There has always been and most probably still is a difference between > library configures in a native and a cross build. The library > configures may do some run tests with simple apps. The native target > system of course can run the test programs the new GCC has compiled and > linked against the target startups and the standard C library. But the > cross host as default cannot run anything made for the target system, > so the configure scripts must know or guess (right) the features the > target system has! > > So generally the libgcc and libstdc++ configures should know the > features all the "supported" systems have and produce identical results > in both native and cross complile cases. Never any "run on target" > tests done in order to find out how the target system will behave! I > don't think this already being the case with not so common targets like > FreeBSD but probably Linux is so well-known and in embedded Linux > target cases the shared libgcc and libstdc++ will more often be > produced via crosscompiling than natively. NetBSD and OpenBSD may also > be embedded targets but FreeBSD, Solaris2 (and other Unices) only > system targets for which the native compile is the most common... Thanks for the info. After thinking about it I tried a different approach. Instead of using linux or mingw/msys as build system for the cross compiler I tried FreeBSD. This was quite easy because I already had my own native gcc on FreeBSD and a cross compiler for mingw32 is also available in ports. So I compiled gcc with --host=i386-unkown-freebsd7.1, --target=i386-unkown-freebsd7.1, --host=mingw32 with my native freebsd gcc in PATH. This results in a working mingw32 hosted cross compiler (at least it could successfully compile my test case).