[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 5 commits: hadrian: add hi_core flavour transformer

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Thu Jan 19 10:28:22 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
5449828e by Cheng Shao at 2023-01-19T05:28:09-05:00
hadrian: add hi_core flavour transformer

The hi_core flavour transformer enables -fwrite-if-simplified-core for
stage1 libraries, which emit core into interface files to make it
possible to restart code generation. Building boot libs with it makes
it easier to use GHC API to prototype experimental backends that needs
core/stg at link time.

- - - - -
7c550461 by Cheng Shao at 2023-01-19T05:28:09-05:00
hadrian: add missing docs for recently added flavour transformers

- - - - -
629783cd by Vladislav Zavialov at 2023-01-19T05:28:10-05:00
Set "since: 9.8" for TypeAbstractions and -Wterm-variable-capture

These flags did not make it into the 9.6 release series,
so the "since" annotations must be corrected.

- - - - -
b0836d60 by Cheng Shao at 2023-01-19T05:28:11-05:00
hadrian: disable alloca for in-tree GMP on wasm32

When building in-tree GMP for wasm32, disable its alloca usage, since
it may potentially cause stack overflow (e.g. #22602).

- - - - -
0315bbc1 by Cheng Shao at 2023-01-19T05:28:12-05:00
Bump process submodule

Includes a critical fix for wasm32, see
https://github.com/haskell/process/pull/272 for details. Also changes
the existing cross test to include process stuff and avoid future
regression here.

- - - - -


11 changed files:

- .gitlab/hello.hs
- compiler/GHC/Driver/Flags.hs
- docs/users_guide/9.6.1-notes.rst
- + docs/users_guide/9.8.1-notes.rst
- docs/users_guide/exts/type_abstractions.rst
- docs/users_guide/release-notes.rst
- docs/users_guide/using-warnings.rst
- hadrian/doc/flavours.md
- hadrian/src/Flavour.hs
- hadrian/src/Settings/Builders/Configure.hs
- libraries/process


Changes:

=====================================
.gitlab/hello.hs
=====================================
@@ -1,4 +1,4 @@
-{-# OPTIONS_GHC -Wno-missing-fields #-}
+{-# OPTIONS_GHC -Wall -Wno-missing-fields #-}
 
 import GHC hiding (parseModule)
 import GHC.Data.StringBuffer
@@ -9,6 +9,7 @@ import GHC.Platform
 import GHC.Plugins
 import GHC.Settings
 import GHC.Settings.Config
+import System.Mem.Weak
 
 fakeSettings :: Settings
 fakeSettings =
@@ -41,5 +42,6 @@ parse dflags src = do
 
 main :: IO ()
 main = do
+  _ <- mkWeak runGhc runGhc Nothing
   m <- parse fakeDynFlags "main = putStrLn \"hello world\""
   putStrLn $ showSDoc fakeDynFlags $ ppr m


=====================================
compiler/GHC/Driver/Flags.hs
=====================================
@@ -631,7 +631,7 @@ data WarningFlag =
    | Opt_WarnGADTMonoLocalBinds                      -- Since 9.4
    | Opt_WarnTypeEqualityOutOfScope                  -- Since 9.4
    | Opt_WarnTypeEqualityRequiresOperators           -- Since 9.4
-   | Opt_WarnTermVariableCapture
+   | Opt_WarnTermVariableCapture                     -- Since 9.8
    deriving (Eq, Ord, Show, Enum)
 
 -- | Return the names of a WarningFlag


=====================================
docs/users_guide/9.6.1-notes.rst
=====================================
@@ -98,9 +98,6 @@ Compiler
 
 - The :ghc-flag:`-Wstar-is-type` warning is now enabled by default.
 
-- Added a new warning :ghc-flag:`-Wterm-variable-capture` that helps to make code compatible with 
-  the future extension ``RequiredTypeArguments``.
-
 - The ``-Wno-⟨wflag⟩``, ``-Werror=⟨wflag⟩`` and ``-Wwarn=⟨wflag⟩`` options are
   now defined systematically for all warning groups (for example,
   ``-Wno-default``, ``-Werror=unused-binds`` and ``-Wwarn=all`` are now


=====================================
docs/users_guide/9.8.1-notes.rst
=====================================
@@ -0,0 +1,13 @@
+.. _release-9-8-1:
+
+Version 9.8.1
+=============
+
+Language
+~~~~~~~~
+
+Compiler
+~~~~~~~~
+
+- Added a new warning :ghc-flag:`-Wterm-variable-capture` that helps to make code compatible with
+  the future extension ``RequiredTypeArguments``.
\ No newline at end of file


=====================================
docs/users_guide/exts/type_abstractions.rst
=====================================
@@ -4,7 +4,7 @@ Type abstractions
 .. extension:: TypeAbstractions
     :shortdesc: Enable type abstraction syntax in patterns and type variable binders.
 
-    :since: 9.6.1
+    :since: 9.8.1
 
     :status: Partially implemented
 


=====================================
docs/users_guide/release-notes.rst
=====================================
@@ -4,4 +4,4 @@ Release notes
 .. toctree::
    :maxdepth: 1
 
-   9.6.1-notes
+   9.8.1-notes


=====================================
docs/users_guide/using-warnings.rst
=====================================
@@ -2319,8 +2319,8 @@ of ``-W(no-)*``.
 .. ghc-flag:: -Wterm-variable-capture
     :shortdesc: warn when an implicitly quantified type variable captures a term's name
     :type: dynamic
-    
-    :since: 9.6.1
+
+    :since: 9.8.1
 
     In accordance with `GHC Proposal #281
     <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0281-visible-forall.rst>`__,


=====================================
hadrian/doc/flavours.md
=====================================
@@ -261,6 +261,10 @@ The supported transformers are listed below:
         <td>Just like `no_dynamic_ghc`, this transformer ensures statically-linked libraries
         </td>
     </tr>
+    <tr>
+        <td><code>native_bignum</code></td>
+        <td>Use the native <code>ghc-bignum</code> backend.</td>
+    </tr>
     <tr>
         <td><code>no_profiled_libs</code></td>
         <td>Disables building of libraries in profiled build ways.</td>
@@ -300,6 +304,18 @@ The supported transformers are listed below:
         <td>Enable Core, STG, and C-- linting in all compilation with the stage1
         compiler.</td>
     </tr>
+    <tr>
+        <td><code>haddock</code></td>
+        <td>Emit haddock documentation into the interface files via <code>-haddock</code>.</td>
+    </tr>
+    <tr>
+        <td><code>hi_core</code></td>
+        <td>Emit whole Core bindings into the interface files via <code>-fwrite-if-simplified-core</code>.</td>
+    </tr>
+    <tr>
+        <td><code>late_ccs</code></td>
+        <td>Enable <code>-fprof-late</code> in profiled libraries.</td>
+    </tr>
 </table>
 
 ### Static


=====================================
hadrian/src/Flavour.hs
=====================================
@@ -15,6 +15,7 @@ module Flavour
   , disableProfiledLibs
   , enableLinting
   , enableHaddock
+  , enableHiCore
   , useNativeBignum
   , omitPragmas
 
@@ -62,6 +63,7 @@ flavourTransformers = M.fromList
     , "debug_stage1_ghc" =: debugGhc stage0InTree
     , "lint"             =: enableLinting
     , "haddock"          =: enableHaddock
+    , "hi_core"          =: enableHiCore
     , "late_ccs"         =: enableLateCCS
     ]
   where (=:) = (,)
@@ -180,6 +182,13 @@ enableHaddock =
       [ arg "-haddock"
       ]
 
+-- | Build stage2 dependencies with options to emit Core into
+-- interface files which is sufficient to restart code generation.
+enableHiCore :: Flavour -> Flavour
+enableHiCore = addArgs
+    $ notStage0 ? builder (Ghc CompileHs)
+    ? pure ["-fwrite-if-simplified-core"]
+
 -- | Transform the input 'Flavour' so as to build with
 --   @-split-sections@ whenever appropriate.
 --   Note that this transformer doesn't do anything


=====================================
hadrian/src/Settings/Builders/Configure.hs
=====================================
@@ -10,12 +10,20 @@ configureBuilderArgs = do
     gmpPath    <- expr (gmpBuildPath stage)
     libffiPath <- expr (libffiBuildPath stage)
     mconcat [ builder (Configure gmpPath) ? do
+                targetArch <- getSetting TargetArch
                 targetPlatform <- getSetting TargetPlatform
                 buildPlatform <- getSetting BuildPlatform
-                pure [ "--enable-shared=no"
+                pure $ [ "--enable-shared=no"
                      , "--with-pic=yes"
                      , "--host=" ++ targetPlatform    -- GMP's host is our target
                      , "--build=" ++ buildPlatform ]
+                     -- Disable GMP's alloca usage on wasm32, it may
+                     -- cause stack overflow (#22602) due to the
+                     -- rather small 64KB default stack size. See
+                     -- https://gmplib.org/manual/Build-Options for
+                     -- more detailed explanation of this configure
+                     -- option.
+                     <> [ "--enable-alloca=malloc-reentrant" | targetArch == "wasm32" ]
 
             , builder (Configure libffiPath) ? do
                 top            <- expr topDirectory


=====================================
libraries/process
=====================================
@@ -1 +1 @@
-Subproject commit d295bcceb64e9f17f08999c6333aaabda4d5ee96
+Subproject commit d9a8e6e749d2d60422037f3ef4733d521f18a7fc



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/afca884d18924537493ab59f4823a5e39c6d5d3c...0315bbc142b605bbdc7505ad214c9986a7f8a334

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/afca884d18924537493ab59f4823a5e39c6d5d3c...0315bbc142b605bbdc7505ad214c9986a7f8a334
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230119/f655884e/attachment-0001.html>


More information about the ghc-commits mailing list