diff --git a/fpc-r38400.patch b/fpc-r38400.patch new file mode 100644 index 0000000..472c4ed --- /dev/null +++ b/fpc-r38400.patch @@ -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 diff --git a/fpc.spec b/fpc.spec index 2ea54b7..972b804 100644 --- a/fpc.spec +++ b/fpc.spec @@ -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 - 3.0.4-2 +- Add patch to fix assembly alignment code, fixes #1526848. + * Thu Mar 01 2018 Joost van der Sluis - 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