Re: Native ObjC exception problem.

Sašo Kiselkov <[email protected]>
Newsgroups gmane.comp.lib.gnustep.user
Message-ID <[email protected]>
Quoting "Mehul N. Sanghvi" <[email protected]>:

> Saso,
>
>     According to http://gcc.gnu.org/gcc-3.4/changes.html#3.4.4
>
> The Objective-C front end has been updated to include the numerous bug
> fixes and enhancements previously available only in Apple's version of
> GCC. These include:
>
>      * Structured exception (@try... @catch... @finally, @throw) and
> synchronization (@synchronized) support. These are accessible via the
> -fobjc-exceptions switch; as of this writing, they may only be used in
> conjunction with -fnext-runtime on Mac OS X 10.3 and later. See Options
> Controlling Objective-C Dialect for more information.
>
>
>     1.  Is the makefile passing the -fobjc-exceptions and -fnext-runtime
>         switches to gcc ?
>
>     2.  Are you on MacOSX 10.3 or above ?  (This is a no, based on your
>         the fact that you are using Debian).
>
>
> That's about the end of my knowledge for Objective-C.  I know you are
> using 4.0.1, but when looking at the changes for 4.0.1 there was no
> mention of any more improvements to @try or if you could use it on
> non-MacOSX systems.  Neither is there a mention of it in 4.1, so you'd
> be wasting time trying to build it :)
>
> Hope this helps.
>
>
> cheers,
>
>       mehul
>
>
>
> --
> Mehul N. Sanghvi
> email: [email protected]
>

Thanks for your suggestions, but I've resolved the issue (or found a work-around
for now, to be more precise) thanks to pinskia (libobjc developer). The GNU
libobjc does include exception handling support (though I don't know about
@synchronized - haven't tested yet) and it in fact works. However, the problem
is when you specify "-O2" to gcc - due to a bug it generates incorrect
references (or roughly so much I understood), so it results in a linking error.
The work-around is either not to use -O2 (e.g. do "make debug=yes") or by
specifying the "-fno-unit-at-a-time" option to gcc when compiling.

---
Saso
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.