From: mark <mark@none.com>
Subject: Re: not catching exceptions
Date: Wed, 20 Oct 2010 21:25:03 -0400
Date: 2010-10-20T21:25:03-04:00 [thread overview]
Message-ID: <4cbf96c8$0$4840$9a6e19ea@unlimited.newshosting.com> (raw)
In-Reply-To: <bb6f30ac-e433-4ef2-9ffa-352e60a17daa@l8g2000yql.googlegroups.com>
Thanks for the reply. I did not realize this is a gcc overall question.
I'll post there. Before I do, I'll create a C++ program to make sure
I get the same result.
I looked at the link you gave and tried rebuilding the cross compiler
with -enable-sjlj-exceptions. Unfortunately, on the target (uclibc) I get
# ./testit
./testit: can't resolve symbol '_Unwind_SjLj_Register' in lib './testit.
I have to leave the target environment alone. My application is not the
only one that runs in it (although it is the only Ada one). So, I can't
really modify uclibc.
On 10/20/2010 04:11 AM, Ludovic Brenta wrote:
> mark wrote on comp.lang.ada:
>> I'm targeting some Ada95 at three different systems. One is a host
>> system running Linux, Intel based. Exceptions are caught just fine.
>> Another is a bare board with a PowerPC running Linux. Exceptions are
>> also trapped fine. The third is a system running Linux but instead of
>> using glibc it uses uclibc. Exceptions are not caught. All I get is an
>> abort message (abort). The configure information for this one is below-
>>
>> $ ./powerpc-mpc8248-linux-uclibc-gcc -v
>> Using built-in specs.
>> Target: powerpc-mpc8248-linux-uclibc
>> Configured with: ../../configure --prefix=/opt/atc/cpp_userchain
>> /ppc8248-linux-toolchain --target=powerpc-mpc8248-linux-uclibc
>> --with-cpu=603 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu
>> --with-sysroot=/opt/atc/cpp_userchain/ppc8248-linux-toolchain/sysroot
>> --enable-shared --enable-threads=gnat --disable-tls
>> --disable__cxa_atexit --enable-languages=c,ada
>> Thread model: gnat
>> gcc version 4.1.2
>>
>> I've tried this with both --enable-threads (POSIX model) and
>> enable-threads=gnat. I've tried with --enable__cxa_atexit and
>> --disable__cxa_atexit. I can't seem to catch exceptions.
>>
>> A simple test program where I just raise and catch an exception gives
>> the same result...abort. Outside of not being able to catch exceptions,
>> everything else works great (tasking, protected types, etc).
>>
>> Any thoughts on why exceptions are not being trapped on the would be
>> appreciated.
>>
>> Thanks.
>
> I found this which may help:
>
> http://gcc.gnu.org/ml/gcc/2007-07/msg00290.html
>
> IIUC, you can enable exceptions on uClibc either by configuring the
> cross-compiler to use the setjump/longjump (SJLJ) mechanism or by
> patching uClibc to support zero-cost exceptions (ZCX). It is possible
> that a newer version of uClibc is available that handles ZCX, possibly
> with some configuration.
>
> If you have more trouble, I suggest you ask on the GCC mailing list as
> your question is quite technical and not specific to Ada (exceptions
> are handled by the GCC back-end which is common to all languages).
>
> --
> Ludovic Brenta.
prev parent reply other threads:[~2010-10-21 1:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-19 23:40 not catching exceptions mark
2010-10-20 8:11 ` Ludovic Brenta
2010-10-21 1:25 ` mark [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox