gnustep-dev
[Top][All Lists]
Advanced

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

Re: undefined reference to __gnustep_objcxx_personality_v0


From: David Chisnall
Subject: Re: undefined reference to __gnustep_objcxx_personality_v0
Date: Sun, 27 Dec 2015 22:29:31 +0100

> On 27 Dec 2015, at 21:17, Dmitry Moskalchuk <address@hidden> wrote:
> 
> On 27/12/15 22:21, David Chisnall wrote:
>> I managed to get a development environment set up in qemu.  All of the 
>> ARM-specific codepaths now work correctly:
>> 
>> - Message sending works
>> - Blocks as IMPs work
>> - C++ exceptions work.
>> 
>> The property introspection test was failing, because char is unsigned char 
>> and not signed char on ARM Linux.  That’s also now fixed.
>> 
>> Interestingly, the ManyManySelectors test fails on ARM Linux, because it 
>> maps things below the 128KB line and so the selector code thinks that some 
>> pointer values are valid selector IDs.  This won’t be a problem if you don’t 
>> register more than 2^16 selectors (not an issue for most code - we shipped 
>> with a bug where message sending was broken with more than this many 
>> selectors for years and only one program so far has triggered it).  It’s 
>> probably fixable by ignoring the top bit in the sel id for lookup (it’s 
>> already ignored for the asm paths) and using it to distinguish the values.  
>> I’ll think about this, as it’s a bit complex on big-endian systems.
> 
> Thank you, David! I've built libobjc2 with your latest commits for
> Android and it doesn't crash on objc_msgSend() anymore. However, there
> is still something wrong - even though simple test [1] doesn't crash
> anymore, call of objc_msgSend() seems to be noop. As you can see, it's
> pretty simple - it calls method where global variable assigned some
> predefined value, and then it check if that global variable really was set.
> 
> I have running this test in debugger (gdbserver on Android plus gdb on
> host machine) and was able to set break point and go through
> instructions step by step. As far as I see, it calls slowMsgLookup, but
> seems it don't find anything (not sure yet, just because I'm not too
> familiar with ARM assembler)...
> 
> The same test works just fine if being built for x86 with the same
> libobjc2 and running on Android x86 tablet, so it's definitely something
> related to ARM in libobjc2.
> 
> I'll try to debug it further, but would be very appreciate if you could
> somehow advise me on next steps.
> 
> [1]
> https://github.com/crystax/android-platform-ndk/blob/master/tests/device/crystax-test-objc-runtime/jni/test.m

Okay, so here’s an important less:

When you make some changes, test them, and are certain that they work, it’s 
really important that you commit *those changes* and not the result of 
incorrectly applying that diff.

With the *correct* version of my most recent changes pushed and your test case 
in foo.m in the build directory:

$ clang -fobjc-runtime=gnustep-1.7 foo.m -Wl,-rpath=. -L. -lobjc -I..
$ ./a.out
Hello from method!
OK

So it does seem to be working properly.  I’ve also stuck a 0 && in the #if part 
for the pre-ARMv6T2 codepaths and it still works.  Your test even passes when I 
compile the soft-float version (the soft-float version will generally work as 
long as a +initialize method doesn’t use floating point).

Let me know if you have any more issues (feel free to open issues on GitHub),

David




reply via email to

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