From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,a461b4617646685c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!69.16.185.51.MISMATCH!isp-post01.iad!not-for-mail Date: Wed, 20 Oct 2010 21:25:03 -0400 From: mark User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100907 Fedora/3.0.7-1.fc12 Thunderbird/3.0.7 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: not catching exceptions References: <4cbe2cc7$0$4845$9a6e19ea@unlimited.newshosting.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4cbf96c8$0$4840$9a6e19ea@unlimited.newshosting.com> Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com NNTP-Posting-Host: 97.100.72.248 X-Complaints-To: abuse@newshosting.com Xref: g2news2.google.com comp.lang.ada:15610 Date: 2010-10-20T21:25:03-04:00 List-Id: 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.