Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc for openSUSE:Factory checked in 
at 2025-10-16 17:38:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc (Old)
 and      /work/SRC/openSUSE:Factory/.ghc.new.18484 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc"

Thu Oct 16 17:38:48 2025 rev:118 rq:1311509 version:9.12.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc/ghc.changes  2025-08-06 14:35:17.621069881 
+0200
+++ /work/SRC/openSUSE:Factory/.ghc.new.18484/ghc.changes       2025-10-16 
17:38:57.216926919 +0200
@@ -1,0 +2,8 @@
+Wed Oct 15 13:59:39 UTC 2025 - Ondřej Súkup <[email protected]>
+
+- cleanup _constraints and use higher values for ram and disk
+- add aarch64_inter_far.patch to add new ghc-option on aarch64 ncg
+- use workaround to bypass linker problems on aarch64
+- cleanup deps 
+
+-------------------------------------------------------------------

New:
----
  aarch64_inter_far.patch

----------(New B)----------
  New:- cleanup _constraints and use higher values for ram and disk
- add aarch64_inter_far.patch to add new ghc-option on aarch64 ncg
- use workaround to bypass linker problems on aarch64
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc.spec ++++++
--- /var/tmp/diff_new_pack.c8ajA8/_old  2025-10-16 17:38:57.996959534 +0200
+++ /var/tmp/diff_new_pack.c8ajA8/_new  2025-10-16 17:38:58.000959700 +0200
@@ -17,7 +17,7 @@
 %define full_version 9.12.2
 %define short_version 9.12.2
 
-%global llvm_major 18
+%global llvm_major 19
 
 # conditionals
 # disable prof, docs, perf build
@@ -90,25 +90,20 @@
 Patch3:         Cabal-absolute-datadir.patch
 Patch200:       ghc-hadrian-s390x-rts--qg.patch
 Patch400:       gnu23-hp2ps.patch
+Patch500:       aarch64_inter_far.patch
 
-BuildRequires:  binutils-devel
-BuildRequires:  gcc-PIE
+BuildRequires:  binutils
 BuildRequires:  gcc-c++
 BuildRequires:  ghc-bootstrap >= 9.8
 BuildRequires:  ghc-bootstrap-helpers >= 1.3
 BuildRequires:  ghc-rpm-macros-extra => 2.9.1
 BuildRequires:  glibc-devel
 BuildRequires:  gmp-devel
-BuildRequires:  libdw-devel
 BuildRequires:  libelf-devel
 BuildRequires:  libffi-devel
-BuildRequires:  libdwarf-devel
 BuildRequires:  libtool
-%ifarch %{ghc_llvm_archs}
 BuildRequires:  clang%{llvm_major}
 BuildRequires:  llvm%{llvm_major}
-BuildRequires:  llvm%{llvm_major}-devel
-%endif
 BuildRequires:  memory-constraints
 BuildRequires:  ncurses-devel
 BuildRequires:  pkgconfig
@@ -171,6 +166,9 @@
 %ifarch %{ghc_llvm_archs}
 Requires:       clang%{llvm_major}
 Requires:       llvm%{llvm_major}
+%else
+Suggests:       clang%{llvm_major}
+Suggests:       llvm%{llvm_major}
 %endif
 
 %description compiler
@@ -307,6 +305,7 @@
 %endif
 
 %patch -P 400 -p1
+%patch -P 500 -p1
 
 rm libffi-tarballs/libffi-*.tar.gz
 
@@ -318,9 +317,11 @@
 
 %ghc_set_gcc_flags
 
+export LANG=C.utf8
 export CC=%{_bindir}/gcc
+export LLC=%{_bindir}/llc-%{llvm_major}
+export OPT=%{_bindir}/opt-%{llvm_major}
 export LD=%{_bindir}/ld
-export LANG=C.utf8
 
 autoupdate
 
@@ -332,7 +333,7 @@
   --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
   --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
   --docdir=%{_docdir}/%{name}-%{version} \
