From: Matthias Kilian Subject: Re: Upgrade lang/ghc to 9.6.6 To: Greg Steuck Cc: ports@openbsd.org Date: Tue, 9 Jul 2024 21:31:03 +0200 Hi, On Tue, Jul 09, 2024 at 09:44:55AM +0200, Greg Steuck wrote: > > The ports tree dependencies all built fine. I'll look into why one test > > failed, but otherwise, does this look OK? > > I found the patch to backport. All the tests pass now with this added: Ok for both (update and this additional patch). I've already copied your bootstrap files to the usual place. Ciao, Kili > >From 7bf4b189deb0b1446a099ba9786ca7f8b8434d94 Mon Sep 17 00:00:00 2001 > From: Greg Steuck > Date: Tue, 9 Jul 2024 00:40:48 -0700 > Subject: [PATCH] Backport of #12975 fix > > --- > ...patch-compiler_GHC_CmmToAsm_X86_CodeGen_hs | 49 +++++++++++++++++++ > 1 file changed, 49 insertions(+) > create mode 100644 lang/ghc/patches/patch-compiler_GHC_CmmToAsm_X86_CodeGen_hs > > diff --git a/lang/ghc/patches/patch-compiler_GHC_CmmToAsm_X86_CodeGen_hs b/lang/ghc/patches/patch-compiler_GHC_CmmToAsm_X86_CodeGen_hs > new file mode 100644 > index 00000000000..46e68344457 > --- /dev/null > +++ b/lang/ghc/patches/patch-compiler_GHC_CmmToAsm_X86_CodeGen_hs > @@ -0,0 +1,49 @@ > +Backport of #12975 fix. Minimally manually fixed up from > +https://gitlab.haskell.org/ghc/ghc/-/commit/a82121b3b6fdc2ac47211f71871b3ab21e5f6276 > + > +Index: compiler/GHC/CmmToAsm/X86/CodeGen.hs > +--- compiler/GHC/CmmToAsm/X86/CodeGen.hs.orig > ++++ compiler/GHC/CmmToAsm/X86/CodeGen.hs > +@@ -2437,10 +2437,11 @@ genCCall32 :: CmmExpr -- ^ address of the fu > + -> [CmmFormal] -- ^ where to put the result > + -> [CmmActual] -- ^ arguments (of mixed type) > + -> NatM InstrBlock > +-genCCall32 addr conv dest_regs args = do > ++genCCall32 addr conv@(ForeignConvention _ argHints _ _) dest_regs args = do > + config <- getConfig > + let platform = ncgPlatform config > +- prom_args = map (maybePromoteCArg platform W32) args > ++ args_hints = zip args (argHints ++ repeat NoHint) > ++ prom_args = map (maybePromoteCArg platform W32) args_hints > + > + -- If the size is smaller than the word, we widen things (see maybePromoteCArg) > + arg_size_bytes :: CmmType -> Int > +@@ -2594,10 +2595,11 @@ genCCall64 :: CmmExpr -- ^ address of functi > + -> [CmmFormal] -- ^ where to put the result > + -> [CmmActual] -- ^ arguments (of mixed type) > + -> NatM InstrBlock > +-genCCall64 addr conv dest_regs args = do > ++genCCall64 addr conv@(ForeignConvention _ argHints _ _) dest_regs args = do > + platform <- getPlatform > + -- load up the register arguments > +- let prom_args = map (maybePromoteCArg platform W32) args > ++ let args_hints = zip args (argHints ++ repeat NoHint) > ++ let prom_args = map (maybePromoteCArg platform W32) args_hints > + > + let load_args :: [CmmExpr] > + -> [Reg] -- int regs avail for args > +@@ -2835,9 +2837,11 @@ genCCall64 addr conv dest_regs args = do > + assign_code dest_regs) > + > + > +-maybePromoteCArg :: Platform -> Width -> CmmExpr -> CmmExpr > +-maybePromoteCArg platform wto arg > +- | wfrom < wto = CmmMachOp (MO_UU_Conv wfrom wto) [arg] > ++maybePromoteCArg :: Platform -> Width -> (CmmExpr, ForeignHint) -> CmmExpr > ++maybePromoteCArg platform wto (arg, hint) > ++ | wfrom < wto = case hint of > ++ SignedHint -> CmmMachOp (MO_SS_Conv wfrom wto) [arg] > ++ _ -> CmmMachOp (MO_UU_Conv wfrom wto) [arg] > + | otherwise = arg > + where > + wfrom = cmmExprWidth platform arg > -- > 2.45.2 >