Cheng Shao pushed to branch wip/14554-wasm-fix at Glasgow Haskell Compiler / GHC

WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below.

Deleted commits:

6 changed files:

Changes:

  • compiler/GHC/Driver/Session.hs
    ... ... @@ -3502,6 +3502,7 @@ compilerInfo dflags
    3502 3502
            ("target has libm", queryBool tgtHasLibm),
    
    3503 3503
            ("target has .ident directive", queryBool tgtSupportsIdentDirective),
    
    3504 3504
            ("target has subsections via symbols", queryBool tgtSupportsSubsectionsViaSymbols),
    
    3505
    +       ("target RTS linker only supports shared libraries", queryBool tgtRTSLinkerOnlySupportsSharedLibs),
    
    3505 3506
            ("Unregisterised", queryBool tgtUnregisterised),
    
    3506 3507
            ("LLVM target", query tgtLlvmTarget),
    
    3507 3508
            ("LLVM llc command", queryCmdMaybe id tgtLlc),
    

  • compiler/GHC/Settings/IO.hs
    ... ... @@ -146,7 +146,6 @@ initSettings top_dir = do
    146 146
             pure (ld_r_path, map Option ld_r_args)
    
    147 147
           iserv_prog   = libexec "ghc-iserv"
    
    148 148
     
    
    149
    -  targetRTSLinkerOnlySupportsSharedLibs <- getBooleanSetting "target RTS linker only supports shared libraries"
    
    150 149
       ghcWithInterpreter <- getBooleanSetting "Use interpreter"
    
    151 150
     
    
    152 151
       baseUnitId <- getSetting_raw "base unit-id"
    
    ... ... @@ -231,7 +230,7 @@ initSettings top_dir = do
    231 230
           , platformMisc_ghcWithInterpreter = ghcWithInterpreter
    
    232 231
           , platformMisc_libFFI = tgtUseLibffiForAdjustors target
    
    233 232
           , platformMisc_llvmTarget = tgtLlvmTarget target
    
    234
    -      , platformMisc_targetRTSLinkerOnlySupportsSharedLibs = targetRTSLinkerOnlySupportsSharedLibs
    
    233
    +      , platformMisc_targetRTSLinkerOnlySupportsSharedLibs = tgtRTSLinkerOnlySupportsSharedLibs target
    
    235 234
           }
    
    236 235
     
    
    237 236
         , sRawSettings    = settingsList
    

  • hadrian/bindist/Makefile
    ... ... @@ -86,7 +86,6 @@ WrapperBinsDir=${bindir}
    86 86
     lib/settings : config.mk
    
    87 87
     	@rm -f $@
    
    88 88
     	@echo '[("unlit command", "$$topdir/../bin/$(CrossCompilePrefix)unlit")' >> $@
    
    89
    -	@echo ',("target RTS linker only supports shared libraries", "$(TargetRTSLinkerOnlySupportsSharedLibs)")' >> $@
    
    90 89
     	@echo ',("Use interpreter", "$(GhcWithInterpreter)")' >> $@
    
    91 90
     	@echo ',("RTS ways", "$(GhcRTSWays)")' >> $@
    
    92 91
     	@echo ',("Relative Global Package DB", "package.conf.d")' >> $@
    

  • hadrian/src/Oracles/Flag.hs
    ... ... @@ -80,23 +80,8 @@ platformSupportsGhciObjects = do
    80 80
         only_shared_libs <- targetRTSLinkerOnlySupportsSharedLibs
    
    81 81
         pure $ has_merge_objs && not only_shared_libs
    
    82 82
     
    
    83
    --- | Does the target RTS linker only support loading shared libraries?
    
    84
    --- If true, this has several implications:
    
    85
    --- 1. The GHC driver must not do loadArchive/loadObj etc and must
    
    86
    ---    always do loadDLL, regardless of whether host GHC is dynamic or
    
    87
    ---    not.
    
    88
    --- 2. The GHC driver will always enable -dynamic-too when compiling
    
    89
    ---    vanilla way with TH codegen requirement.
    
    90
    --- 3. ghci will always enforce dynamic ways even if -dynamic or
    
    91
    ---    -dynamic-too is not explicitly passed.
    
    92
    --- 4. Cabal must not build ghci objects since it's not supported by
    
    93
    ---    the target.
    
    94
    --- 5. The testsuite driver will use dyn way for TH/ghci tests even
    
    95
    ---    when host GHC is static.
    
    96
    --- 6. TH/ghci doesn't work if stage1 is built without shared libraries
    
    97
    ---    (e.g. quickest/fully_static).
    
    98 83
     targetRTSLinkerOnlySupportsSharedLibs :: Action Bool
    
    99
    -targetRTSLinkerOnlySupportsSharedLibs = anyTargetArch [ ArchWasm32 ]
    
    84
    +targetRTSLinkerOnlySupportsSharedLibs = queryTargetTarget Toolchain.tgtRTSLinkerOnlySupportsSharedLibs
    
    100 85
     
    
    101 86
     arSupportsDashL :: Stage -> Action Bool
    
    102 87
     arSupportsDashL stage = Toolchain.arSupportsDashL . tgtAr <$> targetStage stage
    

  • hadrian/src/Rules/Generate.hs
    ... ... @@ -484,7 +484,6 @@ generateSettings settingsFile = do
    484 484
     
    
    485 485
         settings <- traverse sequence $
    
    486 486
             [ ("unlit command", ("$topdir/../bin/" <>) <$> expr (programName (ctx { Context.package = unlit })))
    
    487
    -        , ("target RTS linker only supports shared libraries", expr $ yesNo <$> targetRTSLinkerOnlySupportsSharedLibs)
    
    488 487
             , ("Use interpreter", expr $ yesNo <$> ghcWithInterpreter (predStage stage))
    
    489 488
             , ("RTS ways", escapeArgs . map show . Set.toList <$> getRtsWays)
    
    490 489
             , ("Relative Global Package DB", pure rel_pkg_db)
    

  • utils/ghc-toolchain/src/GHC/Toolchain/Target.hs
    ... ... @@ -9,7 +9,7 @@ module GHC.Toolchain.Target
    9 9
       , WordSize(..), wordSize2Bytes
    
    10 10
     
    
    11 11
         -- ** Queries
    
    12
    -  , tgtSupportsSMP
    
    12
    +  , tgtSupportsSMP, tgtRTSLinkerOnlySupportsSharedLibs
    
    13 13
     
    
    14 14
         -- ** Lenses
    
    15 15
       , _tgtCC, _tgtCxx, _tgtCpp, _tgtHsCpp
    
    ... ... @@ -183,6 +183,26 @@ tgtSupportsSMP Target{..} = do
    183 183
          | goodArch             -> True
    
    184 184
          | otherwise            -> False
    
    185 185
     
    
    186
    +-- | Does the target RTS linker only support loading shared libraries?
    
    187
    +-- If true, this has several implications:
    
    188
    +-- 1. The GHC driver must not do loadArchive/loadObj etc and must
    
    189
    +--    always do loadDLL, regardless of whether host GHC is dynamic or
    
    190
    +--    not.
    
    191
    +-- 2. The GHC driver will always enable -dynamic-too when compiling
    
    192
    +--    vanilla way with TH codegen requirement.
    
    193
    +-- 3. ghci will always enforce dynamic ways even if -dynamic or
    
    194
    +--    -dynamic-too is not explicitly passed.
    
    195
    +-- 4. Cabal must not build ghci objects since it's not supported by
    
    196
    +--    the target.
    
    197
    +-- 5. The testsuite driver will use dyn way for TH/ghci tests even
    
    198
    +--    when host GHC is static.
    
    199
    +-- 6. TH/ghci doesn't work if stage1 is built without shared libraries
    
    200
    +--    (e.g. quickest/fully_static).
    
    201
    +tgtRTSLinkerOnlySupportsSharedLibs :: Target -> Bool
    
    202
    +tgtRTSLinkerOnlySupportsSharedLibs Target{tgtArchOs} =
    
    203
    +  archOS_arch tgtArchOs `elem`
    
    204
    +    [ ArchWasm32 ]
    
    205
    +
    
    186 206
     --------------------------------------------------------------------------------
    
    187 207
     -- Lenses
    
    188 208
     --------------------------------------------------------------------------------