[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: arm port plans for the squeeze cycle (fpc bootstrapping)



>free pascal needs bootstrapping.

I started trying with roughly the following recipie (note: these should be equivilent to what I did but I also went down a lot of dead ends, did things in a less sensible order etc)

wget ftp://ftp.freepascal.org/pub/fpc/dist/arm-linux-2.2.2/fpc-2.2.2.arm-linux.tar
tar -xf fpc-2.2.2.arm-linux.tar binary.arm-linux.tar
tar -xf binary.arm-linux.tar base.arm-linux.tar.gz
tar -zxf base.arm-linux.tar.gz lib/fpc/2.2.2/ppcarm
mv lib/fpc/2.2.2/ppcarm .
tar -zxf base.arm-linux.tar.gz bin/fpc
mv bin/fpc .
apt-get source -b fpc
<install all missing build-depends except those with a fp- prefix>
export PATH=$PATH:$PWD
tar -zxf utils.arm-linux.tar.gz bin/fpcmake
mv bin/fpcmake .
cd fpc-2.2.4/
<apply the attatched patch to debian/rules (note: this is a work in progress, I have not written the conditionals to make it suitable for other architectures as well)>
dpkg-buildpackage -B -d

By doing this I managed to get the rtl to build but the compiler failed to build with /root/fpcdeb/ppcarm -Ur -Xs -O2 -n -Fuarm -Fusystems -Fu/root/fpcdeb/fpc-2.2.4/fpcsrc/rtl/units/arm-linux -Fiarm -FE. -FUarm/units/arm-linux -dRELEASE -dFPC_ARMEL -CfSOFT -darm -dGDB -dBROWSERLOG pp.pas
i_linux.pas(596,11) Error: Identifier not found "abi_eabi"
i_linux.pas(596,11) Error: Illegal expression
i_linux.pas(539,11) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted

And when I asked about that error (on #fpc on freenode) jonas-fpc said "plugwash: use fpc trunk for arm eabi, 2.2.4 contained many bugs even if you get it to compile"

So IMO the thing to do is to wait for the next major release of freepascal before trying further to introduce it to debian armel. This mail serves to document the path I have taken so I or somone else can continue once a suitable fpc version is in debian.
--- fpc-2.2.4/debian/rules	2009-08-24 23:30:11.000000000 +0100
+++ fpc-2.2.4.new/debian/rules	2009-08-24 22:46:01.000000000 +0100
@@ -16,8 +16,8 @@
 endif
 
 # Detect name of new compiler, take care that debian uses amd64 instead of x86_64
-CPU_SOURCE=$(subst amd64,x86_64,$(shell dpkg-architecture -qDEB_BUILD_ARCH))
-CPU_TARGET=$(subst amd64,x86_64,$(shell dpkg-architecture -qDEB_HOST_ARCH))
+CPU_SOURCE=$(subst amd64,x86_64,$(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU))
+CPU_TARGET=$(subst amd64,x86_64,$(shell dpkg-architecture -qDEB_HOST_ARCH_CPU))
 
 ifeq ($(CPU_TARGET),m68k)
 PPSUF=68k
@@ -163,11 +163,11 @@
 	@echo "--- Building"
 	dh_testdir
 # First make a new Compiler and RTL using a make cycle
-	$(MAKE) -C fpcsrc compiler_cycle
-	$(MAKE) -C fpcsrc rtl_clean rtl_smart $(BUILDOPTS)
-	$(MAKE) -C fpcsrc packages_smart $(BUILDOPTS)
-	$(MAKE) -C fpcsrc ide_all $(BUILDOPTS)
-	$(MAKE) -C fpcsrc utils_all $(BUILDOPTS)
+	$(MAKE) -C fpcsrc compiler_cycle 'OPT=-dFPC_ARMEL -CfSOFT'
+	$(MAKE) -C fpcsrc rtl_clean rtl_smart 'OPT=-dFPC_ARMEL -CfSOFT' $(BUILDOPTS)
+	$(MAKE) -C fpcsrc packages_smart 'OPT=-dFPC_ARMEL -CfSOFT' $(BUILDOPTS)
+	$(MAKE) -C fpcsrc ide_all 'OPT=-dFPC_ARMEL -CfSOFT' $(BUILDOPTS)
+	$(MAKE) -C fpcsrc utils_all 'OPT=-dFPC_ARMEL -CfSOFT' $(BUILDOPTS)
 	touch build-arch-stamp
 
 install-arch: build-arch install-arch-stamp

Reply to: