Add patch for assembler code alignment, fixes RHBZ#1526848.

This commit is contained in:
Richard Shaw 2018-03-04 07:13:44 -06:00
parent 6dc6da0575
commit b6e2a112bc
2 changed files with 28 additions and 1 deletions

20
fpc-r38400.patch Normal file
View File

@ -0,0 +1,20 @@
--- a/rtl/linux/x86_64/si_c.inc
+++ b/rtl/linux/x86_64/si_c.inc
@@ -158,6 +158,7 @@ procedure _FPC_libc_haltproc; assembler;
movq ExitCode@GOTPCREL(%rip),%rax
movzwq (%rax),%rax { load and save exitcode }
+ popq %rdx { keep stack aligned }
movq fpc_ret(%rip),%rdx { return to libc }
movq fpc_ret_rbp(%rip),%rbp
pushq %rdx
--- a/rtl/linux/x86_64/cprt0.as
+++ b/rtl/linux/x86_64/cprt0.as
@@ -111,6 +111,7 @@ _haltproc:
movq ___fpc_ret_rbp@GOTPCREL(%rip),%rcx
movq (%rcx),%rbp
movq ___fpc_ret@GOTPCREL(%rip),%rcx
+ popq %rdx
movq (%rcx),%rdx
pushq %rdx
ret

View File

@ -7,7 +7,7 @@
Name: fpc
Version: 3.0.4
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Free Pascal Compiler
Group: Development/Languages
@ -33,6 +33,8 @@ Patch0: fpc-3.0.4-r1448.patch
# On Fedora we do not want stabs debug-information. (even on 32 bit platforms)
# https://bugzilla.redhat.com/show_bug.cgi?id=1475223
Patch1: fpc-3.0.4-dwarfdebug.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1526848
Patch2: fpc-r38400.patch
Requires: gpm, ncurses, binutils
%if ! 0%{?bootstrap}
@ -104,6 +106,8 @@ automatical-code generation purposes.
%endif
%patch0
%patch1
pushd fpcsrc
%patch2 -p1
%build
# The source-files:
@ -214,6 +218,9 @@ rm -rf %{buildroot}/usr/lib/%{name}/lexyacc
%changelog
* Sat Mar 03 2018 Richard Shaw <hobbes1069@gmail.com> - 3.0.4-2
- Add patch to fix assembly alignment code, fixes #1526848.
* Thu Mar 01 2018 Joost van der Sluis <joost@cnoc.nl> - 3.0.4-1
- Generate Dwarf debug by default on 32-bit targets (rhbz#1475223)
- Use the %license macro instead of %doc for licence files