* * *

Author Topic: [Solved] LAMW: how to add mips target?  (Read 2235 times)

turronet

  • New member
  • *
  • Posts: 13
[Solved] LAMW: how to add mips target?
« on: August 20, 2017, 11:37:07 am »
It is possible to add the mipsel target to the ide?

Thanks
« Last Edit: October 06, 2017, 10:02:37 pm by turronet »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1012
Re: LAMW: how to add mips target?
« Reply #1 on: August 22, 2017, 11:20:56 pm »

Hello Turronet!

I will try to add support to "mipsel"...

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 1012
Re: LAMW: how to add mips target?
« Reply #2 on: September 24, 2017, 11:02:23 pm »
Hi, Turronet!

Have you  a cross-compile system  for "mipsel-android" ???
[my Laz4android (out-of-box) do not support mipsel, so I dont got a good test/debug...]
« Last Edit: September 24, 2017, 11:05:37 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 1012
Re: LAMW: how to add mips target?
« Reply #3 on: September 26, 2017, 01:50:32 am »

Done! 

mipsel chip support added to LAMW!

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

majid.ebru

  • Sr. Member
  • ****
  • Posts: 270
Re: LAMW: how to add mips target?
« Reply #4 on: September 26, 2017, 05:48:05 am »
Hi

waht is mipsel?

thank you

jmpessoa

  • Hero Member
  • *****
  • Posts: 1012
Re: LAMW: how to add mips target?
« Reply #5 on: September 26, 2017, 05:59:56 am »
A chip architecture.... ex: x86  ... arm ... mipsel

Yes, some phone/device are  "mips" ... not "arm" or "x86"
« Last Edit: September 26, 2017, 06:03:05 am by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

turronet

  • New member
  • *
  • Posts: 13
Re: LAMW: how to add mips target?
« Reply #6 on: September 26, 2017, 07:49:36 am »
Hi all,

Many thanks jmpessoa!

A device that use mips cpu running android 5.1 is the huami amazfit pace, it' s a sportwatch.

Ciao

DonAlfredo

  • Hero Member
  • *****
  • Posts: 811
Re: LAMW: how to add mips target?
« Reply #7 on: September 26, 2017, 05:00:26 pm »
Sidenote:
I have added mipsel-android crosscompiler for Windows x86 and Linux x64 into the latest version of fpcupdeluxe.
 :)

turronet

  • New member
  • *
  • Posts: 13
Re: LAMW: how to add mips target?
« Reply #8 on: September 28, 2017, 01:04:52 pm »
Hi All,

Now I'm able to create an hello world apk with mipsel

Unfortunately I get force close in the mips avd emulator and wrong abis while sending apk to smartwatch.

Apk created with arm target runs well on phone and tablet so the lamw is more or less tuned.

Next step will be trying fpc 3.1.1 instead of 3.0.4.

Hopefully it's only a matter of ndk,sdk and fpc versions

Let's see

turronet

  • New member
  • *
  • Posts: 13
Re: LAMW: how to add mips target?
« Reply #9 on: September 30, 2017, 11:16:00 am »
A little update:

...lib/mipsel/libcontrol.so has to be lib/mips/libcontrol.so....
After that modification in the target setting within lazarus I'm able to run the apk in the avd and installing apk in the smartwatch.
"Unfortunately bla.apk has stopped" is what I get in the device ( no issues in the avd)

The battle continue...

jmpessoa

  • Hero Member
  • *****
  • Posts: 1012
Re: LAMW: how to add mips target?
« Reply #10 on: October 01, 2017, 12:01:14 am »

Quote
...lib/mipsel/libcontrol.so has to be lib/mips/libcontrol.so....

Fixed!

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

turronet

  • New member
  • *
  • Posts: 13
Re: LAMW: how to add mips target?
« Reply #11 on: October 01, 2017, 05:20:52 pm »
Hello Jmpessoa,

I tried but it asked me to create mipsel folder, this means that target name (-o option) wasn't updated.

I kindly ask You an help, I'm not so good in android and java (otherwise I would use android studio..) and I like lazarus, so I would like to understand why I'm not able to create apk for my target device.

