[Git][haskell-team/DHG_packages][hadrian] 2 commits: ghc: Backport patch for 32-bit unreg
Ilias Tsitsimpis (@iliastsi)
gitlab at salsa.debian.org
Sat Sep 30 12:02:29 BST 2023
Ilias Tsitsimpis pushed to branch hadrian at Debian Haskell Group / DHG_packages
Commits:
97e77602 by Ilias Tsitsimpis at 2023-09-29T21:56:51+03:00
ghc: Backport patch for 32-bit unreg
- - - - -
126dab07 by Ilias Tsitsimpis at 2023-09-30T12:30:00+03:00
ghc: Re-generate the stage2 package cache
I have noticed that on some rare cases the package cache generated for
stage2 is stale. This is probably an upstream bug, and it wouldn't
affect us (the package cache for binary-dist-dir is correct), but we use
ghc-pkg from stage2 when we generate our control file. Maybe we should
consider using ghc-pkg from binary-dist-dir instead.
As a work-around for now, regenerate the stage2 package cache.
Also, drop the hadrian-no-pkg-recache patch for now, since we don't
support cross building GHC yet.
- - - - -
4 changed files:
- + p/ghc/debian/patches/fix-32-bit-unreg
- − p/ghc/debian/patches/hadrian-no-pkg-recache
- p/ghc/debian/patches/series
- p/ghc/debian/rules
Changes:
=====================================
p/ghc/debian/patches/fix-32-bit-unreg
=====================================
@@ -0,0 +1,38 @@
+commit 9194c9c066a31cbb7a49830e4b5e2454fd4af6ba
+Author: Cheng Shao <terrorjack at type.dance>
+Date: Mon Jan 23 13:17:07 2023 +0000
+
+ CmmToC: fix CmmRegOff for 64-bit register on a 32-bit target
+
+ We used to print the offset value to a platform word sized integer.
+ This is incorrect when the offset is negative (e.g. output of cmm
+ constant folding) and the register is 64-bit but on a 32-bit target,
+ and may lead to incorrect runtime result (e.g. #22607).
+
+ The fix is simple: just treat it as a proper MO_Add, with the correct
+ width info inferred from the register itself.
+
+ Metric Increase:
+ T12707
+ T13379
+ T4801
+ T5321FD
+ T5321Fun
+
+ (cherry picked from commit d151546e59a50158f25c3df6728b00d3c27bb4b9)
+
+Index: b/compiler/GHC/CmmToC.hs
+===================================================================
+--- a/compiler/GHC/CmmToC.hs
++++ b/compiler/GHC/CmmToC.hs
+@@ -382,8 +382,8 @@ pprExpr platform e = case e of
+ CmmRegOff reg 0 -> pprCastReg reg
+
+ -- CmmRegOff is an alias of MO_Add
+- CmmRegOff reg i -> pprCastReg reg <> char '+' <>
+- pprHexVal platform (fromIntegral i) (wordWidth platform)
++ CmmRegOff reg i -> pprExpr platform $ CmmMachOp (MO_Add w) [CmmReg reg, CmmLit $ CmmInt (toInteger i) w]
++ where w = cmmRegWidth platform reg
+
+ CmmMachOp mop args -> pprMachOpApp platform mop args
+
=====================================
p/ghc/debian/patches/hadrian-no-pkg-recache deleted
=====================================
@@ -1,22 +0,0 @@
-Description: Do not call 'ghc-pkg recache' in 'make install'
- Do not call 'ghc-pkg recache' during 'make install'. We do that for two reasons:
- .
- * This will fail if we are building a cross compiler, since we
- cannot run 'ghc-pkg recache'.
- * We don't need to do this anyways, since we remove the resulting file
- from the final deb packages. In Debian, we run 'ghc-pkg recache' during
- installation of the package.
-Author: Ilias Tsitsimpis <iliastsi at debian.org>
-
-Index: b/hadrian/bindist/Makefile
-===================================================================
---- a/hadrian/bindist/Makefile
-+++ b/hadrian/bindist/Makefile
-@@ -230,7 +230,6 @@ update_package_db: install_bin install_l
- @echo "Updating the package DB"
- $(foreach p, $(PKG_CONFS),\
- $(call patchpackageconf,$(shell echo $(notdir $p) | sed 's/-\([0-9]*[0-9]\.\)*conf//g'),$(shell echo "$p" | sed 's:\0xxx\0: :g'),$(docdir),$(shell realpath -z --relative-to="$(ActualLibsDir)" "$(docdir)"),$(shell echo $(notdir $p) | sed 's/.conf//g')))
-- '$(DESTDIR)$(ActualBinsDir)/$(CrossCompilePrefix)ghc-pkg' --global-package-db "$(DESTDIR)$(ActualLibsDir)/package.conf.d" recache
-
- install_mingw:
- @echo "Installing MingGW"
=====================================
p/ghc/debian/patches/series
=====================================
@@ -14,7 +14,7 @@ hadrian-relpath
hadrian-iserv
allow-setting-llvm-program
fix-cross-compilation
-hadrian-no-pkg-recache
sparc-support
hadrian-disable-threaded
fix-hs_cmpxchg64
+fix-32-bit-unreg
=====================================
p/ghc/debian/rules
=====================================
@@ -154,6 +154,13 @@ endif
--docs=no-haddocks --docs=no-sphinx-html --docs=no-sphinx-pdfs \
binary-dist-dir \
$(EXTRA_HADRIAN_FLAGS)
+ # I have noticed that on some rare cases the package cache
+ # generated for stage2 is stale. This is probably an upstream bug,
+ # and it wouldn't affect us (the package cache for binary-dist-dir is
+ # correct), but we use ghc-pkg from stage2 when we generate our control file.
+ # Maybe we should consider using ghc-pkg from binary-dist-dir instead.
+ # As a work-around for now, regenerate the stage2 package cache.
+ _build/stage1/bin/ghc-pkg recache
# This rule is a superset of 'override_dh_auto_build-arch'. It builds everything
# that the '-arch' rule builds, and then docs on top.
@@ -170,6 +177,13 @@ endif
--docs=no-sphinx-pdfs \
binary-dist-dir \
$(EXTRA_HADRIAN_FLAGS)
+ # I have noticed that on some rare cases the package cache
+ # generated for stage2 is stale. This is probably an upstream bug,
+ # and it wouldn't affect us (the package cache for binary-dist-dir is
+ # correct), but we use ghc-pkg from stage2 when we generate our control file.
+ # Maybe we should consider using ghc-pkg from binary-dist-dir instead.
+ # As a work-around for now, regenerate the stage2 package cache.
+ _build/stage1/bin/ghc-pkg recache
# --------------------------------------------------------------------
@@ -329,6 +343,9 @@ ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
@printf "====BEGIN GHC INFO OUTPUT====\n"
@_build/stage1/bin/ghc --info
@printf "====END GHC INFO OUTPUT====\n"
+ @printf "====BEGIN GHC-PKG OUTPUT====\n"
+ @_build/stage1/bin/ghc-pkg list
+ @printf "====END GHC-PKG OUTPUT====\n"
endif
override_dh_compress:
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/compare/87dffddf64bf5583db6dfc01b650ee31b01a274d...126dab0760c104179cb138d6d61e1641c9535724
--
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/compare/87dffddf64bf5583db6dfc01b650ee31b01a274d...126dab0760c104179cb138d6d61e1641c9535724
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20230930/684a64d0/attachment-0001.htm>
More information about the Pkg-haskell-commits
mailing list