[fpc-devel] Re: Building the Android branch

Sven Barth pascaldragon at googlemail.com
Tue Dec 18 07:30:54 CET 2012


On 18.12.2012 00:10, Thomas Schatzl wrote:
 > Hi,
 >
 > On Mon, 2012-12-17 at 21:45 +0100, Sven Barth wrote:
 >> Hello together!
 >>
 >> I'm currently testing the Android branch and I've already reached a
 >> problem when trying to build it. I've downloaded the current Android NDK
 >> r8c and then tried to run the following command line:
 >>
 >> make all OS_TARGET=android CPU_TARGET=arm
 >> 
CROSSBINDIR=/mnt/data/downloads/dev/android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin
 >> BINUTILSPREFIX=arm-linux-androideabi- OPT=-dFPC_ARMEL CROSSOPT="-CpARMv6
 >> -Cfsoft"
 >>
 >> This works until the process reaches the CHM package where it wants to
 >> compile chmls. The compiler then returns with a linker error when
 >> executing the following command (reported by fpmake):
 >>
 >> /mnt/data/source/fpc/fpc-android/compiler/ppcrossarm -Tandroid
 >> [...]
 >> 
/mnt/data/downloads/dev/android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-ld:
 >> warning: chm/bin/arm-android/link.res:1:22: ignoring SEARCH_DIR;
 >> [...]
 >
 > The problem is that the android 8c ndk uses the GOLD linker by default.
 > GOLD is not compatible with fpc.
 >
 > E.g.
 >
 > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=620815
 >
 > Can you retry with an older ndk (GOLD is new to the 8c ndk).
 > Alternatively, in <ndk-dir>/[...]/arm-linux-androideabi-4.6/prebuilt/
 > arm-linux-androideabi-ld there is a copy of the
 > arm-linux-androideabi-ld.gold executable. There is an
 > arm-linux-androideabi-ld.bfd there as well, so just overwrite
 > arm-linux-androideabi-ld with the latter (or symlink to the bfd one).

Yes, that was the problem -.-

Maybe we should somewhen investigate what it would mean to support 
GOLD... or we concentrate to get the internal linker for Android working :D

 > Another thing, you need to add the platforms/android-XX/arch-arm/usr/lib
 > directory to the library search paths using -Fl in the CROSS_OPT.
 > Otherwise the compiler won't find the C library later.

Correct... Done...

 > There is a new issue I have never seen before that fpdoc (actually
 > cwstring) now wants to link with libiconv which is not available on
 > Android (you can build it yourselves though). Simply excluding it from
 > the android build would fix that.
 >
 > Maybe you could have a look?

Excluding fpdoc itself is a bit tricky as it's listed in the basic 
"dirs" of utils/Makefile.fpc and thus is built for every target for 
which utils is build... for me locally I just added Android to the 
NOUTILSTARGET of the base Makefile(.fpc).

Maybe the real solution would be the Unicode String Manager posted here: 
http://bugs.freepascal.org/view.php?id=22909

The discussion about it's inclusion died down after a mail was sent to 
the Unicode consortium where we asked about some legal issues regarding 
the Unicode tables... they seem to have never answered though...

So building works so far, but the next problem is "crossinstall"... even 
after I do a normal install for my host system I get the following when 
trying to do a crossinstall for Android:

=== output begin ===

make install CROSSINSTALL=1
make[1]: Entering directory `/mnt/data/source/fpc/fpc-android'
make installbase 
FPC=/mnt/data/source/fpc/fpc-android/compiler/ppcrossarm 
ZIPDESTDIR=/mnt/data/source/fpc/fpc-android FPCMAKE=fpcmake
make[2]: Entering directory `/mnt/data/source/fpc/fpc-android'
/usr/bin/install -m 755 -d 
/mnt/data/source/fpc/fpc-android-install/lib/fpc/2.7.1
/usr/bin/install -m 755 -d /mnt/data/source/fpc/fpc-android-install/bin
make compiler_install 
FPC=/mnt/data/source/fpc/fpc-android/compiler/ppcrossarm 
ZIPDESTDIR=/mnt/data/source/fpc/fpc-android FPCMAKE=fpcmake
make[3]: Entering directory `/mnt/data/source/fpc/fpc-android'
make -C compiler install
make[4]: Entering directory `/mnt/data/source/fpc/fpc-android/compiler'
make -C utils install
make[5]: Entering directory 
`/mnt/data/source/fpc/fpc-android/compiler/utils'
make[5]: Leaving directory `/mnt/data/source/fpc/fpc-android/compiler/utils'
/usr/bin/install -m 755 -d 
/mnt/data/source/fpc/fpc-android-install/lib/fpc/2.7.1
/usr/bin/install -c -m 755 ppcrossarm 
/mnt/data/source/fpc/fpc-android-install/lib/fpc/2.7.1/ppcrossarm
make[4]: Leaving directory `/mnt/data/source/fpc/fpc-android/compiler'
make[3]: Leaving directory `/mnt/data/source/fpc/fpc-android'
make rtl_install 
FPC=/mnt/data/source/fpc/fpc-android/compiler/ppcrossarm 
ZIPDESTDIR=/mnt/data/source/fpc/fpc-android FPCMAKE=fpcmake
make[3]: Entering directory `/mnt/data/source/fpc/fpc-android'
make -C rtl install
make[4]: Entering directory `/mnt/data/source/fpc/fpc-android/rtl'
make -C android all
make[5]: Entering directory `/mnt/data/source/fpc/fpc-android/rtl/android'
make[5]: Leaving directory `/mnt/data/source/fpc/fpc-android/rtl/android'
fpcmake -p -Tarm-android Makefile.fpc
Processing Makefile.fpc
Error: No targets set
make[4]: *** [fpc_install] Fehler 1
make[4]: Leaving directory `/mnt/data/source/fpc/fpc-android/rtl'
make[3]: *** [rtl_install] Fehler 2
make[3]: Leaving directory `/mnt/data/source/fpc/fpc-android'
make[2]: *** [installbase] Fehler 2
make[2]: Leaving directory `/mnt/data/source/fpc/fpc-android'
make[1]: *** [installall] Fehler 2
make[1]: Leaving directory `/mnt/data/source/fpc/fpc-android'
make: *** [crossinstall] Fehler 2

=== output end ===

Regards,
Sven

PS: Sorry, Thomas, should have gone to the list as well -.-



More information about the fpc-devel mailing list