[Top][All Lists]

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

Re: libobjc2 still failing tests

From: David Chisnall
Subject: Re: libobjc2 still failing tests
Date: Sat, 26 Jan 2019 11:47:14 +0000

On 25 Jan 2019, at 22:16, Jordan Schidlowsky <address@hidden> wrote:
> Actually both armv7-a (vfpv3-d16 no neon, and softfp) and yes AArch64 
> (arm64-v8a).
> armv7-a is working great for us on android with current stock Google NDK 
> which is using clang-8...  but we seem to be experiencing an ivar alignment 
> or offset bug on arm64-v8a.

Is it fixed in the latest head (including my fix from yesterday)?  If you’re 
compiling in a release build, that would explain it.  Note that this code path 
should only have been an issue using the 1.x ABI.  If you’re compiling with 
-fobjc-runtime=gnustep-2.0 (which should give you 5-10% smaller binaries, so 
might be a good idea on Android…) then you won’t have hit that bug.

Note that the new ABI absolutely depends on the small object support, because 
the compiler will emit tiny strings for short ASCII constant strings.

It would be great to see test results for vfp / neon.  Looking at the 
objc_msgSend code, I *think* we may be missing .save directives for the 
floating-point register saves, so hitting the C path may cause corruption in 
the case where the +initialize method throws an exception.  There’s a test for 
this case in the test suite, but I don’t know if it’s ever been run on a 
hard-float ARM platform…

Are you still using the ARMv5 stuff?  That’s there for some Chinese Android 
devices, but I don’t know if anyone still cares about it.

> We had to rework SmallObjectClasses assembly reference because android will 
> not load any library that has any text relocations in a library.  (I believe 
> we can probably get around that by using the GOT to get to 
> SmallObjectClassess but we have just removed for now).  

Does this patch fix it for you?

--- a/objc_msgSend.aarch64.S
+++ b/objc_msgSend.aarch64.S
@@ -79,7 +79,8 @@
        ldp    \receiver, x8, [sp], #16
        br     x9
-       adr    x10, SmallObjectClasses
+       adrp    x10, :got:SmallObjectClasses
+       ldr     x10, [x10, :got_lo12:SmallObjectClasses]
        ldr    x9, [x10, x9, lsl #3]
        b      1b

I don’t have an AArch64 environment that I can test very easily at the moment, 
but I believe this should fix it.  Patches very welcome!

> But ya, Ideally I want to run the test suite on an actual android device to 
> figure out this ivar issue on AArch64.  So, hmmmmmm, I guess I'll try and 
> think of some way to get the test executable main()s onto an actual android 
> device for testing…

I’d be very happy to accept patches to ease testing / building for Android (or 
cross-build in general).


reply via email to

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