gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash with new-style exceptions on FreeBSD amd64


From: Michael Gardner
Subject: Re: Crash with new-style exceptions on FreeBSD amd64
Date: Thu, 15 Mar 2007 03:41:02 -0500

D'oh! I forgot to attach config.log, after I accidentally reloaded the
window in which I was writing the previous email and had to re-type
the whole thing. Sorry about the noise.

-Michael

On 3/15/07, Michael Gardner <address@hidden> wrote:
On 3/15/07, Richard Frith-Macdonald <address@hidden> wrote:
> Presumably you failed to use the --enable-native-objc-exceptions when
> configuring gnustep-make.
> It's hardly surprising that the wrong flags are being passed to the
> compiler and the wrong config options being set if the system was not
> configured to use native exceptions.

I compiled gnustep-make with the ports system, so I didn't actually
configure it manually. However, just now I added
--enable-native-objc-exceptions to  CONFIGURE_ARGS in gnustep-make's
Makefile, and configure promptly bailed on me:

checking whether we should use native ObjC exceptions... Abort trap
(core dumped)
no
configure: Native objective-c exceptions were requested, but the compiler
configure: doesn't support them.
configure: error: compiler doesn't support native objective-c exceptions

I've got gcc-4.1.3_20070305, also compiled from ports, and it should
definitely support native ObjC exceptions (especially since I was able
to get them to work with the command in my first email). I've attached
gnustep-make's config.log, but I found something interesting about the
failed program:

#include <stdlib.h>
#include <objc/Object.h>

int main(int argc, char **argv)
{
      Object *o=nil;
      @try
      {
              o=[Object new];
              @throw o;
      }
      @catch (id foo)
      {
              if (o!=foo)
                      return 1;
      }
      return 0;
}

I saved this as 'conftest.c' and then compiled with the same command
that configure used:

gcc41 -o conftest -O2 -pipe   -x objective-c -I.   -fgnu-runtime
-fobjc-exceptions   conftest.c -lobjc  -pthread

The program crashed, as expected. However, on a whim I renamed
'conftest.c' to 'conftest.m', recompiled, and it ran! I thought the
file extension didn't matter when the language is manually specified
with -x as above, so what could be going on here? I'm also emailing my
config.log to the FreeBSD port's maintainer, but at this point I'm not
sure whether it's an issue with gnustep-make, its FreeBSD port, or
even gcc itself. Can somebody shine some light on this?

-Michael

Attachment: config.log
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]