Recent

Author Topic: Target Android branch  (Read 25030 times)

Kostas

  • New Member
  • *
  • Posts: 30
Re: Target Android branch
« Reply #15 on: July 08, 2012, 09:50:35 am »
fpc.cfg please... (just the -Fu lines)
and to ensure, compile with -vt and look for first lines containing "Using unit path...". make sure they point to your 2.5.1 units directory.

This is not the problem, althought in order to be sure i chanded the -Fu lines to hard coded paths.

The problem is the following:
1. If i compile the 2.5.1 android patched fpc and NDK r7 with the option -CfSOFT i get nice binaries, i copy them to the right directories and i can compile my program without problems.

2. If i compile the 2.5.1 android patched fpc and NDK r7 with FPU support (option -CfVFPv2) i get errors and fpc can not be compiled.

3. If i compile the 2.5.1 android patched fpc with NDK r8 with FPU support (option -CfVFPv2) the fpc compiles fine and i get the cross compiler and the 2.5.1 units. Then i copy the created binary in the 2.6.1 direcoty and the units in the 2.5.1 directory exactly(!) as i do it when i compile with -CfSOFT. But when i tr now to compile my program i get this error:
PPU Loading C:\lazarus\fpc\2.5.1\units\arm-linux\rtl\system.ppu
fcllaz.pas(0,0) Fatal: Can not find system used by fcllaz, ppu=..\..\fpc\2.5.1\units\arm-linux\rtl\system.ppu

Kostas


Leledumbo

  • Hero Member
  • *****
  • Posts: 8112
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Target Android branch
« Reply #16 on: July 08, 2012, 03:48:47 pm »
Quote
PPU Loading C:\lazarus\fpc\2.5.1\units\arm-linux\rtl\system.ppu
fcllaz.pas(0,0) Fatal: Can not find system used by fcllaz, ppu=..\..\fpc\2.5.1\units\arm-linux\rtl\system.ppu
This error will exactly come whenever:
  • Another unit with the same name in the search path already exists, or
  • The unit is used with different compiler version
I have no idea which case applied to you.

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 152
Re: Target Android branch
« Reply #17 on: January 22, 2013, 09:23:03 pm »
I've worked on the targetandroid branch in the last few weeks.  Now it is in very good state for both arm and i386 CPUs. Please test and report ant issues:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/branches/targetandroid/

truetom

  • Jr. Member
  • **
  • Posts: 72
    • http://sourceforge.net/projects/laz4android/
Re: Target Android branch
« Reply #18 on: January 24, 2013, 01:45:07 am »
I've worked on the targetandroid branch in the last few weeks.  Now it is in very good state for both arm and i386 CPUs. Please test and report ant issues:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/branches/targetandroid/

Hello , thank you for you work!
I haved test this branches,but when i compile the examples\androidlcl\androidlcltest.lpr ,it's show some errors:

F:\lazbuild\fpc\2.7.1\bin\i386-win32\arm-linux-ld.exe: warning: F:\lazbuild\examples\androidlcl\android\libs\armeabi\link.res contains output sections; did you forget -T?
F:\lazbuild\fpc\2.7.1\bin\i386-win32\arm-linux-ld.exe: cannot find /lib/ld-linux.so.3
androidlcltest.lpr(34,36) Error: Error while linking
androidlcltest.lpr(34,36) Fatal: There were 1 errors compiling module, stopping

so i search the forum, i found this :http://www.lazarus.freepascal.org/index.php/topic,15108.0.html  ,  now i pass -FLlibdl.so to the compiler option , it's compiled ok, but when install the apk to the android device which is not running.
How can i do ? Thank you !
laz4android : a Lazarus for Android Package.
http://sourceforge.net/projects/laz4android/

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 152
Re: Target Android branch
« Reply #19 on: January 24, 2013, 11:54:54 am »
I've worked on the targetandroid branch in the last few weeks.  Now it is in very good state for both arm and i386 CPUs. Please test and report ant issues:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/branches/targetandroid/

Hello , thank you for you work!
I haved test this branches,but when i compile the examples\androidlcl\androidlcltest.lpr ,it's show some errors:

F:\lazbuild\fpc\2.7.1\bin\i386-win32\arm-linux-ld.exe: warning: F:\lazbuild\examples\androidlcl\android\libs\armeabi\link.res contains output sections; did you forget -T?
F:\lazbuild\fpc\2.7.1\bin\i386-win32\arm-linux-ld.exe: cannot find /lib/ld-linux.so.3
androidlcltest.lpr(34,36) Error: Error while linking
androidlcltest.lpr(34,36) Fatal: There were 1 errors compiling module, stopping

so i search the forum, i found this :http://www.lazarus.freepascal.org/index.php/topic,15108.0.html  ,  now i pass -FLlibdl.so to the compiler option , it's compiled ok, but when install the apk to the android device which is not running.
How can i do ? Thank you !

You need to specify android target for compiler, not linux target using -Tandroid switch.
Also you need to use binutils from Android NDK. You can specify the -XParm-linux-androideabi- compiler switch to avoid binutils renaming to arm-android-xxx
Also add library path to libs from Android NDK.
« Last Edit: January 24, 2013, 09:01:13 pm by yury_sidorov »

