[fpc-devel] Re: Building the Android branch

Sven Barth pascaldragon at googlemail.com
Tue Dec 18 17:35:08 CET 2012


Am 18.12.2012 17:24, schrieb Sven Barth:
> Am 18.12.2012 14:22, schrieb Sven Barth:
>> Am 18.12.2012 14:15, schrieb Thomas Schatzl:
>>>
>>>> I now simply replaced my 2.6.0 fpcmake with one compiled from the
>>>> Android branch and were happy to go :)
>>>>
>>>> So I (this time on Windows) managed to compile and install the branch
>>>> and now just need to check whether it will work...
>>>>
>>>> Now I just need to test whether the Android LCL test
>>>> application/library works... Thank you so far :D
>>>>
>>> I never tried the LCL, but with some hacking of android makefiles I
>>> managed to create and run some opengl demo application. Use the NDK
>>> bindings on lazarus-ccr; just looked, the bindings are still there, but
>>> that example application seems to be gone.
>>>
>>> I heard other people were successful with a hacked arm/linux compiler
>>> before that branch started.
>>>
>>> Of course, console apps like the compiler to do e.g. a make cycle also
>>> worked last time I tried.
>> I successfully compiled the lcl-customdrawn example library, but the 
>> Java side code does not like the idea of being compiled -.- I'll need 
>> to look into this...
> Ok, the problem with the Java side code was that I didn't have the 
> corresponding Java API installed (version 8)...
>
> Now I can build the package, but I get a link error from Android. 
> Looking at the output of objdump I can't mind that it has problems:
>
> === objdump begin ===
>
> D:\lazarus\1.0\examples\androidlcl\android\libs\armeabi\liblclapp.so: 
> file format elf32-littlearm
>
> Program Header:
>     LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**15
>          filesz 0x00425dc0 memsz 0x00425dc0 flags r-x
>     LOAD off    0x00428000 vaddr 0x00428000 paddr 0x00428000 align 2**15
>          filesz 0x0001f9c8 memsz 0x00033a28 flags rw-
>  DYNAMIC off    0x00428000 vaddr 0x00428000 paddr 0x00428000 align 2**2
>          filesz 0x000000c8 memsz 0x000000c8 flags rw-
>    STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
>          filesz 0x00000000 memsz 0x00000000 flags rwx
>
> Dynamic Section:
>   NEEDED 
> D:\Android\android-ndk-r8c\platforms\android-8\arch-arm\usr\lib\\libdl.so
>   NEEDED               libjnigraphics.so
>   NEEDED               liblog.so
>   SONAME               liblclapp.so
>   INIT                 0x000beea4
>   FINI                 0x000e069c
>   HASH                 0x000000b4
>   STRTAB               0x0000021c
>   SYMTAB               0x0000010c
>   STRSZ                0x000002a8
>   SYMENT               0x00000010
>   PLTGOT               0x004280c8
>   PLTRELSZ             0x00000018
>   PLTREL               0x00000011
>   JMPREL               0x000bee54
>   REL                  0x000004c4
>   RELSZ                0x000be990
>   RELENT               0x00000008
>   TEXTREL              0x00000000
>   RELCOUNT             0x00017d32
> private flags = 5000002: [Version5 EABI] [has entry point]
>
> === objdump end ===
>
> The first one shouldn't be the full pathname... also isn't the linker 
> on Android called "/system/bin/linker"?
>
> Do I need any further options besides the -Xp..., -FD..., -Fl..., 
> -CpARMv6 and -CfSoft to build a library?
Ok... first: it was a stray "-FLlibdl.so" from a former test with non 
working binutils.

When I remove it the library can't be linked though...

The following options are set in fpc.cfg for Android:

  -XParm-linux-androideabi-
  -FDD:\Android\android-ndk-r8c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin
  -FlD:\Android\android-ndk-r8c\platforms\android-8\arch-arm\usr\lib\

The following arguments are added by Lazarus (the last three were 
already part of the project - removing -Xd does also not change anything):

  -MObjFPC -Scghi -O1 -Tandroid -Parm -Xs -XX -vewnhi -l 
-Filib\arm-android -Fu..\..\lcl\units\arm-android\customdrawn 
-Fu..\..\lcl\units\arm-android 
-Fu..\..\components\lazutils\lib\arm-android 
-Fu..\..\packager\units\arm-android -Fu. -FUlib\arm-android\ 
-FEandroid\libs\armeabi\ -oliblclapp.so -dLCL -dLCLcustomdrawn -dANDROID 
-Xd -CpARMV6

Regards,
Sven



More information about the fpc-devel mailing list