Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-03

Android LCL example with 2.7.1

13 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sven Barth

Hello together!

I've managed to run the Android LCL example compiled with the arm-android port of 2.7.1 on the Android emulator (API version 8) with default settings (no -Cparmv6). What is important though is that in the lcl.lpk the following code in the Conditionals is removed (line 49) otherwise a SIGILL error happens when starting the app:

=== code begin ===

if TargetCPU='arm' then
   CustomOptions := '-CpARMV6';

=== code end ===

Regards,
Sven

Reply by email

Mattias Gaertner
to Sven Barth: Hello together! I've managed to run the Android LCL example compiled with the arm-android…
Show quoted text 14 lines
Hello together! I've managed to run the Android LCL example compiled with the arm-android port of 2.7.1 on the Android emulator (API version 8) with default settings (no -Cparmv6). What is important though is that in the lcl.lpk the following code in the Conditionals is removed (line 49) otherwise a SIGILL error happens when starting the app: === code begin === if TargetCPU='arm' then CustomOptions := '-CpARMV6'; === code end ===

It can only be removed for fpc 2.7.1?
What about 2.6.2?

Mattias

Reply by email

Sven Barth
to Mattias Gaertner
"Mattias Gaertner" wrote 21 lines
On Wed, 06 Mar 2013 15:48:43 +0100 Sven Barth wrote: > Hello together! > > I've managed to run the Android LCL example compiled with the > arm-android port of 2.7.1 on the Android emulator (API version 8) with > default settings (no -Cparmv6). What is important though is that in the > lcl.lpk the following code in the Conditionals is removed (line 49) > otherwise a SIGILL error happens when starting the app: > > === code begin === > > if TargetCPU='arm' then > CustomOptions := '-CpARMV6'; > > === code end === It can only be removed for fpc 2.7.1? What about 2.6.2?

The only compiler that supports arm-android is 2.7.1.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130307/b87fdf3a/attachment-0001.html>

Reply by email

Mattias Gaertner
to Sven Barth
Show quoted text 24 lines
Am 06.03.2013 23:53 schrieb "Mattias Gaertner" : > > On Wed, 06 Mar 2013 15:48:43 +0100 > Sven Barth wrote: > > > Hello together! > > > > I've managed to run the Android LCL example compiled with the > > arm-android port of 2.7.1 on the Android emulator (API version 8) with > > default settings (no -Cparmv6). What is important though is that in the > > lcl.lpk the following code in the Conditionals is removed (line 49) > > otherwise a SIGILL error happens when starting the app: > > > > === code begin === > > > > if TargetCPU='arm' then > > CustomOptions := '-CpARMV6'; > > > > === code end === > > It can only be removed for fpc 2.7.1? > What about 2.6.2? The only compiler that supports arm-android is 2.7.1.

Thanks. I removed it.

Mattias

Reply by email

Sven Barth
to Mattias Gaertner
Mattias Gaertner wrote 25 lines
On Thu, 7 Mar 2013 07:07:07 +0100 Sven Barth wrote: > Am 06.03.2013 23:53 schrieb "Mattias Gaertner" : >> On Wed, 06 Mar 2013 15:48:43 +0100 >> Sven Barth wrote: >> >>> Hello together! >>> >>> I've managed to run the Android LCL example compiled with the >>> arm-android port of 2.7.1 on the Android emulator (API version 8) with >>> default settings (no -Cparmv6). What is important though is that in the >>> lcl.lpk the following code in the Conditionals is removed (line 49) >>> otherwise a SIGILL error happens when starting the app: >>> >>> === code begin === >>> >>> if TargetCPU='arm' then >>> CustomOptions := '-CpARMV6'; >>> >>> === code end === >> It can only be removed for fpc 2.7.1? >> What about 2.6.2? > The only compiler that supports arm-android is 2.7.1. Thanks. I removed it.

Thank you.

Regards,
Sven

Reply by email

Samuel Herzog
to Sven Barth: Thank you. Sven

Hello,

any estimate when the Lazarus daily snapshots will contain fpc 2.7.1.

Regards,

Sam

________________________________
Von: Sven Barth
An:
Gesendet: 9:35 Donnerstag, 7.M?rz 2013
Betreff: Re: [Lazarus] Android LCL example with 2.7.1

Mattias Gaertner wrote 25 lines
On Thu, 7 Mar 2013 07:07:07 +0100 Sven Barth wrote: > Am 06.03.2013 23:53 schrieb "Mattias Gaertner" : >> On Wed, 06 Mar 2013 15:48:43 +0100 >> Sven Barth wrote: >> >>> Hello together! >>> >>> I've managed to run the Android LCL example compiled with the >>> arm-android port of 2.7.1 on the Android emulator (API version 8) with >>> default settings (no -Cparmv6). What is important though is that in the >>> lcl.lpk the following code in the Conditionals is removed (line 49) >>> otherwise a SIGILL error happens when starting the app: >>> >>> === code begin === >>> >>> if TargetCPU='arm' then >>>? ? CustomOptions := '-CpARMV6'; >>> >>> === code end === >> It can only be removed for fpc 2.7.1? >> What about 2.6.2? > The only compiler that supports arm-android is 2.7.1. Thanks. I removed it.

Thank you.

Regards,
Sven

Reply by email

Felipe Monteiro de Carvalho
to Samuel Herzog

But why is -CpARMV6 a problem? It is correct. The default is ARMv4 which is not supported by Android, so we change it to ARMv6. Looks like a compiler bug or change in the code generator? Also, was the default changed?

More details should appear by finding the exact assembler instruction which causes the problem, like I did when I added this directive.

Felipe Monteiro de Carvalho

Reply by email

Dejan Boras
to Felipe Monteiro de Carvalho

Think it's a problem because the android emu up to android 2.3 (api level
9) uses ARMv5, not ARMv6.

On Thu, Mar 7, 2013 at 12:33 PM, Felipe Monteiro de Carvalho <

Show quoted text 19 lines
wrote: But why is -CpARMV6 a problem? It is correct. The default is ARMv4 which is not supported by Android, so we change it to ARMv6. Looks like a compiler bug or change in the code generator? Also, was the default changed? More details should appear by finding the exact assembler instruction which causes the problem, like I did when I added this directive. -- Felipe Monteiro de Carvalho -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130307/66c75eae/attachment-0001.html>

Reply by email

Felipe Monteiro de Carvalho
to Dejan Boras
Dejan Boras wrote
Think it's a problem because the android emu up to android 2.3 (api level 9) uses ARMv5, not ARMv6.

ARMv5 and v6 are nearly identical and I?ve never seen a real device that uses ARMv5, all low end use v6. Also I tested the previous setup in the emulator and also 30+ devices. I doubt that the new setup wont crash in a lot of real devices.

Felipe Monteiro de Carvalho

Reply by email

Sven Barth
to Felipe Monteiro de Carvalho: But why is -CpARMV6 a problem? It is correct. The default is ARMv4 which is not supported…
Felipe Monteiro de Carvalho wrote
But why is -CpARMV6 a problem? It is correct. The default is ARMv4 which is not supported by Android, so we change it to ARMv6. Looks like a compiler bug or change in the code generator? Also, was the default changed?

