From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 18 09:38:14 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 574C5106564A for ; Sun, 18 Jan 2009 09:38:14 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-bw0-f16.google.com (mail-bw0-f16.google.com [209.85.218.16]) by mx1.freebsd.org (Postfix) with ESMTP id A5E378FC12 for ; Sun, 18 Jan 2009 09:38:13 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by bwz9 with SMTP id 9so4989bwz.19 for ; Sun, 18 Jan 2009 01:38:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=zoLR2c98u3jYO6O3JqRa/yix93TUbvUtCk4vkSAhz/g=; b=G4+nKAGT+gs9oW2vOV340d7q9mIPqHUEy2bqy18vy51pGDlH45bkzI0D4SfKiYYF4K oqreR0kVyNIORecvig9NaeY05JInkUBr3/eCBwGWfIyKE9LAz85FVKJGC2CAV6QNs8eN /IDATjpWeQrgzmdddnW+P8NrWXIzXZSiIEWq8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=uzp1iUP0iawgWY54X9THSVx5I2b2RIDvN9t7b/IUNMvrqSoGcDYhSfW34FkgW9k5AP V4is4Lf6ErHQRzUxcSVGpJDL1ADKO1qVw7JQs42p1G+uV/NKkBz8G8NAHXcJce8vzwbI 38VA2w8RQ8GOY3101J/bUpYPtfVZSjy1jzulA= MIME-Version: 1.0 Received: by 10.181.159.17 with SMTP id l17mr1007739bko.14.1232271492243; Sun, 18 Jan 2009 01:38:12 -0800 (PST) In-Reply-To: <20090118074057.GB43496@logik.internal.network> References: <20090117231404.GB77134@logik.internal.network> <20090118074057.GB43496@logik.internal.network> Date: Sun, 18 Jan 2009 01:38:12 -0800 Message-ID: <7d6fde3d0901180138y61cf4a8bgc01fd5baa684954b@mail.gmail.com> From: Garrett Cooper To: xorquewasp@googlemail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Nate Eldredge , freebsd-hackers@freebsd.org Subject: Re: gcc 4.3.2 libgcc_s.so exception handling broken? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 09:38:14 -0000 On Sat, Jan 17, 2009 at 11:40 PM, wrote: > On 2009-01-17 23:07:29, Nate Eldredge wrote: >> I tried a simple example of this in C++ and it works as expected. (I am= on >> 7.0-RELEASE/amd64.) So it isn't completely busted, at least. >> >> Can you post an example that exhibits the problem? Ideally, something >> complete that can be compiled and is as simple as possible. If you can = do >> it with C++ rather than Ada it might be easier, so people don't have to >> install the Ada compiler. Also please mention the commands you use to >> compile, and what they output when you compile using -v, and what >> architecture you are on. > > Hello. > > You're right, the C++ example works here. I'm not sure why it didn't befo= re. > > Here's a C++ version: > > /* main.cpp */ > > #include > > extern "C" { > extern void > c_function (void (*func)(int x)); > } > > void > ext_function (int x) > { > printf ("-- ext_function %d\n", x); > throw "test_error"; > } > > int > main (void) > { > try { > c_function (&ext_function); > } catch (...) { > printf ("caught test_error\n"); > } > return 0; > } > > /* c_function.c */ > > #include > > void > c_function (void (*func)(int x)) > { > printf ("-- %s enter\n", __func__); > func (23); > printf ("-- %s exit\n", __func__); > } > > $ uname -smir > FreeBSD 6.4-RELEASE-p1 i386 GENERIC > > $ gcc43 -v > Using built-in specs. > Target: i386-portbld-freebsd6.4 > Configured with: ./..//gcc-4.3.2/configure --enable-languages=3Dc,ada --= disable-nls --with-system-zlib --with-libiconv-prefix=3D/usr/local --progra= m-suffix=3D43 --bindir=3D/usr/local/bin/gcc43 --libdir=3D/usr/local/lib/gcc= -4.3.2 --prefix=3D/usr/local --mandir=3D/usr/local/man --infodir=3D/usr/loc= al/info/gcc43 --build=3Di386-portbld-freebsd6.4 > Thread model: posix > gcc version 4.3.2 (GCC) > > $ c++ -v > Using built-in specs. > Configured with: FreeBSD/i386 system compiler > Thread model: posix > gcc version 3.4.6 [FreeBSD] 20060305 > > $ gcc43 -o c_function.o -c c_function.c -fPIC -fexceptions -g -W -Werror= -Wall -std=3Dc99 -pedantic-errors -Wno-unused-parameter > $ gcc43 -shared -Wl,-soname,c_function.so -o c_function.so c_function.o = -lc > $ c++ -o main.o -c main.cpp -fexceptions -g -W -Werror -Wall -pedantic-e= rrors -Wno-unused-parameter > $ c++ -o main-dynamic main.o c_function.so > $ c++ -o main-static main.o c_function.o > > $ ./main-static > -- c_function enter > -- ext_function 23 > caught test_error > LD_LIBRARY_PATH=3D. ./main-dynamic > -- c_function enter > -- ext_function 23 > caught test_error > > This example is problematic, however - the C++ compiler is 3.4.6 > (I'm not sure how to compile a 4.3.2 gcc with C, Ada and C++ support). I'd check the release notes between 4.2.x and 4.3.x, and see whether or not they invalidated a certain lexigraphical part of C++ that was a gray area, which could be affecting your compilation. Have you possibly discussed this very issue on the gcc lists yet? Also, what CFLAGS / CXXFLAGS / CPUTYPE are you using? Cheers, -Garrett