summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authormazen.neifer <mazen.neifer@b4165226-8c1b-0410-80e1-07324e54c907>2009-05-30 16:59:56 +0000
committermazen.neifer <mazen.neifer@b4165226-8c1b-0410-80e1-07324e54c907>2009-05-30 16:59:56 +0000
commit9c5fc65a9c64262a55728efd1ad2cf6498970889 (patch)
tree21ca050e39661cc96226eabb7b70194d1f02b776 /debian/patches
parente596c4468d17cfd40e1879bffb69fc753251a731 (diff)
downloadfpc-9c5fc65a9c64262a55728efd1ad2cf6498970889.tar.gz
* Fixed wrong passing of function parameters for powerpc architecture. (Closes: Bug#515035, Bug#511626)
git-svn-id: https://bollin.googlecode.com/svn/fpc/trunk@4068 b4165226-8c1b-0410-80e1-07324e54c907
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/powerpc.diff44
-rw-r--r--debian/patches/series1
2 files changed, 45 insertions, 0 deletions
diff --git a/debian/patches/powerpc.diff b/debian/patches/powerpc.diff
new file mode 100644
index 00000000..8427bec7
--- /dev/null
+++ b/debian/patches/powerpc.diff
@@ -0,0 +1,44 @@
+This patch fixes wrong passing of function parameters for powerpc architecture.
+
+--- fpc-2.2.4~/fpcsrc/compiler/powerpc/cpupara.pas
++++ fpc-2.2.4/fpcsrc/compiler/powerpc/cpupara.pas
+@@ -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/debian/patches/series b/debian/patches/series
index 176ff647..f4173989 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ manpages.diff
version.diff
sysconst.diff
findfirst.diff
+powerpc.diff