The default for Android was changed to armv5t (though I don't know why Yury chose the *t variant...)

More details should appear by finding the exact assembler instruction which causes the problem, like I did when I added this directive.

The offending instruction was a "uxth" in
customdrawn_androidproc.FPColorToAndroidColor which is only generated by the compiler if the CPU type is ARMv6 or higher (and according to the reference manual for ARM it does indeed only exist for ARMv6 and higher). And this instruction crashed the emulator (which is ARMv5 at least for API version 8). I've also tested the LCL test app compiled for ARMv5 on my Evo 3D which has an ARMv7 processor and the app runs without any crashes.

As 2.7.1 officially suppports (arm-)android you can now report bugs if an app crashes because of an illegal instruction, but please state the CPU's model as detailed as possible (for my phone it would be "Qualcomm Snapdragon S3 MSM8260")

Regards,
Sven

Reply by email

leledumbo
to Sven Barth: Exactly. Just follow the instructions at http://wiki.freepascal.org/Android to generate a…

Lazarus 1.1 r40503 FPC 2.7.1 r23704, both my app and androidlcl example crashes with this:

I/lclapp ( 738): [FORMS.PP] ExceptionOccurred
I/lclapp ( 738): Sender=EIntOverflow
I/lclapp ( 738): Exception=Arithmetic overflow I/lclapp ( 738): Stack trace:
I/lclapp ( 738): $46AC306C
I/lclapp ( 738): TApplication.HandleException Arithmetic overflow I/lclapp ( 738): Stack trace:
I/lclapp ( 738): $46AC306C

androidlcl generates much more information though:

I/Process ( 76): Sending signal. PID: 738 SIG: 3 I/dalvikvm( 738): threadid=3: reacting to signal 3 I/dalvikvm( 738): Wrote stack traces to '/data/anr/traces.txt' F/libc ( 738): Fatal signal 11 (SIGSEGV) at 0x400dac9c (code=2) I/Process ( 76): Sending signal. PID: 738 SIG: 3 I/dalvikvm( 738): threadid=3: reacting to signal 3 I/dalvikvm( 738): Wrote stack traces to '/data/anr/traces.txt' I/DEBUG ( 33): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 33): Build fingerprint:
'generic/sdk/generic:4.0.4/MR1/302030:eng/test-keys' I/DEBUG ( 33): pid: 738, tid: 738 >>> com.pascal.lcltest <<< I/DEBUG ( 33): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400dac9c
I/DEBUG ( 33): r0 00000000 r1 00001000 r2 00000003 r3 befa1fc4 I/DEBUG ( 33): r4 4004755c r5 400da000 r6 400daca8 r7 0000010c I/DEBUG ( 33): r8 00001000 r9 00000000 10 4527c2c4 fp 0000000c I/DEBUG ( 33): ip fffff750 sp befa1fb8 lr 40022bef pc 40022bf0 cpsr 60000030
I/DEBUG ( 33): d0 bf800000bf800000 d1 3ff0000042c80000 I/DEBUG ( 33): d2 bf80000000000000 d3 3f80000000000000 I/DEBUG ( 33): d4 3f80000000000000 d5 3ff000003f800000 I/DEBUG ( 33): d6 bff0000000000000 d7 408000003f800000 I/DEBUG ( 33): d8 0000000000000000 d9 0000000000000000 I/DEBUG ( 33): d10 0000000000000000 d11 0000000000000000 I/DEBUG ( 33): d12 0000000000000000 d13 0000000000000000 I/DEBUG ( 33): d14 0000000000000000 d15 0000000000000000 I/DEBUG ( 33): scr 60000013
I/DEBUG ( 33):
I/DEBUG ( 33): #00 pc 0001ebf0 /system/lib/libc.so (__cxa_finalize)
I/DEBUG ( 33): #01 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #02 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #03 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #04 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #05 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #06 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #07 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #08 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #09 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #10 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #11 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #12 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #13 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #14 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #15 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #16 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #17 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #18 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #19 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #20 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #21 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #22 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #23 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #24 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #25 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #26 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #27 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #28 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #29 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #30 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33): #31 pc 0001ef9c /system/lib/libc.so (exit) I/DEBUG ( 33):
I/DEBUG ( 33): code around pc:
I/DEBUG ( 33): 40022bd0 f1a6d118 9b010a0c 0007e89a 0007e883 ................
I/DEBUG ( 33): 40022be0 46414628 f8dd2203 f7eda010 b930ed06 (FAF."........0.
I/DEBUG ( 33): 40022bf0 0c0cf846 46284641 f7ed2201 4650ecfe F...AF(F."....PF
I/DEBUG ( 33): 40022c00 47889903 f1173e0c d5d837ff 2d00682d ...G.>...7..-h.-
I/DEBUG ( 33): 40022c10 f1b9d1d0 d1180f00 c048f8df f8dc44fc ..........H..D..
I/DEBUG ( 33):
I/DEBUG ( 33): code around lr:
I/DEBUG ( 33): 40022bcc 45810c04 f1a6d118 9b010a0c 0007e89a ...E............
I/DEBUG ( 33): 40022bdc 0007e883 46414628 f8dd2203 f7eda010 ....(FAF."......
I/DEBUG ( 33): 40022bec b930ed06 0c0cf846 46284641 f7ed2201 ..0.F...AF(F."..
I/DEBUG ( 33): 40022bfc 4650ecfe 47889903 f1173e0c d5d837ff ..PF...G.>...7..
I/DEBUG ( 33): 40022c0c 2d00682d f1b9d1d0 d1180f00 c048f8df -h.-..........H.
I/DEBUG ( 33):
I/DEBUG ( 33): memory map around addr 400dac9c: I/DEBUG ( 33): 400d9000-400da000 /system/lib/libz.so I/DEBUG ( 33): 400da000-400db000
I/DEBUG ( 33): 400db000-400fe000 /system/lib/libbinder.so I/DEBUG ( 33):
I/DEBUG ( 33): stack:
I/DEBUG ( 33): befa1f78 4527c460
I/DEBUG ( 33): befa1f7c 4527c3a8
I/DEBUG ( 33): befa1f80 400dad20
I/DEBUG ( 33): befa1f84 00000116
I/DEBUG ( 33): befa1f88 00001000
I/DEBUG ( 33): befa1f8c 44f782d5 /system/lib/libbcc.so I/DEBUG ( 33): befa1f90 4527c460
I/DEBUG ( 33): befa1f94 400da000
I/DEBUG ( 33): befa1f98 400dad20
I/DEBUG ( 33): befa1f9c 44f7834d /system/lib/libbcc.so I/DEBUG ( 33): befa1fa0 4004755c /system/lib/libc.so I/DEBUG ( 33): befa1fa4 400da000
I/DEBUG ( 33): befa1fa8 4527c354
I/DEBUG ( 33): befa1fac 44ff4215 /system/lib/libbcc.so I/DEBUG ( 33): befa1fb0 4004755c /system/lib/libc.so I/DEBUG ( 33): befa1fb4 0000010c
I/DEBUG ( 33): #00 befa1fb8 befa1f00 [stack] I/DEBUG ( 33): befa1fbc befa1fc4 [stack] I/DEBUG ( 33): befa1fc0 befa1f98 [stack] I/DEBUG ( 33): befa1fc4 44e93ead /system/lib/libbcc.so I/DEBUG ( 33): befa1fc8 4527c2c4
I/DEBUG ( 33): befa1fcc 45278770 /system/lib/libbcc.so I/DEBUG ( 33): befa1fd0 46e9b030
I/DEBUG ( 33): befa1fd4 00000000
I/DEBUG ( 33): befa1fd8 46da6f48
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 33): befa1fdc 46e9b030
I/DEBUG ( 33): befa1fe0 46e8b160
I/DEBUG ( 33): befa1fe4 befa2664 [stack] I/DEBUG ( 33): befa1fe8 41fac4f0
I/DEBUG ( 33): befa1fec 468fcd02
/data/dalvik-cache/data
I/DEBUG ( 33): befa1ff0 befa20f4 [stack] I/DEBUG ( 33): befa1ff4 40022fa1 /system/lib/libc.so I/DEBUG ( 33): #01 befa1ff8 46da6f48
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 33): befa1ffc 46a0afe8
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 33): befa2000 befa20f4 [stack] I/DEBUG ( 33): befa2004 46a0b020
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 33): befa2008 46a404ec
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 33): befa200c 46a4052c
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 33): befa2010 46e9b030
I/DEBUG ( 33): befa2014 46e8b160
I/DEBUG ( 33): befa2018 befa2664 [stack] I/DEBUG ( 33): befa201c 41fac4f0
I/DEBUG ( 33): befa2020 468fcd02
/data/dalvik-cache/data
I/DEBUG ( 33): befa2024 46fc362c
I/DEBUG ( 33): befa2028 0000000b
I/DEBUG ( 33): befa202c 46e7437c
I/DEBUG ( 33): befa2030 0000000b
I/DEBUG ( 33): befa2034 46d501a4
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 33): befa2038 00000002
I/DEBUG ( 33): befa203c 0000000a
I/Process ( 76): Sending signal. PID: 738 SIG: 3 I/dalvikvm( 738): threadid=3: reacting to signal 3 I/dalvikvm( 738): Wrote stack traces to '/data/anr/traces.txt' I/Process ( 76): Sending signal. PID: 738 SIG: 3 I/dalvikvm( 738): threadid=3: reacting to signal 3 I/dalvikvm( 738): Wrote stack traces to '/data/anr/traces.txt' I/Process ( 76): Sending signal. PID: 738 SIG: 3 I/dalvikvm( 738): threadid=3: reacting to signal 3 I/dalvikvm( 738): Wrote stack traces to '/data/anr/traces.txt' I/Process ( 76): Sending signal. PID: 738 SIG: 3 I/dalvikvm( 738): threadid=3: reacting to signal 3 I/dalvikvm( 738): Wrote stack traces to '/data/anr/traces.txt' I/Process ( 76): Sending signal. PID: 738 SIG: 3 I/dalvikvm( 738): threadid=3: reacting to signal 3 I/dalvikvm( 738): Wrote stack traces to '/data/anr/traces.txt' D/Zygote ( 36): Process 738 terminated by signal (11) I/WindowManager( 76): WIN DEATH: Window{412994b0 com.pascal.lcltest/com.pascal.lcltest.LCLActivity paused=false} I/ActivityManager( 76): Process com.pascal.lcltest (pid 738) has died. W/ActivityManager( 76): Force removing ActivityRecord{410ac500 com.pascal.lcltest/.LCLActivity}: app died, no saved state W/NetworkManagementSocketTagger( 76): setKernelCountSet(10040, 0) failed with errno -2
I/WindowManager( 76): WIN DEATH: Window{4128d228 com.pascal.lcltest/com.pascal.lcltest.LCLActivity paused=false}

View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Android-LCL-example-with-2-7-1-tp4029697p4029765.html Sent from the Free Pascal - Lazarus mailing list .

Reply by email