Leledumbo

  • Hero Member
  • *****
  • Posts: 8112
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Target Android branch
« Reply #20 on: January 24, 2013, 05:47:27 pm »
Quote
Also you need to use binutils from Android SDK. You can specify the -XParm-linux-androideabi- compiler switch to avoid binutils renaming to arm-android-xxx
Also add library path to libs from Android SDK.
Did you mean NDK?

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 152
Re: Target Android branch
« Reply #21 on: January 24, 2013, 09:01:49 pm »
Quote
Also you need to use binutils from Android SDK. You can specify the -XParm-linux-androideabi- compiler switch to avoid binutils renaming to arm-android-xxx
Also add library path to libs from Android SDK.
Did you mean NDK?
Of course NDK  :) I've edited by post.

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 152
Re: Target Android branch
« Reply #22 on: February 13, 2013, 07:53:53 pm »
The targetandroid branch has been merged to trunk. I've created wiki page about Android target here: http://wiki.freepascal.org/Android

Takeda

  • Full Member
  • ***
  • Posts: 157
Re: Target Android branch
« Reply #23 on: February 13, 2013, 09:10:39 pm »
to Mr. yury_sidorov :

Quote
....
Also add library path to libs from Android NDK.

When? when building-time the arm-android compiler?

I already use "LIBDIR=%myandroidlib%", it still failed. I still failed to built cross compiler "arm-android".
I always got : arm-linux-androideabi-ld.bfd.exe: cannot find crtbegin_dynamic.o

- takeda -
« Last Edit: February 13, 2013, 09:12:30 pm by Takeda »
Call me Takeda coz that's my true name.
Pascal coding using Lazarus => "Be native in any where.."

ƪ(˘⌣˘)┐ ƪ(˘⌣˘)ʃ ┌(˘⌣˘)ʃ

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 152
Re: Target Android branch
« Reply #24 on: February 13, 2013, 09:21:42 pm »
to Mr. yury_sidorov :

Quote
....
Also add library path to libs from Android NDK.

When? when building-time the arm-android compiler?

I already use "LIBDIR=%myandroidlib%", it still failed. I still failed to built cross compiler "arm-android".
I always got : arm-linux-androideabi-ld.bfd.exe: cannot find crtbegin_dynamic.o

- takeda -

Do you have the crtbegin_dynamic.o file in your android libs dir?
You need to point to (or copy files from) the "android-ndk-dir\platforms\android-XX\arch-arm\usr\lib".
« Last Edit: February 13, 2013, 09:24:11 pm by yury_sidorov »

Takeda

  • Full Member
  • ***
  • Posts: 157
Re: Target Android branch
« Reply #25 on: February 13, 2013, 09:28:03 pm »
to Mr. Yury_Sidorov ;

Quote
Do you have the crtbegin_dynamic.o file in your android libs dir?
You need to point to (or copy files from) the "android-ndk-dir\platforms\android-XX\arch-arm\usr\lib".

Yes, I did.. See my attachment screenshot, Sir..   ;)

Call me Takeda coz that's my true name.
Pascal coding using Lazarus => "Be native in any where.."

ƪ(˘⌣˘)┐ ƪ(˘⌣˘)ʃ ┌(˘⌣˘)ʃ

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 152
Re: Target Android branch
« Reply #26 on: February 13, 2013, 09:55:26 pm »
You need to use "make all install CROSSINSTALL=1" or "make crossall crossinstall" in order not to build the native compiler and eliminate the error.

Takeda

  • Full Member
  • ***
  • Posts: 157
Re: Target Android branch
« Reply #27 on: February 13, 2013, 10:16:22 pm »
You need to use "make all install CROSSINSTALL=1" or "make crossall crossinstall" in order not to build the native compiler and eliminate the error.

Still stick on the same error..  :'(
I still can't built the cross-compiler for arm-android..
Call me Takeda coz that's my true name.
Pascal coding using Lazarus => "Be native in any where.."

ƪ(˘⌣˘)┐ ƪ(˘⌣˘)ʃ ┌(˘⌣˘)ʃ

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 152
Re: Target Android branch
« Reply #28 on: February 13, 2013, 10:25:41 pm »
It's weird. When crossall is specified the native compiler should not be built at all and library dir not needed too. Try to issue exactly the same commands as in the wiki tutorial.

Please find and attach the link.res file from the compiler folder.

Takeda

  • Full Member
  • ***
  • Posts: 157
Re: Target Android branch
« Reply #29 on: February 13, 2013, 11:20:34 pm »
Furthermore even now with latest svn r23612 I got the message below (even only for i386-linux) :

Quote
...
make[5]: Leaving directory `d:/freepascal271/rtl/linux'
__missing_command_FPCMAKE -p -Ti386-linux Makefile.fpc
process_begin: CreateProcess(NULL, __missing_command_FPCMAKE -p -Ti386-linux Mak
efile.fpc, ...) failed.
make (e=2): The system cannot find the file specified.
...

Before r23612, target i386-linux crosscompiler would success to built..
Call me Takeda coz that's my true name.
Pascal coding using Lazarus => "Be native in any where.."

ƪ(˘⌣˘)┐ ƪ(˘⌣˘)ʃ ┌(˘⌣˘)ʃ