Date: Mon, 17 Jan 2000 21:07:28 -0500 (EST) From: "Alexander N. Kabaev" <kabaev@mail.ru> To: "David O'Brien" <obrien@NUXI.com> Cc: current@FreeBSD.ORG Subject: Re: C++ exceptions doesn't work in shared libraries Message-ID: <XFMail.000117210728.kabaev@mail.ru> In-Reply-To: <20000117115648.C53965@relay.nuxi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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 <kabaev@mail.ru> 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 <stdio.h> 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 <stdio.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.000117210728.kabaev>