From 9cfd63af63d551d091b3503a6c240e3f97202b97 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Thu, 15 Aug 2024 01:04:18 +0300 Subject: [PATCH] import fpc-3.2.2-10.el9 --- .../fpc-3.2.2--arm64-stack-trace-crash.patch | 31 ++++++++++++++ ...-3.2.2--fix-IDE-data-files-locations.patch | 34 +++++++++++++++ SPECS/fpc.spec | 42 ++++++++++++++----- 3 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 SOURCES/fpc-3.2.2--arm64-stack-trace-crash.patch create mode 100644 SOURCES/fpc-3.2.2--fix-IDE-data-files-locations.patch diff --git a/SOURCES/fpc-3.2.2--arm64-stack-trace-crash.patch b/SOURCES/fpc-3.2.2--arm64-stack-trace-crash.patch new file mode 100644 index 0000000..86aa9c1 --- /dev/null +++ b/SOURCES/fpc-3.2.2--arm64-stack-trace-crash.patch @@ -0,0 +1,31 @@ +From 6138f7007aedda85ff5f8004d0c2ccfc3cf47d53 Mon Sep 17 00:00:00 2001 +From: Benito van der Zander +Date: Thu, 18 May 2023 14:11:02 +0200 +Subject: [PATCH] fix aarch64 exception handling + +--- + rtl/aarch64/aarch64.inc | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/rtl/aarch64/aarch64.inc b/rtl/aarch64/aarch64.inc +index 7903589662c..fdcd797c8e4 100644 +--- a/rtl/aarch64/aarch64.inc ++++ b/rtl/aarch64/aarch64.inc +@@ -164,14 +164,11 @@ procedure fpc_cpuinit; + {$define FPC_SYSTEM_HAS_GET_CALLER_ADDR} + function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer;assembler; nostackframe; + asm +- cbz x0, .Lcaller_addr_invalid +- ldur x0, [x0] + cbz x0, .Lcaller_addr_invalid + ldur x0, [x0, #8] + .Lcaller_addr_invalid: + end; + +- + {$define FPC_SYSTEM_HAS_GET_CALLER_FRAME} + function get_caller_frame(framebp:pointer;addr:pointer=nil):pointer;assembler; nostackframe; + asm +-- +GitLab + diff --git a/SOURCES/fpc-3.2.2--fix-IDE-data-files-locations.patch b/SOURCES/fpc-3.2.2--fix-IDE-data-files-locations.patch new file mode 100644 index 0000000..82636c6 --- /dev/null +++ b/SOURCES/fpc-3.2.2--fix-IDE-data-files-locations.patch @@ -0,0 +1,34 @@ +diff -r -U4 fpcbuild-3.2.2--orig/fpcsrc/packages/ide/fpmake.pp fpcbuild-3.2.2--patched/fpcsrc/packages/ide/fpmake.pp +--- fpcbuild-3.2.2--orig/fpcsrc/packages/ide/fpmake.pp 2021-05-13 13:42:31.000000000 +0200 ++++ fpcbuild-3.2.2--patched/fpcsrc/packages/ide/fpmake.pp 2022-12-15 11:08:53.429542281 +0100 +@@ -281,19 +281,19 @@ + T:=P.Targets.AddUnit('compunit.pas'); + T.Directory:='compiler'; + T.Install:=false; + +- P.InstallFiles.Add('fp.ans','$(bininstalldir)'); +- P.InstallFiles.Add('gplprog.pt','$(bininstalldir)'); +- P.InstallFiles.Add('gplunit.pt','$(bininstalldir)'); +- P.InstallFiles.Add('program.pt','$(bininstalldir)'); +- P.InstallFiles.Add('unit.pt','$(bininstalldir)'); +- P.InstallFiles.Add('cvsco.tdf','$(bininstalldir)'); +- P.InstallFiles.Add('cvsdiff.tdf','$(bininstalldir)'); +- P.InstallFiles.Add('cvsup.tdf','$(bininstalldir)'); +- P.InstallFiles.Add('grep.tdf','$(bininstalldir)'); +- P.InstallFiles.Add('tpgrep.tdf','$(bininstalldir)'); +- P.InstallFiles.Add('fp32.ico', [win32, win64], '$(bininstalldir)'); ++ P.InstallFiles.Add('fp.ans','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('gplprog.pt','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('gplunit.pt','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('program.pt','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('unit.pt','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('cvsco.tdf','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('cvsdiff.tdf','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('cvsup.tdf','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('grep.tdf','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('tpgrep.tdf','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('fp32.ico', [win32, win64], '$(baseinstalldir)/ide'); + + with P.Sources do + begin + AddDoc('readme.ide'); diff --git a/SPECS/fpc.spec b/SPECS/fpc.spec index b11c71d..6eadab6 100644 --- a/SPECS/fpc.spec +++ b/SPECS/fpc.spec @@ -6,7 +6,7 @@ Name: fpc Version: 3.2.2 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Free Pascal Compiler License: GPLv2+ and LGPLv2+ with exceptions @@ -77,6 +77,18 @@ Patch4: fpc-3.2.2--ppc64le-toc-fixes.patch # Submitted upstream: https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/185 Patch5: fpc-3.2.2--pas2jni-cthreads.patch +# By default, the textmode IDE installs some data files (templates, ASCII art) +# in the same directory as the executable (i.e. /usr/bin). This patch moves +# the data files inside the main FPC install directory (LIBDIR/fpc/VERSION/ide). +Patch6: fpc-3.2.2--fix-IDE-data-files-locations.patch + +# Fix broken stack trace handling on aarch64, +# which could lead to crashes when an FPC-compiled program used exceptions. +# +# Backport of upstream commit: +# https://gitlab.com/freepascal.org/fpc/source/-/commit/ec9f7c84b46906c3ef153245044ed787eaf1d5bb +Patch7: fpc-3.2.2--arm64-stack-trace-crash.patch + Requires: binutils Requires: gpm Requires: ncurses @@ -158,6 +170,8 @@ automatical-code generation purposes. %endif %endif +%global fpmakeopt %{?_smp_build_ncpus:-T %{_smp_build_ncpus}} + %prep %setup -n fpcbuild-%{version} -q @@ -167,12 +181,14 @@ unzip %{SOURCE100} %endif pushd fpcsrc -%patch0 -%patch1 -%patch2 -%patch3 -p1 -%patch4 -p2 -%patch5 -p1 +%patch -P0 +%patch -P1 +%patch -P2 +%patch -P3 -p1 +%patch -P4 -p2 +%patch -P5 -p1 +%patch -P6 -p2 +%patch -P7 -p1 %build @@ -194,9 +210,10 @@ NEWPP=$(pwd)/compiler/%{ppcname} DATA2INC=$(pwd)/utils/data2inc # FIXME: -j1 as there is a race on armv7hl - seen on "missing" `prt0.o' and 'dllprt0.o'. make -j1 compiler_cycle FPC=${STARTPP} OPT='%{fpcopt} %{fpcdebugopt}' -make %{?_smp_mflags} rtl_clean rtl%{smart} FPC=${NEWPP} OPT='%{fpcopt}' -make %{?_smp_mflags} packages%{smart} FPC=${NEWPP} OPT='%{fpcopt}' -make %{?_smp_mflags} utils_all FPC=${NEWPP} DATA2INC=${DATA2INC} OPT='%{fpcopt} %{fpcdebugopt}' +# No -j here as it has no effect. Parallel compilation is controlled via FPMAKEOPT +make rtl_clean rtl%{smart} FPC=${NEWPP} OPT='%{fpcopt}' FPMAKEOPT='%{fpmakeopt}' +make packages%{smart} FPC=${NEWPP} OPT='%{fpcopt}' FPMAKEOPT='%{fpmakeopt}' +make utils_all FPC=${NEWPP} DATA2INC=${DATA2INC} OPT='%{fpcopt} %{fpcdebugopt}' FPMAKEOPT='%{fpmakeopt}' popd # FIXME: -j1 as there is a race - seen on "missing" `rtl.xct'. @@ -296,6 +313,11 @@ rm -rf %{buildroot}/usr/lib/%{name}/lexyacc %changelog +* Wed Aug 14 2024 Artur Frenszek-Iwicki - 3.2.2-10 +- Add a patch to fix IDE-related non-executable files being installed to /usr/bin +- Add a patch to fix broken stack trace handling on aarch64 +- Use FPMAKEOPT for parallel compilation + * Thu Nov 09 2023 MSVSphere Packaging Team - 3.2.2-9 - Rebuilt for MSVSphere 9.3