home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   linux.debian.bugs.dist      Ohh some weird Debian bug report thing      28,835 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 27,003 of 28,835   
   fanpeng to All   
   Bug#1125455: ghc: enable ld override for   
   10 Feb 26 03:40:01   
   
   From: fanpeng@loongson.cn   
      
   This is a multi-part message in MIME format.   
   Yes, It‘s also possible to use only the parameters in EXTRA_HADRIAN_FLAGS.   
      
   In addition, I notice that the content of this patch 0004-* patch will   
   conflict, but this modification for Loong64 is necessary if the LLvm   
   backend is used.   
      
      
   diff --git a/compiler/GHC/CmmToLlvm.hs b/compiler/GHC/CmmToLlvm.hs   
   index de5d84c..ac52827 100644   
   --- a/compiler/GHC/CmmToLlvm.hs   
   +++ b/compiler/GHC/CmmToLlvm.hs   
   @@ -219,7 +219,13 @@ cmmMetaLlvmPrelude = do   
                 ArchX86_64 | llvmCgAvxEnabled cfg -> [   
   kStackAlignmentMeta 32]   
                 _                     
   Â Â Â Â Â Â Â Â Â Â Â Â Â  -> []   
       module_flags_metas <- mkModuleFlagsMeta stack_alignment_metas   
   -  let metas = tbaa_metas ++ module_flags_metas   
   +  let code_model_metas =   
   +          case platformArch platform of   
   +            -- FIXME: We should not rely on LLVM   
   +            ArchLoongArch64 -> [mkCodeModelMeta CMMedium]   
   +            _                      
   Â Â Â Â Â Â Â Â Â Â Â Â  -> []   
   +  mcmodel_flags_metas <- mkModuleFlagsMeta code_model_metas   
   +  let metas = tbaa_metas ++ module_flags_metas ++ mcmodel_flags_metas   
       cfg <- getConfig   
       renderLlvm (ppLlvmMetas cfg metas)   
                  (ppLlvmMetas cfg metas)   
   @@ -241,6 +247,15 @@ mkStackAlignmentMeta :: Integer -> ModuleFlag   
     mkStackAlignmentMeta alignment =   
         ModuleFlag MFBError "override-stack-alignment" (MetaLit $ LMIntLit   
   alignment i32)   
      
   +-- LLVM's @LLVM::CodeModel::Model@ enumeration   
   +data CodeModel = CMMedium   
   +   
   +-- Pass -mcmodel=medium option to LLVM on LoongArch64   
   +mkCodeModelMeta :: CodeModel -> ModuleFlag   
   +mkCodeModelMeta codemodel =   
   +    ModuleFlag MFBError "Code Model" (MetaLit $ LMIntLit n i32)   
   +  where   
   +    n = case codemodel of CMMedium -> 3 -- as of LLVM 8   
      
     --   
   -----------------------------------------------------------------------------   
     -- | Marks variables as used where necessary   
      
      
   On Sun, 25 Jan 2026 09:53:36 +0100 John Paul Adrian Glaubitz wrote:   
      
    > Hi fanpeng,   
    >   
    > On Wed, 2026-01-14 at 06:32 +0000, fanpeng wrote:   
    > > And the 0005-* patch is also required for C files.   
    >   
    > Did you forget this particular patch? I'm not seeing it here.   
    >   
    > Why not just keep the parameters in EXTRA_HADRIAN_FLAGS?   
    >   
    > Adrian   
    >   
    >   
    > --   
    > .''`. John Paul Adrian Glaubitz   
    > : :' : Debian Developer   
    > `. `' Physicist   
    > `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913   
    >   
    >   
      
      
      
        
          
        
        
       

Yes, It‘s also possible to use only the parameters in        EXTRA_HADRIAN_FLAGS.
       

       

In addition, I notice that the content of this patch 0004-* patch        will conflict, but this modification for Loong64 is necessary if        the LLvm backend is used.
       

       


       

       

diff --git a/compiler/GHC/CmmToLlvm.hs        b/compiler/GHC/CmmToLlvm.hs
        index de5d84c..ac52827 100644
        --- a/compiler/GHC/CmmToLlvm.hs
        +++ b/compiler/GHC/CmmToLlvm.hs
        @@ -219,7 +219,13 @@ cmmMetaLlvmPrelude = do
                     ArchX86_64 | llvmCgAvxEnabled cfg ->        [mkStackAlignmentMeta 32]
                     _                        Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  -> []
           module_flags_metas <- mkModuleFlagsMeta        stack_alignment_metas
        -  let metas = tbaa_metas ++ module_flags_metas
        +  let code_model_metas =
        +          case platformArch platform of
        +            -- FIXME: We should not rely on LLVM
        +            ArchLoongArch64 -> [mkCodeModelMeta       CMMedium]
        +            _                       Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  -> []
        +  mcmodel_flags_metas <- mkModuleFlagsMeta code_model_metas
        +  let metas = tbaa_metas ++ module_flags_metas ++        mcmodel_flags_metas
           cfg <- getConfig
           renderLlvm (ppLlvmMetas cfg metas)
                      (ppLlvmMetas cfg metas)
        @@ -241,6 +247,15 @@ mkStackAlignmentMeta :: Integer ->        ModuleFlag
         mkStackAlignmentMeta alignment =
              [continued in next message]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)   


[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca