From owner-freebsd-current Mon Jan 17 18: 7:48 2000 Delivered-To: freebsd-current@freebsd.org Received: from mx3.mail.ru (mx3.mail.ru [194.67.23.37]) by hub.freebsd.org (Postfix) with ESMTP id D0B381513D for ; Mon, 17 Jan 2000 18:07:40 -0800 (PST) (envelope-from kabaev@mail.ru) Received: from h0050da20495b.ne.mediaone.net ([24.147.104.88] helo=kan.ne.mediaone.net) by mx3.mail.ru with esmtp (Exim 3.02 #114) id 12AO2z-000MuJ-00; Tue, 18 Jan 2000 05:07:06 +0300 Received: (from kan@localhost) by kan.ne.mediaone.net (8.9.3/8.9.3) id VAA00845; Mon, 17 Jan 2000 21:07:28 -0500 (EST) (envelope-from kan) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20000117115648.C53965@relay.nuxi.com> Date: Mon, 17 Jan 2000 21:07:28 -0500 (EST) From: "Alexander N. Kabaev" To: "David O'Brien" Subject: Re: C++ exceptions doesn't work in shared libraries Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Why doesn't OpenBSD, Linux, or Solaris x86 need this patch? I tried to compile and run attached program on dual-processor Compaq Proliant server running RedHat Linux 6.1 at Compaq testdrive site (thanks, Compaq!) and guess what? Compiled with -fsjlj-exceptions Linux bails out with "Not enough memory" error message. Compiled without -fsjlj-exceptions, it dumps core. It _could_ use some patches after all :) I would really appreciate if people having access to the OpenBSD/i386 Solaris/x86 boxes will try the following program on these boxes and share results with us. I will be greatly surprised if OpenBSD will survive the test since their egcs looks like stock egcs 1.1.2 version which has not been heavily patched from original Cygnus version. ---------------------------------- E-Mail: Alexander N. Kabaev Date: 17-Jan-00 Time: 20:30:14 ---------------------------------- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # Makefile # foo.cc # main.cc # echo x - Makefile sed 's/^X//' >Makefile << 'END-of-Makefile' XCXX=g++ XLD=ld XCXXFLAGS=-g -fpic -fexceptions X Xall: arf X Xarf: main.o foo.so X ${CXX} -o arf main.o foo.so X X Xfoo.so: foo.o X ${LD} -Bshareable -o foo.so foo.o X Xclean: X rm -f arf *.o *.so END-of-Makefile echo x - foo.cc sed 's/^X//' >foo.cc << 'END-of-foo.cc' X#include X Xint Foo (); X Xint Baz () X{ X char *msg = "Bax thowing..."; X printf ("in baz\n"); X throw msg; X printf ("baz should not be here.\n"); X} X X Xint Foo () X{ X try { X Baz (); X } catch (char *msg) { X printf ("foo caught %s\n", msg); X } X} END-of-foo.cc echo x - main.cc sed 's/^X//' >main.cc << 'END-of-main.cc' X#include X Xint Foo (); X Xint Xmain () X{ X try { X printf ("calling foo\n"); X Foo (); X printf ("returned from foo\n"); X } catch (char *msg) { X printf ("exception from foo: %s\n", msg); X } catch (...) { X printf ("unknown exception\n"); X } X} END-of-main.cc exit To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message