Building Android cross compiler error

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Building Android cross compiler error

Ryan Joseph
I’ve downloaded FPC 3.0.0 and updated the sources from SVN then downloaded the Android NDK (Mac OS X 64-bit was the only option for Mac). The script seems to work but I’m getting this error after compiling for some time.

Any ideas what’s going on?

======

cd /Developer/ObjectivePascal/fpc
INSTALL_PATH=/Developer/Android
PATH=$PATH:$INSTALL_PATH/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin

make clean all crossinstall OS_TARGET=android CPU_TARGET=arm CROSSOPT="-Cfvfpv3" INSTALL_PREFIX=$INSTALL_PATH

=====

/Developer/Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld.bfd: cannot find -lc
pp.pas(219,36) Error: Error while linking
pp.pas(219,36) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[3]: *** [ppcarm] Error 1
make[2]: *** [cycle] Error 2
make[1]: *** [compiler_cycle] Error 2
make: *** [build-stamp.arm-android] Error 2


Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Building Android cross compiler error

Michalis Kamburelis-3

/Developer/Android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld.bfd: cannot find -lc
pp.pas(219,36) Error: Error while linking


Have you defined the -Fl option correctly?

For example, I put something like this in my ~/.fpc.cfg:

#ifdef android 
#ifdef cpuarm 
-Fl/home/michalis/.../android/ndk/platforms/android-19/arch-arm/usr/lib/ 
#endif 
#ifdef cpu386 
-Fl/home/michalis/.../android/ndk/platforms/android-19/arch-x86/usr/lib/ 
#endif 
#endif

You can see Castle Game Engine instructions about setting up Android+FPC environment on https://github.com/castle-engine/castle-engine/wiki/Android :)

Michalis

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Building Android cross compiler error

Ryan Joseph
Isn’t that step after the compiler has been built? I was following the guide at http://wiki.freepascal.org/Android and they said to just add to the $PATH variable and then create the config file later so I didn’t even get to that step since the compiling failed.

> On Feb 23, 2016, at 1:53 PM, Michalis Kamburelis <[hidden email]> wrote:
>
> Have you defined the -Fl option correctly?
>
> For example, I put something like this in my ~/.fpc.cfg:
>
> #ifdef android
> #ifdef cpuarm
> -Fl/home/michalis/.../android/ndk/platforms/android-19/arch-arm/usr/lib/
> #endif
> #ifdef cpu386
> -Fl/home/michalis/.../android/ndk/platforms/android-19/arch-x86/usr/lib/
> #endif
> #endif
>
>

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal