From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31291 invoked by alias); 16 Jan 2012 10:54:44 -0000 Received: (qmail 31283 invoked by uid 22791); 16 Jan 2012 10:54:43 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from wmh1.mail.saunalahti.fi (HELO wmh1.mail.saunalahti.fi) (62.142.5.133) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Jan 2012 10:54:30 +0000 Received: from [192.168.1.3] (dsl-kmibrasgw1-fec1f800-182.dhcp.inet.fi [84.248.193.182]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: kai.ruottu@wippies.com) by wmh1.mail.saunalahti.fi (Postfix) with ESMTPSA id 99CA31FC074 for ; Mon, 16 Jan 2012 12:54:28 +0200 (EET) Message-ID: <4F1401E1.4080908@wippies.com> Date: Mon, 16 Jan 2012 15:37:00 -0000 From: Kai Ruottu User-Agent: Mozilla/5.0 (Windows NT 5.0; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: freebsd gcc cross compiler creates binaries that crash when using c++ exceptions References: <4F0F2E4B.8030305@redhat.com> <4F100A13.1040104@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-01/txt/msg00101.txt.bz2 16.1.2012 11:30, Markus Henschel kirjoitti: >>> So I started to build my toolchain on the target system as a native >>> compiler with exactly the same configure switches. This also produced >>> working versions of libgcc and libstdc++. > > 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...