Support building with GHC 9.6

This patch contains a handful of tweaks needed to make the libraries in the
`macaw` repo build with GHC 9.6:

* GHC 9.6 bundles `mtl-2.3.*`, which no longer re-exports `Control.Monad`,
  `Control.Monad.Trans`, and similar modules from `mtl`-related modules. To
  accommodate this, various imports have been made more explicit.
* I have disambiguated a use of `Data.Parameterized.NatRepr.withKnownNat` in
  `macaw-aarch32` to avoid clashing with a newly exported function of the same
  name in `GHC.TypeNats`.
* I have bumped various upper version bounds on `doctest`,
  `optparse-applicative`, and `what4` to allow building these libraries with
  GHC 9.6.
* I have bumped the following submodules to bring in GHC 9.6–related changes:
  * `asl-translator`: GaloisInc/asl-translator#53
  * `crucible`: GaloisInc/crucible#1102
  * `dwarf`: GaloisInc/dwarf#6
  * `elf-edit`: GaloisInc/elf-edit#38
  * `flexdis86`: GaloisInc/flexdis86#54
  * `grift`: GaloisInc/grift#9
  * `llvm-pretty`: elliottt/llvm-pretty#112
  * `llvm-pretty-bc-parser`: GaloisInc/llvm-pretty-bc-parser#225
  * `semmc`: GaloisInc/semmc#80
  * `what4`: GaloisInc/what4#235
This commit is contained in:
Ryan Scott 2023-08-07 15:24:22 -04:00 committed by Ryan Scott
parent 2ce038c086
commit 984f7cb368
27 changed files with 55 additions and 40 deletions

View File

@ -61,7 +61,8 @@ module Data.Macaw.AbsDomain.AbsState
import Control.Exception (assert)
import Control.Lens
import Control.Monad.State.Strict
import Control.Monad (guard)
import Control.Monad.State.Strict (MonadState(..), State, modify, runState)
import Data.Bits
import Data.Foldable
import Data.Int

View File

@ -36,7 +36,7 @@ module Data.Macaw.AbsDomain.JumpBounds
, IntraJumpTarget
) where
import Control.Monad.Reader
import Control.Monad (unless, when)
import Data.Bits
import Data.Foldable
import Data.Map.Strict (Map)

View File

@ -105,8 +105,8 @@ module Data.Macaw.AbsDomain.StackAnalysis
, MemVal(..)
) where
import Control.Monad.Reader
import Control.Monad.State
import Control.Monad (unless)
import Control.Monad.State (MonadState(..), State, evalState, gets)
import Data.Kind
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map

View File

@ -31,9 +31,10 @@ module Data.Macaw.Analysis.FunctionArgs
) where
import Control.Lens
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.State.Strict
import Control.Monad (when)
import Control.Monad.Except (Except, MonadError(..), runExcept)
import Control.Monad.Reader (MonadReader(..), ReaderT(..), asks)
import Control.Monad.State.Strict (State, StateT, evalStateT, gets, modify', runState)
import Data.Foldable
import qualified Data.Kind as Kind
import Data.Map.Strict (Map)

View File

@ -67,9 +67,10 @@ module Data.Macaw.Analysis.RegisterUse
) where
import Control.Lens
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.State.Strict
import Control.Monad (unless, when, zipWithM_)
import Control.Monad.Except (MonadError(..), Except)
import Control.Monad.Reader (MonadReader(..), ReaderT(..), asks)
import Control.Monad.State.Strict (MonadState(..), State, StateT, execStateT, evalState, gets, modify)
import qualified Data.ByteString.Char8 as BSC
import qualified Data.ByteString as BS
import Data.Foldable

View File

@ -96,7 +96,8 @@ module Data.Macaw.CFG.Core
) where
import Control.Lens
import Control.Monad.State.Strict
import Control.Monad (when)
import Control.Monad.State.Strict (MonadState(..), State, gets, modify, runState)
import Data.Bits
import Data.Int (Int64)
import qualified Data.Kind as Kind

View File

@ -20,7 +20,8 @@ module Data.Macaw.CFG.DemandSet
, stmtNeeded
) where
import Control.Monad.State.Strict
import Control.Monad (when)
import Control.Monad.State.Strict (MonadState(..), State, execState, gets)
import Data.Parameterized.Some
import Data.Parameterized.TraversableF
import Data.Parameterized.TraversableFC

View File

@ -34,8 +34,10 @@ module Data.Macaw.CFG.Rewriter
) where
import Control.Lens
import Control.Monad (when)
import Control.Monad.ST
import Control.Monad.State.Strict
import Control.Monad.State.Strict (StateT(..), gets)
import Control.Monad.Trans (MonadTrans(..))
import Data.BinarySymbols
import Data.Bits
import Data.List (find)

View File

@ -41,8 +41,9 @@ module Data.Macaw.Memory.ElfLoader
) where
import Control.Lens
import Control.Monad.Except
import Control.Monad.State.Strict
import Control.Monad (when)
import Control.Monad.Except (Except, ExceptT, MonadError(..), runExcept, runExceptT)
import Control.Monad.State.Strict (State, StateT(..), execStateT, gets, modify, runState)
import Data.Bits
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC

2
deps/asl-translator vendored

@ -1 +1 @@
Subproject commit b1d3c6b816ff90a12f31429f65f99866215ad1b1
Subproject commit 4b632c90933f795ef35d2c68ed80d42291cfd504

2
deps/crucible vendored

@ -1 +1 @@
Subproject commit ad4a553487eeb5c6bbb5abf4bde26af905bf0254
Subproject commit bc64fda29cf2e1f4641b381a739c53d7c4d2aa38

2
deps/dwarf vendored

