discuss-gnustep
[Top][All Lists]
Advanced

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

Re: GUI test with -fobjc-arc yields ABI Error


From: Patryk Laurent
Subject: Re: GUI test with -fobjc-arc yields ABI Error
Date: Sat, 28 Dec 2013 16:54:07 +0000 (GMT)

Excellent.  So, now I build GNUStep make using:

cd ~/core/make
./configure --enable-debug-by-default --with-layout=gnustep --enable-objc-nonfragile-abi

And success: The result is that my guitest.m code runs fine when compiled with -fobjc-arc!  I've updated the wiki to include this flag (http://wiki.gnustep.org/index.php/GNUstep_under_Ubuntu_Linux)

Interestingly, however, now when compiling guitest.m I get the warning: "argument unused during compilation: '-fobjc-nonfragile-abi'".  So does this mean that the --enable-objc-nonfragile-abi was important for building GNUStep itself, but is not so necessary afterwards?

Thanks,
Patryk

On Dec 28, 2013, at 02:27 AM, David Chisnall <theraven@sucs.org> wrote:

On 27 Dec 2013, at 23:15, Patryk Laurent <plaurent@me.com> wrote:

David,
I had already specified -fobjc-runtime=gnustep-1.7 when I got the ABI Error. (See below)

I mean you'll need to specify it for everything. If you look at how the FreeBSD GNUstep ports are set up, they pass the correct arguments to the various configure things to make this Just Work™. It sounds like you didn't specify it for base / gui. The easiest thing to do is make -make add the flag for you.

(If I try -fobjc-nonfragile-abi I get: clang-3.5: warning: argument unused during compilation: '-fobjc-nonfragile-abi')

Yes, if you also specify -fobjc-runtime then it's redundant.

David

Thanks,
Patryk
On Dec 27, 2013, at 01:11 PM, David Chisnall <theraven@sucs.org> wrote:
If you want to use ARC, then you must use the new ABI. Either specify -fobjc-runtime=gnustep-1.7, or -fobjc-nonfragile-abi.
David
On 27 Dec 2013, at 20:04, Patryk Laurent <plaurent@me.com> wrote:
David,
Another oddity that maybe will help diagnose the issue: If I compile a GUI test program without -fobjc-arc, everything works fine. However, if I include -fobjc-arc, compilation is successful but running is not, see below:
patryk@paklbox:~$ clang `gnustep-config --objc-flags` `gnustep-config --objc-libs` -fobjc-runtime=gnustep-1.7 -fblocks -fobjc-arc -lobjc -ldispatch -lgnustep-base -lgnustep-gui guitest.m
patryk@paklbox:~$ ./a.out
Objective-C ABI Error: Loading modules from incompatible ABIs while loading ./GSBackend.m
a.out: /home/patryk/libobjc2/loader.c:53: void __objc_exec_class(struct objc_module_abi_8 *): Assertion `objc_check_abi_version(module)' failed.
Aborted (core dumped)
(This is under Ubuntu 13.10 Desktop, following the instructions here: http://wiki.gnustep.org/index.php/GNUstep_under_Ubuntu_Linux)
Patryk
Here is the source to guitest.m:
patryk@paklbox:~$ cat guitest.m
#import <AppKit/AppKit.h>
int main()
{
NSApplication *app; // Without these 2 lines, seg fault may occur
app = [NSApplication sharedApplication];
NSAlert * alert = [[NSAlert alloc] init];
[alert setMessageText:@"Hello alert"];
[alert addButtonWithTitle:@"All done"];
[alert runModal];
}
Compiling it without -fobjc-arc works fine:
patryk@paklbox:~$ clang `gnustep-config --objc-flags` `gnustep-config --objc-libs` -fobjc-runtime=gnustep-1.7 -fblocks -lobjc -ldispatch -lgnustep-base -lgnustep-gui guitest.m # NSAlert test works fine without -fobjc-arc.
-- Sent from my Difference Engine


-- Sent from my Cray X1


reply via email to

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