-  --with-system-libffi \
+  --with-system-libffi  --disable-ld-override \
 %ifarch %{ghc_unregisterized_arches}
   --enable-unregisterised \
 %endif
@@ -345,17 +346,11 @@
 %endif
 %define hadrian_docs %{!?with_haddock:--docs=no-haddocks} 
%{!?with_manual:--docs=no-sphinx}%{?with_manual:--docs=no-sphinx-pdfs 
--docs=no-sphinx-man}
 
-%if 0%{?suse_version} >= 1500
-%ifarch %{unregisterised_archs}
-%limit_build -m 8000
-%else
-%limit_build -m 2000
-%endif
-%global jobs_nr %{?_smp_mflags}
-%else
-%global jobs_nr -j1 
+%ifarch aarch64
+%global hadrian_workaround "stage1.*.ghc.*.opts += -finter-module-far-jumps"
 %endif
-%{hadrian} %{jobs_nr} 
--flavour=%{?with_quickbuild:quick+no_profiled_libs}%{!?with_quickbuild:release%{!?with_ghc_prof:+no_profiled_libs}}%{?hadrian_llvm}
 %{hadrian_docs} binary-dist-dir --hash-unit-ids
+
+%{hadrian} %{?_smp_mflags} 
--flavour=%{?with_quickbuild:quick+no_profiled_libs}%{!?with_quickbuild:release%{!?with_ghc_prof:+no_profiled_libs}}%{?hadrian_llvm}
 %{hadrian_docs} %{?hadrian_workaround} binary-dist-dir --hash-unit-ids
 
 %install
 

++++++ _constraints ++++++
--- /var/tmp/diff_new_pack.c8ajA8/_old  2025-10-16 17:38:58.044961541 +0200
+++ /var/tmp/diff_new_pack.c8ajA8/_new  2025-10-16 17:38:58.048961707 +0200
@@ -1,42 +1,11 @@
 <constraints>
   <hardware>
     <disk>
-      <size unit="G">16</size>
+      <size unit="G">32</size>
     </disk> 
     <physicalmemory>
-      <size unit="G">4</size>
+      <size unit="G">16</size>
     </physicalmemory>
   </hardware>
- <overwrite>
-    <conditions>
-      <arch>aarch64</arch>
-      <arch>s390x</arch>
-    </conditions>
-    <hardware>
-      <physicalmemory>
-        <size unit="G">10</size>
-      </physicalmemory>
-    </hardware>
-  </overwrite>
-  <overwrite>
-    <conditions>
-      <arch>riscv64</arch>
-    </conditions>
-    <hardware>
-      <disk>
-       <size unit="G">30</size>
-      </disk> 
-    </hardware>
-  </overwrite>
- <overwrite>
-    <conditions>
-      <arch>loongarch64</arch>
-    </conditions>
-    <hardware>
-      <physicalmemory>
-        <size unit="G">16</size>
-      </physicalmemory>
-    </hardware>
-  </overwrite>
 </constraints>
 

++++++ aarch64_inter_far.patch ++++++
>From 8fe9b012907fb5d84eefaa60980f7024b3951fcd Mon Sep 17 00:00:00 2001
From: Andreas Klebinger <[email protected]>
Date: Thu, 18 Apr 2024 13:25:18 +0200
Subject: [PATCH] NCG: AArch64 - Add -finter-module-far-jumps.

When enabled the arm backend will assume jumps to targets outside of the
current module are further than 128MB away.

This will allow for code to work if:
* The current module results in less than 128MB of code.
* The whole program is loaded within a 4GB memory region.

