[fpc-devel] How to get FPC to generat floating point instructions for ARM? [solved Fpc 2.5.1 iOS4.3 Compiler Build]
Helmut Hartl
helmut.hartl at firmos.at
Thu Apr 14 23:34:23 CEST 2011
Am 13.04.11 14:59, schrieb Jonas Maebe:
> On 13 Apr 2011, at 14:22, Helmut Hartl wrote:
>
>> Am 17.03.11 12:48, schrieb Jonas Maebe:
>>> There won't be an iOS 2.4.4 release, because it would barely work
>>> with
>>> current iOS SDK releases:
>>> [...]
>> What has to be done to get trunk working with XCode 4 ?
> To clarify: that only affects iOS. Plain Mac OS X compilation works
> fine with Xcode 4 (better than with Xcode 3 in fact, since the linker
> bug mentioned at e.g. http://www.freepascal.org/down/i386/macosx-ftp.freepascal.org.var
> under "Mac OS X 10.6 (Snow Leopard) compatibility" has been fixed).
>
> As for iOS, see the attached messages.
Thank you very much for your help.
It was not trivial (at least for me) to do the build, so i want
to give feedback how it worked for me.
1) I tried to install the last fpc ios 2.5.1 snapshot
(wiki iPhoneSnapshot-2.5.1-r14397)
-> failure due to only XCode4 and iOS SDK 4.3 available
-> and SDK not found by fpc after install script
2) Patched: "finish_fpc_iphone_install.command"
[…]
# Obtain the installation directory of the SDK.
[…]
+ elif [ -f "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/arm/_structs.h" ]; then
+ IPHONEINSTALLDIR=/Developer
+ IPHONESDKDIR=iPhoneOS4.3.sdk
[…]
Resulting in :
>ld: warning: -ios_version_min not specificed, assuming 4.3
ld: object file /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk//usr/lib/crt1.o was built for different arm sub-type (6) than link command line (0) for architecture arm
An error occurred while linking
pp.pas(224,1) Error: Error while linking
pp.pas(224,1) 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-darwin] Error 2
An error occurred during building everything for ARM
When asking for help with this error, please provide the entire contents of
this window (you can copy/paste it)
You can restart this script by double-clicking it in the Finder at
/Developer/FreePascalCompiler/iPhoneSnapshot-2.5.1-r14397/InstallScript/finish_fpc_iphone_install.command
3) Now I copied the translated "sig_cpu.inc" to my svn trunk checkout "rtl/darwin/arm/" dir
4) Applied the cpu subarch type patch from jonas
5) regenerated the fcl-web makefile with the original version
(cp Makefile.org Makefile.fpc then fpcmake -Tall)
Due to Error:
HHMacBookPro:trunk helly$ sudo make FPC=/usr/local/lib/fpc/2.4.2/ppc386 CPU_TARGET=arm CROSSOPT="-FD${IPHONEPLATFORMBASEDIR}/usr/bin -XR${IPHONEPLATFORMBASEDIR}/SDKs/iPhoneOS4.3.sdk/ -ap -Cfvfpv2" all
[…]
make -C fcl-web clean
./fpmake clean --localunitdir=../.. --globalunitdir=.. --os=darwin --cpu=arm -o -Parm -o -Ur -o -Xs -o -O2 -o -n -o -Fu/Users/helly/pascal/bzr_fpc/trunk/rtl/units/arm-darwin -o -Fu/Users/helly/pascal/bzr_fpc/trunk/packages/hash/units/arm-darwin -o -Fu/Users/helly/pascal/bzr_fpc/trunk/packages/paszlib/units/arm-darwin -o -Fu/Users/helly/pascal/bzr_fpc/trunk/packages/fcl-process/units/arm-darwin -o -Fu/Users/helly/pascal/bzr_fpc/trunk/packages/fpmkunit/units/arm-darwin -o -FE. -o -FUunits/arm-darwin -o -darm -o -dRELEASE -o -FD/Developer/Platforms/iPhoneOS.platform/Developer//usr/bin -o -XR/Developer/Platforms/iPhoneOS.platform/Developer//SDKs/iPhoneOS4.3.sdk/ -o -ap -o -Cfvfpv2 --compiler=/Users/helly/pascal/bzr_fpc/trunk/compiler/ppcrossarm
make[3]: ./fpmake: Bad CPU type in executable
make[3]: *** [clean] Error 1
make[2]: *** [fcl-web_clean] Error 2
make[1]: *** [packages_clean] Error 2
make: *** [build-stamp.arm-darwin] Error 2
[…]
6) Then finally:
sudo make FPC=/usr/local/lib/fpc/2.4.2/ppc386 CPU_TARGET=arm CROSSOPT="-FD${IPHONEPLATFORMBASEDIR}/usr/bin -XR${IPHONEPLATFORMBASEDIR}/SDKs/iPhoneOS4.3.sdk/ -ap -Cfvfpv2" all
sudo make FPC=`pwd`/compiler/ppcrossarm OPT="-ap" CPU_TARGET=arm CROSSOPT="-FD${IPHONEPLATFORMBASEDIR}/usr/bin -XR${IPHONEPLATFORMBASEDIR}/SDKs/iPhoneOS4.3.sdk/ -ap" install CROSSINSTALL=1
sudo ln -sf ../lib/fpc/2.5.1/ppcrossarm /usr/local/bin/ppcarm
Yielded:
HHMacBookPro:trunk helly$ ppcarm
Free Pascal Compiler version 2.5.1 [2011/04/14] for arm
[…]
I have not tested the compiler by now, but was happy to build it.
As next step I want to try to port some of our opengl/physics code
to the iPad2.
helmut
More information about the fpc-devel
mailing list