From 4d78e659928a3c1746841e9bd65b6ab4de729cdd Mon Sep 17 00:00:00 2001 From: Joost van der Sluis Date: Oct 08 2009 13:06:19 +0000 Subject: - fixed procvar parameter passing on ppc/sysv (by value instead of by reference -- except for method procvars, for tmethod record compatibility) --- diff --git a/fpc-2.2.4-r12475.patch b/fpc-2.2.4-r12475.patch new file mode 100644 index 0000000..31b2946 --- /dev/null +++ b/fpc-2.2.4-r12475.patch @@ -0,0 +1,44 @@ +Index: fpcsrc/compiler/powerpc/cpupara.pas +=================================================================== +--- fpcsrc/compiler/powerpc/cpupara.pas (revision 12474) ++++ fpcsrc/compiler/powerpc/cpupara.pas (revision 12475) +@@ -130,7 +130,12 @@ + result:=LOC_REGISTER; + classrefdef: + result:=LOC_REGISTER; +- procvardef, ++ procvardef: ++ if (target_info.abi = abi_powerpc_aix) or ++ (p.size = sizeof(pint)) then ++ result:=LOC_REGISTER ++ else ++ result:=LOC_REFERENCE; + recorddef: + if (target_info.abi<>abi_powerpc_aix) or + ((p.size >= 3) and +@@ -181,8 +186,24 @@ + variantdef, + formaldef : + result:=true; +- recorddef, ++ { regular procvars must be passed by value, because you cannot pass ++ the address of a local stack location when calling e.g. ++ pthread_create with the address of a function (first of all it ++ expects the address of the function to execute and not the address ++ of a memory location containing that address, and secondly if you ++ first store the address on the stack and then pass the address of ++ this stack location, then this stack location may no longer be ++ valid when the newly started thread accesses it. ++ ++ However, for "procedure of object" we must use the same calling ++ convention as for "8 byte record" due to the need for ++ interchangeability with the TMethod record type. ++ } + procvardef : ++ result:= ++ (target_info.abi <> abi_powerpc_aix) and ++ (def.size <> sizeof(pint)); ++ recorddef : + result := + (target_info.abi<>abi_powerpc_aix) or + ((varspez = vs_const) and diff --git a/fpc.spec b/fpc.spec index 345f2de..9c50c51 100644 --- a/fpc.spec +++ b/fpc.spec @@ -1,6 +1,6 @@ Name: fpc Version: 2.2.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Free Pascal Compiler Group: Development/Languages @@ -14,6 +14,7 @@ Source0: ftp://ftp.freepascal.org/pub/fpc/dist/source-%{version}/%{name}b Patch0: %{name}-%{version}-samplecfg_32and64bit.patch Patch1: %{name}-%{version}-build-id.patch Patch2: %{name}-%{version}-stackexecute.patch +Patch3: %{name}-%{version}-r12475.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: gpm, glibc, ncurses, binutils @@ -53,18 +54,16 @@ automatical-code generation purposes. %define smart _smart +%define fpcdebugopt -gl %ifarch ppc %define ppcname ppcppc -%define fpcdebugopt -gl %else %ifarch x86_64 %define ppcname ppcx64 %else %ifarch ppc64 -%define ppcname ppcppc64 %else %define ppcname ppc386 -%define fpcdebugopt -gl %endif %endif %endif @@ -78,6 +77,7 @@ automatical-code generation purposes. %patch0 %patch1 %patch2 +%patch3 %build # The source-files: @@ -177,6 +177,10 @@ rm -rf %{buildroot} %{_datadir}/fpcsrc %changelog +* Tue Oct 6 2009 Joost van der Sluis 2.2.4-4 +- fixed procvar parameter passing on ppc/sysv (by value instead of by + reference -- except for method procvars, for tmethod record compatibility) + * Fri Jul 24 2009 Fedora Release Engineering - 2.2.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild