Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Exception support
@ 2006-08-28 22:41 Thomas Moschny
  2006-08-30 22:23 ` Ed Swierk
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Moschny @ 2006-08-28 22:41 UTC (permalink / raw)
  To: buildroot

Hi,

is there a way to get a toolchain built for i686, that supports C++ 
exceptions?

In a buildroot naively build using gcc 4.1.0 or 4.1.1 and uclibc 0.9.28, C++ 
exceptions don't work. Apps instead abort with "terminate called after 
throwing an instance of foo" when an exception of type foo is thrown.

I found this thread: 
http://www.nabble.com/gcc-4.1.1-and-exception-handling-(libstdc++)-t2084671.html
but the quintessence remains unclear to me.

Thanks,
Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] Exception support
  2006-08-28 22:41 [Buildroot] Exception support Thomas Moschny
@ 2006-08-30 22:23 ` Ed Swierk
  2006-08-31  7:05   ` Thomas Moschny
  0 siblings, 1 reply; 3+ messages in thread
From: Ed Swierk @ 2006-08-30 22:23 UTC (permalink / raw)
  To: buildroot

On 8/28/06, Thomas Moschny <thomas.moschny@gmx.de> wrote:
> is there a way to get a toolchain built for i686, that supports C++
> exceptions?
>
> In a buildroot naively build using gcc 4.1.0 or 4.1.1 and uclibc 0.9.28, C++
> exceptions don't work. Apps instead abort with "terminate called after
> throwing an instance of foo" when an exception of type foo is thrown.

I've got C++ exceptions working with gcc 4.1.1 by enabling
BR2_GCC_USE_SJLJ_EXCEPTIONS in my buildroot configuration, and
changing --disable-__cxa_atexit to --enable-__cxa_atexit in
gcc-uclibc-3.x.mk. The former forces gcc to implement exceptions with
setjmp/longjmp rather than the more efficient stack unwinding, while
the latter enables code ensuring that static objects are cleaned up
properly on exit.

Apparently it is even possible to get stack unwinding to work, but I
have not tried it myself. See the thread beginning at
http://uclibc.org/lists/uclibc/2006-August/016090.html .

--Ed

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] Exception support
  2006-08-30 22:23 ` Ed Swierk
@ 2006-08-31  7:05   ` Thomas Moschny
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Moschny @ 2006-08-31  7:05 UTC (permalink / raw)
  To: buildroot

ON Thursday 31 August 2006 00:23 Ed Swierk wrote:
> On 8/28/06, Thomas Moschny <thomas.moschny@gmx.de> wrote:
> > is there a way to get a toolchain built for i686, that supports C++
> > exceptions?
>
> I've got C++ exceptions working with gcc 4.1.1 by enabling
> BR2_GCC_USE_SJLJ_EXCEPTIONS in my buildroot configuration,

This seems to work. Btw, it took me a while to find out what 'sjlj' stands 
for :)

> and changing --disable-__cxa_atexit to --enable-__cxa_atexit in
> gcc-uclibc-3.x.mk.

I tried setting --enable-__cxa_atexit as an extra gcc option, but got an 
undefined reference afterwards.

> Apparently it is even possible to get stack unwinding to work, but I
> have not tried it myself. See the thread beginning at
> http://uclibc.org/lists/uclibc/2006-August/016090.html .

I know this thread, but it is unclear to me how to force usage of stack 
unwinding. unwind-dw2-fde.o seems not to work (that's why I started this 
thread). Now, if I edit toolchain/gcc/4.1.1/100-uclibc-conf.patch to not 
change LIB2ADDEH, then unwind-dw2-fde-glibc.o is built (and would be used), 
but it contains an undefined reference to dl_iterate_phdr.

Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-31  7:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-28 22:41 [Buildroot] Exception support Thomas Moschny
2006-08-30 22:23 ` Ed Swierk
2006-08-31  7:05   ` Thomas Moschny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox