diff -Nru fpc-2.6.0/debian/changelog fpc-2.6.0/debian/changelog --- fpc-2.6.0/debian/changelog 2012-07-06 21:25:42.000000000 +0100 +++ fpc-2.6.0/debian/changelog 2012-07-23 23:59:22.000000000 +0100 @@ -1,3 +1,22 @@ +fpc (2.6.0-4+rpi2) unstable; urgency=low + * Add patch to fix inverted exception masking on arm vfp + fix taken from second to hunks of upstream commit by masta. + http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/arm/mathu.inc?r1=20660&r2=21952&view=patch + (first two hunks are wince specific stuff) + * Disable patch that messes with masking of exprecission in compiler, + hopefully it's not needed anymore. + + -- Peter Michael Green Sat, 21 Jul 2012 14:14:29 +0000 + + +fpc (2.6.0-4+rpi1) unstable; urgency=low + * Change compiler defaults for Pi + * Don't try to mask of exprecision, doing so seems to break on the Pi and + doesn't seem to be needed for the compiler to work. + * Build with -gl and don't strip to make failures easier to debug. + + -- Peter Michael Green Sat, 21 Jul 2012 14:14:29 +0000 + fpc (2.6.0-4) unstable; urgency=low [ Peter Michael Green ] diff -Nru fpc-2.6.0/debian/patches/dont-mask-exprecision fpc-2.6.0/debian/patches/dont-mask-exprecision --- fpc-2.6.0/debian/patches/dont-mask-exprecision 1970-01-01 01:00:00.000000000 +0100 +++ fpc-2.6.0/debian/patches/dont-mask-exprecision 2012-07-21 15:27:34.000000000 +0100 @@ -0,0 +1,29 @@ +Description: exprecision + Don't try to mask of exprecision, doing so seems to break on the Pi and + doesn't seem to be needed for the compiler to work. +Author: Peter Michael Green + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- fpc-2.6.0.orig/fpcsrc/compiler/compiler.pas ++++ fpc-2.6.0/fpcsrc/compiler/compiler.pas +@@ -226,7 +226,7 @@ begin + try + ExceptionMask:=GetExceptionMask; + SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, +- exOverflow, exUnderflow, exPrecision]); ++ exOverflow, exUnderflow]); + + starttime:=getrealtime; + diff -Nru fpc-2.6.0/debian/patches/fix-vfp-exceptions.diff fpc-2.6.0/debian/patches/fix-vfp-exceptions.diff --- fpc-2.6.0/debian/patches/fix-vfp-exceptions.diff 1970-01-01 01:00:00.000000000 +0100 +++ fpc-2.6.0/debian/patches/fix-vfp-exceptions.diff 2012-07-23 23:45:58.000000000 +0100 @@ -0,0 +1,60 @@ +--- a/fpcsrc/rtl/arm/mathu.inc 2012/03/29 20:50:09 20660 ++++ b/fpcsrc/rtl/arm/mathu.inc 2012/07/23 07:26:57 21952 +@@ -281,22 +281,22 @@ + Result:=[]; + cw:=VFP_GetCW; + +- if (cw and _VFP_ENABLE_IM)<>0 then ++ if (cw and _VFP_ENABLE_IM)=0 then + include(Result,exInvalidOp); + +- if (cw and _VFP_ENABLE_DM)<>0 then ++ if (cw and _VFP_ENABLE_DM)=0 then + include(Result,exDenormalized); + +- if (cw and _VFP_ENABLE_ZM)<>0 then ++ if (cw and _VFP_ENABLE_ZM)=0 then + include(Result,exZeroDivide); + +- if (cw and _VFP_ENABLE_OM)<>0 then ++ if (cw and _VFP_ENABLE_OM)=0 then + include(Result,exOverflow); + +- if (cw and _VFP_ENABLE_UM)<>0 then ++ if (cw and _VFP_ENABLE_UM)=0 then + include(Result,exUnderflow); + +- if (cw and _VFP_ENABLE_PM)<>0 then ++ if (cw and _VFP_ENABLE_PM)=0 then + include(Result,exPrecision); + end; + +@@ -308,22 +308,22 @@ + cw:=VFP_GetCW and not(_VFP_ENABLE_ALL); + + {$ifndef darwin} +- if exInvalidOp in Mask then ++ if not(exInvalidOp in Mask) then + cw:=cw or _VFP_ENABLE_IM; + +- if exDenormalized in Mask then ++ if not(exDenormalized in Mask) then + cw:=cw or _VFP_ENABLE_DM; + +- if exZeroDivide in Mask then ++ if not(exZeroDivide in Mask) then + cw:=cw or _VFP_ENABLE_ZM; + +- if exOverflow in Mask then ++ if not(exOverflow in Mask) then + cw:=cw or _VFP_ENABLE_OM; + +- if exUnderflow in Mask then ++ if not(exUnderflow in Mask) then + cw:=cw or _VFP_ENABLE_UM; + +- if exPrecision in Mask then ++ if not(exPrecision in Mask) then + cw:=cw or _VFP_ENABLE_PM; + {$endif} + VFP_SetCW(cw); diff -Nru fpc-2.6.0/debian/patches/raspbian.diff fpc-2.6.0/debian/patches/raspbian.diff --- fpc-2.6.0/debian/patches/raspbian.diff 1970-01-01 01:00:00.000000000 +0100 +++ fpc-2.6.0/debian/patches/raspbian.diff 2012-07-21 15:15:21.000000000 +0100 @@ -0,0 +1,45 @@ +Description: Change compiler defaults for raspbian + We need armv6 and vfpv2 rather than armv7 and vfpv3-d16 +Author: Peter Michael Green + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +Index: fpc-2.6.0-4+rpi1/fpcsrc/compiler/options.pas +=================================================================== +--- fpc-2.6.0-4+rpi1.orig/fpcsrc/compiler/options.pas 2012-07-21 14:07:38.000000000 +0000 ++++ fpc-2.6.0-4+rpi1/fpcsrc/compiler/options.pas 2012-07-21 14:09:14.000000000 +0000 +@@ -2832,7 +2832,8 @@ + begin + if not(option.FPUSetExplicitly) then + begin +- init_settings.fputype:=fpu_vfpv3_d16 ++ //RPI -- reduce default fpu to vfpv2 ++ init_settings.fputype:=fpu_vfpv2 + end + else + begin +@@ -2858,10 +2859,11 @@ + { set default cpu type to ARMv7 for ARMHF unless specified otherwise } + if (target_info.abi = abi_eabihf) then + begin ++ // RPI - reduce default CPU to armv6 + if not option.CPUSetExplicitly then +- init_settings.cputype:=cpu_armv7; ++ init_settings.cputype:=cpu_armv6; + if not option.OptCPUSetExplicitly then +- init_settings.optimizecputype:=cpu_armv7; ++ init_settings.optimizecputype:=cpu_armv6; + end; + + {$endif arm} diff -Nru fpc-2.6.0/debian/patches/series fpc-2.6.0/debian/patches/series --- fpc-2.6.0/debian/patches/series 2012-07-02 21:10:07.000000000 +0100 +++ fpc-2.6.0/debian/patches/series 2012-07-23 23:59:40.000000000 +0100 @@ -3,3 +3,5 @@ regenerate_messages.diff fix-FPCDIR-in-fpcmake.diff armhf-linker-path.diff +raspbian.diff +fix-vfp-exceptions.diff diff -Nru fpc-2.6.0/debian/rules fpc-2.6.0/debian/rules --- fpc-2.6.0/debian/rules 2012-07-02 21:10:08.000000000 +0100 +++ fpc-2.6.0/debian/rules 2012-07-21 15:13:30.000000000 +0100 @@ -90,7 +90,7 @@ NEWPP=$(BUILD_DIR)/fpcsrc/compiler/$(PPNEW) NEWFPDOC=$(BUILD_DIR)/fpcsrc/utils/fpdoc/fpdoc # Set default compilation options -BUILDOPTS=PP=$(NEWPP) +BUILDOPTS=PP=$(NEWPP) OPT='-gl' ifdef CROSSOPT BUILDOPTS+= CROSSOPT=${CROSSOPT} endif @@ -105,7 +105,7 @@ ifeq ($(DEBIANARCH),arm) CYCLEOPTS := OPT='-dFPC_OARM' else - CYCLEOPTS := OPT='-dFPC_$(DEBIANARCH)' + CYCLEOPTS := OPT='-dFPC_$(DEBIANARCH) -gl' endif else CYCLEOPTS= @@ -364,7 +364,7 @@ dh_installdocs -a -X.in dh_installchangelogs -a dh_installexamples -a - dh_strip -s + #dh_strip -s dh_compress -a dh_fixperms -a dh_installdebconf -a