Skip to content

Commit 34e865d

Browse files
committed
Update for GHC-9.6.6, update 64-bit primops
This fixes the build for GHC-9.6.6 and above. - [x] Imports Control.Monad (mtl modules no longer re-export this) - [x] Update 64-bit primops (some functions in ghc-prim have changed for 64-bit primops) - [x] Adds conditional cabal flag for compiling ext-stg-gc externally
1 parent f4d589b commit 34e865d

33 files changed

+69
-30
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
**/.stack-work/
2+
TAGS
3+
dist-newstyle
4+
*~

external-stg-compiler/lib/Stg/GHC/ToStg.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import GHC.Core.TyCon
3737
import GHC.Core.DataCon
3838
import GHC.Core.Type
3939

40+
import Control.Monad
4041
import Control.Monad.State
4142
import Data.List (partition)
4243

external-stg-interpreter/.ghci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:set -ilib

external-stg-interpreter/external-stg-interpreter.cabal

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ copyright: (c) 2020 Csaba Hruska
1111
category: Development
1212
build-type: Simple
1313

14+
flag external-ext-stg-gc
15+
manual:
16+
True
17+
default:
18+
False
19+
description:
20+
If enabled, the ext-stg-gc binary is provided externally and available in $PATH
21+
Disbled by default
22+
1423
library
1524
exposed-modules:
1625
Foreign.LibFFI.Closure
@@ -101,17 +110,16 @@ library
101110
external-stg
102111
default-language: Haskell2010
103112

104-
include-dirs: datalog
105-
106-
107-
cxx-sources: datalog/ext-stg-gc.cpp
108-
cxx-options: -D__EMBEDDED_SOUFFLE__ -D_OPENMP -std=c++17
109-
if os(darwin)
110-
ld-options: "-Wl,-all_load"
111-
extra-libraries: omp stdc++
112-
else
113-
ld-options: "-Wl,-u,__factory_Sf_ext_stg_gc_instance"
114-
extra-libraries: gomp
113+
if !flag(external-ext-stg-gc)
114+
include-dirs: datalog
115+
cxx-sources: datalog/ext-stg-gc.cpp
116+
cxx-options: -D__EMBEDDED_SOUFFLE__ -D_OPENMP -std=c++17
117+
if os(darwin)
118+
ld-options: "-Wl,-all_load"
119+
extra-libraries: omp stdc++
120+
else
121+
ld-options: "-Wl,-u,__factory_Sf_ext_stg_gc_instance"
122+
extra-libraries: gomp
115123

116124
executable ext-stg-interpreter
117125
default-language: Haskell2010

external-stg-interpreter/lib/Stg/Interpreter.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Foreign.Ptr
1010
import Control.Concurrent
1111
import Control.Concurrent.MVar
1212
import qualified Control.Concurrent.Chan.Unagi.Bounded as Unagi
13+
import Control.Monad
1314
import Control.Monad.State.Strict
1415
import Control.Exception
1516
import qualified Data.Primitive.ByteArray as BA

external-stg-interpreter/lib/Stg/Interpreter/Base.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import qualified Data.ByteString.Lazy as BL
2222
import Data.Vector (Vector)
2323
import qualified Data.Primitive.ByteArray as BA
2424
import Control.Monad.Primitive
25+
import Control.Monad
2526
import System.Posix.DynamicLinker
2627
import Control.Concurrent.MVar
2728
import Control.Concurrent.Chan.Unagi.Bounded

external-stg-interpreter/lib/Stg/Interpreter/Debug.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import System.Directory
1515
import System.FilePath
1616
import Text.Printf
1717

18+
import Control.Monad
1819
import Control.Monad.State.Strict
1920

2021
import Stg.Syntax

external-stg-interpreter/lib/Stg/Interpreter/Debugger.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
module Stg.Interpreter.Debugger where
33

44
import GHC.Stack
5+
import Control.Monad
56
import Control.Monad.State
67
import qualified Data.Set as Set
78
import qualified Data.Map as Map

external-stg-interpreter/lib/Stg/Interpreter/Debugger/Internal.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module Stg.Interpreter.Debugger.Internal where
33

44
import Text.Printf
55
import qualified Text.Read as Text
6+
import Control.Monad
67
import Control.Monad.State
78
import qualified Data.List as List
89
import qualified Data.Set as Set

external-stg-interpreter/lib/Stg/Interpreter/Debugger/Region.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
module Stg.Interpreter.Debugger.Region where
33

44
import Text.Printf
5+
import Control.Monad
56
import Control.Monad.State
67
import Data.Maybe
78
import qualified Data.List as List

0 commit comments

Comments
 (0)