We have seen a few reports of broken linkers (#24648) where this flag might 
allow
a program to compile/run successfully at a very small performance cost.

-------------------------
Metric Increase:
    T783
-------------------------

(cherry picked from commit f32d6c2b468c67fed619f2fa1fb97eb012afbb6e)
---
 compiler/GHC/CmmToAsm/AArch64/CodeGen.hs | 17 ++++++++++++++---
 compiler/GHC/CmmToAsm/Config.hs          |  1 +
 compiler/GHC/Driver/Config/CmmToAsm.hs   |  1 +
 compiler/GHC/Driver/DynFlags.hs          |  1 -
 compiler/GHC/Driver/Flags.hs             |  2 ++
 compiler/GHC/Driver/Session.hs           |  1 +
 docs/users_guide/using-optimisation.rst  | 17 +++++++++++++++++
 7 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs 
b/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
index f58e507f110f..4ed3c90c7644 100644
--- a/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
+++ b/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
@@ -23,7 +23,7 @@ import GHC.Cmm.DebugBlock
 import GHC.CmmToAsm.Monad
    ( NatM, getNewRegNat
    , getPicBaseMaybeNat, getPlatform, getConfig
-   , getDebugBlock, getFileId
+   , getDebugBlock, getFileId, getThisModuleNat
    )
 -- import GHC.CmmToAsm.Instr
 import GHC.CmmToAsm.PIC
@@ -1471,8 +1471,19 @@ assignReg_FltCode = assignReg_IntCode
 -- Jumps
 
 genJump :: CmmExpr{-the branch target-} -> NatM InstrBlock
-genJump expr@(CmmLit (CmmLabel lbl))
-  = return $ unitOL (annExpr expr (J (TLabel lbl)))
+genJump expr@(CmmLit (CmmLabel lbl)) = do
+  cur_mod <- getThisModuleNat
+  !useFarJumps <- ncgEnableInterModuleFarJumps <$> getConfig
+  let is_local = isLocalCLabel cur_mod lbl
+
+  -- We prefer to generate a near jump using a simble `B` instruction
+  -- with a range (+/-128MB). But if the target is outside the current module
+  -- we might have to account for large code offsets. (#24648)
+  if not useFarJumps || is_local
+    then return $ unitOL (annExpr expr (J (TLabel lbl)))
+    else do
+      (target, _format, code) <- getSomeReg expr
+      return (code `appOL` unitOL (annExpr expr (J (TReg target))))
 
 genJump expr = do
     (target, _format, code) <- getSomeReg expr
diff --git a/compiler/GHC/CmmToAsm/Config.hs b/compiler/GHC/CmmToAsm/Config.hs
index f4c39ac83c6a..422efa36ab74 100644
--- a/compiler/GHC/CmmToAsm/Config.hs
+++ b/compiler/GHC/CmmToAsm/Config.hs
@@ -47,6 +47,7 @@ data NCGConfig = NCGConfig
    , ncgDwarfSourceNotes      :: !Bool            -- ^ Enable GHC-specific 
source note DIEs
    , ncgCmmStaticPred         :: !Bool            -- ^ Enable static 
control-flow prediction
    , ncgEnableShortcutting    :: !Bool            -- ^ Enable shortcutting 
(don't jump to blocks only containing a jump)
+   , ncgEnableInterModuleFarJumps:: !Bool            -- ^ Use far-jumps for 
cross-module jumps.
    , ncgComputeUnwinding      :: !Bool            -- ^ Compute block unwinding 
tables
    , ncgEnableDeadCodeElimination :: !Bool        -- ^ Whether to enable the 
dead-code elimination
    }
diff --git a/compiler/GHC/Driver/Config/CmmToAsm.hs 
b/compiler/GHC/Driver/Config/CmmToAsm.hs
index 762108b8b23e..1475c40b8219 100644
--- a/compiler/GHC/Driver/Config/CmmToAsm.hs
+++ b/compiler/GHC/Driver/Config/CmmToAsm.hs
@@ -70,6 +70,7 @@ initNCGConfig dflags this_mod = NCGConfig
    , ncgExposeInternalSymbols = gopt Opt_ExposeInternalSymbols dflags
    , ncgCmmStaticPred       = gopt Opt_CmmStaticPred dflags
    , ncgEnableShortcutting  = gopt Opt_AsmShortcutting dflags
+   , ncgEnableInterModuleFarJumps = gopt Opt_InterModuleFarJumps dflags
    , ncgComputeUnwinding    = debugLevel dflags > 0
    , ncgEnableDeadCodeElimination = not (gopt Opt_InfoTableMap dflags)
                                      -- Disable when -finfo-table-map is on 
(#20428)
diff --git a/compiler/GHC/Driver/DynFlags.hs b/compiler/GHC/Driver/DynFlags.hs
index a24ea13e5caa..469537b7caa2 100644
--- a/compiler/GHC/Driver/DynFlags.hs
+++ b/compiler/GHC/Driver/DynFlags.hs
@@ -1194,7 +1194,6 @@ defaultFlags settings
 
     ++ validHoleFitDefaults
 
-
     where platform = sTargetPlatform settings
 
 -- | These are the default settings for the display and sorting of valid hole
diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs
index 583a8530eca7..fc8d75ed13fe 100644
--- a/compiler/GHC/Driver/Flags.hs
+++ b/compiler/GHC/Driver/Flags.hs
@@ -647,6 +647,7 @@ data GeneralFlag
    | Opt_CmmElimCommonBlocks
    | Opt_CmmControlFlow
    | Opt_AsmShortcutting
+   | Opt_InterModuleFarJumps
    | Opt_OmitYields
    | Opt_FunToThunk               -- deprecated
    | Opt_DictsStrict                     -- be strict in argument dictionaries
@@ -896,6 +897,7 @@ optimisationFlags = EnumSet.fromList
    , Opt_CmmSink
    , Opt_CmmElimCommonBlocks
    , Opt_AsmShortcutting
+   , Opt_InterModuleFarJumps
    , Opt_FunToThunk
    , Opt_DmdTxDictSel
    , Opt_Loopification
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index 74490ba91f9b..804e11b28d90 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -2453,6 +2453,7 @@ fFlagsDeps = [
   flagSpec "gen-manifest"                     Opt_GenManifest,
   flagSpec "ghci-history"                     Opt_GhciHistory,
   flagSpec "ghci-leak-check"                  Opt_GhciLeakCheck,
+  flagSpec "inter-module-far-jumps"               Opt_InterModuleFarJumps,
   flagSpec "validate-ide-info"                Opt_ValidateHie,
   flagGhciSpec "local-ghci-history"           Opt_LocalGhciHistory,
   flagGhciSpec "no-it"                        Opt_NoIt,
diff --git a/docs/users_guide/using-optimisation.rst 
b/docs/users_guide/using-optimisation.rst
index f57a1ba32278..ffb371150edd 100644
--- a/docs/users_guide/using-optimisation.rst
+++ b/docs/users_guide/using-optimisation.rst
@@ -681,6 +681,23 @@ as such you shouldn't need to set any of them explicitly. 
A flag
     ``-fno-full-laziness``. If that is inconvenient for you, please leave a
     comment `on the issue tracker (#21204) 
<https://gitlab.haskell.org/ghc/ghc/-/issues/21204>`__.
 
+.. ghc-flag:: -finter-module-far-jumps
+    :shortdesc: Assume code sections can be very large.
+    :type: dynamic
+    :reverse: -fno-inter-module-far-jumps
+    :category:
+
+    :default: Off
+
+    This flag forces GHC to use far jumps instead of near jumps for all jumps
+    which cross module boundries. This removes the need for jump islands/linker
+    jump fixups which some linkers struggle to deal with. (:ghc-ticket:`24648`)
+
+    This comes at a very modest code size (~2%) and runtime (~0.6%) overhead.
+
+    Note that this flag currently only affects the NCG AArch64 backend.
+
+
 .. ghc-flag:: -fignore-asserts
     :shortdesc: Ignore assertions in the source. Implied by :ghc-flag:`-O`.
     :type: dynamic
-- 
GitLab

Reply via email to