I found this, which seems to offer a different (incompatible) way of doing exceptions.
http://www.geocities.com/SiliconValley/Monitor/7464/libFoundation/doc/libFou...
Ugh...
You must call +[NSProcessInfo initializeWithArguments:count:environment:] in main()
I tested removing the NSAutoreleasePool stuff to see if that was what was causing it, but it made no difference.
I'm guessing that this is a non-Darwin Foundationism, as that's not needed (or defined, for that matter) on Darwin. I don't think that really has anything to do with "my" code; it seems like you'd always need to do it.
See: http://gnustep.org/resources/documentation/Developer/Base/Reference/NSProces...
Well, it says "if none of the system-specific hacks to auto-initialize it are working", which seems to suggest that it's not needed quite always, but it doesn't say what those hacks are or how they work...
Anyway, this is as you say nothing related to the pike glue per se, it's just something you have to deal with when linking with libFoundation.
Adding the call to main gets me a little further:
WARNING(+[NSBundle _resourcesSearchPathes]): nested call to function! (probably some libFoundation setup issue) WARNING(+[NSBundle _resourcesSearchPathes]): nested call to function! (probably some libFoundation setup issue) Segmentation fault (core dumped)
So here are the famed bundles. :-) Apparently libFoundation again needs some extra setup...
The best way forward is probably trying to figure out the correct way to support exceptions together with libFoundation so that I can get down to just one libobjc... ;-)
Yeah, I think that URL above describes it, using -fobjc-exceptions is the way to enable it on darwin, it's possible that gnu gcc works similarly, but probably depends on support in libobjc.
-fobjc-exceptions is already specified, and removing it doesn't seem to make any difference in what symbols are referenced. Exceptions (using @throw) are working fine when compiling a non-Foundation program with -fobjc-exceptions -lobjc.
It's probably best to get some configure support for selecting the runtime and foundation framework. Then we can add some conditionals.
First we need to understand what options are needed to get something that works, then we can teach configure about it. :-)
Isn't objective-c grand??? :O
Needs some ISO standardization methinks...