@ -1 +1 @@
Subproject commit 5c7101fc9974788c62955a1739aba9d26ebf02bb
Subproject commit ca7de7ac853317ab1f02bb0c53d5bbbff7464863

2
deps/elf-edit vendored

@ -1 +1 @@
Subproject commit dc5eabec3c00df530962ec41391356dc491cb0dc
Subproject commit 3ba7d7148adc6029b0046229c4fecbb9ee048f9b

2
deps/flexdis86 vendored

@ -1 +1 @@
Subproject commit 64a4406ad7995cf4a9ca73e266634947b0066ae8
Subproject commit 5370202ab9563cb9a0a15475aa801e9b37fa5ab4

2
deps/grift vendored

@ -1 +1 @@
Subproject commit 3fe3056a1d79f27bc8e828bc667653c6595517ca
Subproject commit ab2cf5bd6f2650bdf2fcd6470a4ffdcd4fba6176

2
deps/llvm-pretty vendored

@ -1 +1 @@
Subproject commit b13493fda7276835a4e19bf13a9fb1b3e08083a9
Subproject commit 94e384842b214ba72446d1694446fb5261ab6ce2

@ -1 +1 @@
Subproject commit d541adf5c12e86058cbc1f211456b4ad4a7011a1
Subproject commit ac9fff49ef1670e58be9ce90075eaa02726f8662

2
deps/semmc vendored

@ -1 +1 @@
Subproject commit 1c6ad57c36c5dd153335d419b7123af48a95b2b4
Subproject commit 2147ee3e7b966ca635289efa742f9e5f4c7bb540

2
deps/what4 vendored

@ -1 +1 @@
Subproject commit ffbad75b1ce65577422a19a30a39a5059be8b95f
Subproject commit 28744e48e01dc9c35d5aeebb914a9bb425cfe0f1

View File

@ -45,7 +45,7 @@ import Data.Parameterized.Classes
import qualified Data.Parameterized.Context as Ctx
import qualified Data.Parameterized.TraversableFC as FC
import Data.Parameterized.NatRepr
import GHC.TypeLits as TL
import qualified GHC.TypeLits as TL
import qualified What4.Expr.Builder as WEB
import Language.Haskell.TH
import qualified SemMC.Architecture.AArch32 as ARM

View File

@ -39,7 +39,7 @@ library
semmc,
bv-sized >= 1 && < 1.1,
libBF >= 0.6 && < 0.7,
what4 >= 1.1 && < 1.5
what4 >= 1.1 && < 1.6
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall -Wcompat

View File

@ -152,7 +152,7 @@ test-suite test-refinements
, crucible
, crucible-llvm
, what4
, optparse-applicative >= 0.13 && < 0.17
, optparse-applicative >= 0.13 && < 0.19
, parameterized-utils
, QuickCheck >= 2.7
, semmc-ppc

View File

@ -27,7 +27,7 @@ library
text,
vector,
bytestring,
what4 >= 1.1 && < 1.5
what4 >= 1.1 && < 1.6
hs-source-dirs: src
@ -56,6 +56,6 @@ test-suite doctests
hs-source-dirs: test
main-is: doctest.hs
ghc-options: -Wall -Wcompat -threaded
build-depends: base, macaw-base, macaw-symbolic, doctest >= 0.10 && < 0.21
build-depends: base, macaw-base, macaw-symbolic, doctest >= 0.10 && < 0.23

View File

@ -84,11 +84,14 @@ module Data.Macaw.Symbolic.CrucGen
) where
import Control.Lens hiding (Empty, (:>))
import Control.Monad.Except
import Control.Monad (foldM, forM, unless)
import Control.Monad.Except (MonadError(..), ExceptT, runExceptT)
import qualified Control.Monad.Fail as MF
import Control.Monad.State.Strict
import Control.Monad.State.Strict (MonadState(..), StateT(..), gets, modify')
import Control.Monad.Trans (MonadTrans(..))
import qualified Data.BitVector.Sized as BV
import qualified Data.Foldable as F
import Data.Functor (void)
import qualified Data.Kind as K
import qualified Data.Macaw.CFG as M
import qualified Data.Macaw.CFG.Block as M

View File

@ -51,9 +51,10 @@ module Data.Macaw.X86
) where
import Control.Lens
import Control.Monad.Cont
import Control.Monad.Except
import Control.Monad (when)
import Control.Monad.Except (ExceptT, MonadError(..), runExceptT, withExceptT)
import Control.Monad.ST
import Control.Monad.Trans (MonadTrans(..))
import qualified Data.ElfEdit as EE
import Data.Foldable
import qualified Data.Map as Map

View File

@ -15,9 +15,10 @@ module Data.Macaw.X86.Flexdis
, RelocPos(..)
) where
import Control.Monad.Except
import Control.Monad (when)
import Control.Monad.Except (ExceptT, MonadError(..), runExceptT)
import qualified Control.Monad.Fail as MF
import Control.Monad.State.Strict
import Control.Monad.State.Strict (MonadState(..), State, gets, runState)
import Data.Bits
import qualified Data.ByteString as BS
import Data.Int

View File

@ -63,11 +63,13 @@ module Data.Macaw.X86.Generator
) where
import Control.Lens
import Control.Monad.Cont
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad (liftM)
import Control.Monad.Cont (ContT(..))
import Control.Monad.Except (MonadError(..), ExceptT)
import Control.Monad.Reader (MonadReader(..), ReaderT(..))
import Control.Monad.ST
import Control.Monad.State.Strict
import Control.Monad.State.Strict (State, modify, runState)
import Control.Monad.Trans (MonadTrans(..))
import Data.Bits
import Data.Foldable
import Data.Macaw.CFG.App