Always talking about an hello world app these are the results achieved:
If I create an apk for arm, everything is fine on both emu and devices (moto g5+, kindle fire 8, etc...) so great job , really well done!
If I create a console app (not JNI) for mips(el) everything is fine on both emu and device (huami amazfit pace) which runs 5.1.1 sdk 22.
If I create a GUI (JNI) apk for mips(el) it's running well on mips emulator, but I get "unfortunately x.apk has stopped" on the device
If I create a Console (JNI) apk for mips(el) it's running well on mips emulator, but I get "unfortunately x.apk has stopped" on the device

I attached the logcat
I'm not expert but it seems the failure is due to lib loading and function addresses... how about this?
I read some issues on PIC libraries and fpc+android, but no way to get libcontrol.so built with -Cg- flags.

Could You kindly send me a mips apk so I can check if it behaves the same?

many thanks for Your help

Valerio

jmpessoa

  • Hero Member
  • *****
  • Posts: 1012
Re: LAMW: how to add mips target?
« Reply #12 on: October 01, 2017, 09:12:38 pm »
Quote
this means that target name (-o option) wasn't updated.
Sorry.... fixed!

From log:
Quote
F/art     ( 5232): art/runtime/runtime.cc:289] java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.hide()' on a null object reference
F/art     ( 5232): art/runtime/runtime.cc:289]   at void org.lamw.lamwguiproject18.jForm.HideActionBar() (Controls.java:625)
If you have some "HideActionBar()"  in your pascal code,  try to comment it....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

turronet

  • New member
  • *
  • Posts: 13
Re: LAMW: how to add mips target?
« Reply #13 on: October 02, 2017, 12:17:11 am »
Thanks for the fix, now it is fine.
Have You changed something else recently?
"[Lamw] Build and run apk" now opens a terminal which closes almost immediatley so I can't see what's happen, it says all green all the times in the message windows but actually if it fails for some reason You don't know.
Manually launching the scripts build-debug and install work perfectly (at least I know the reason of failure)

Coming back to "my problem" I found a way to avoid actionbar but unfortunately it fails just after...

Code: Pascal  [Select]
  1. W/linker  ( 9999): libcontrols.so: unused DT entry: type 0x6ffffffe arg 0xf48
  2. W/linker  ( 9999): libcontrols.so: unused DT entry: type 0x6fffffff arg 0x2
  3. W/linker  ( 9999): libcontrols.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
  4. W/art     ( 9999): Can't call EnsureArtActionInFrontOfSignalChain due to unitialized fault manager
  5. F/art     ( 9999): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI GetObjectClass called with pending exception 'java.lang.NullPointerException' thrown in unknown throw location
  6. F/art     ( 9999): art/runtime/check_jni.cc:65]     in call to GetObjectClass
  7. F/art     ( 9999): art/runtime/check_jni.cc:65]     from void org.lamw.lamwguiproject2.Controls.pAppOnCreate(android.content.Context, android.widget.RelativeLayout, android.content.Intent)
  8. F/art     ( 9999): art/runtime/check_jni.cc:65] "main" prio=5 tid=1 Runnable
  9. F/art     ( 9999): art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x35da4000 self=0x74427800
  10. F/art     ( 9999): art/runtime/check_jni.cc:65]   | sysTid=9999 nice=0 cgrp=default sched=0/0 handle=0x77f28460
  11. F/art     ( 9999): art/runtime/check_jni.cc:65]   | state=R schedstat=( 96463376 109199391 87 ) utm=8 stm=1 core=0 HZ=100
  12.  

I'm comparing androidmanifest.xml and styles.xml from a working apk, it looks like the AppCompat them should be used, of course at the moment it doesn't build the apk

the battle go forward....

jmpessoa

  • Hero Member
  • *****
  • Posts: 1012
Re: LAMW: how to add mips target?
« Reply #14 on: October 02, 2017, 02:57:19 am »

We do not have "AppCompat" [and others 'support" library]   in LAMW....  so, it will fail!!!

Stay with LAMW default style e try change minSDK and tarqetSDK in manifest....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus