diff --git a/gibbon-ghc-integration/cabal.project b/gibbon-ghc-integration/cabal.project index dec0f3136..abce28779 100644 --- a/gibbon-ghc-integration/cabal.project +++ b/gibbon-ghc-integration/cabal.project @@ -1,10 +1,6 @@ packages: ../gibbon-compiler - plugin0 - plugin1 gibbon-plugin examples -with-compiler: ghc-9.4.3 - package * ghc-options: -fexpose-all-unfoldings diff --git a/gibbon-ghc-integration/examples/gibbon-examples.cabal b/gibbon-ghc-integration/examples/gibbon-examples.cabal index 41d25219c..f945ab7c8 100644 --- a/gibbon-ghc-integration/examples/gibbon-examples.cabal +++ b/gibbon-ghc-integration/examples/gibbon-examples.cabal @@ -7,9 +7,7 @@ build-type: Simple library hs-source-dirs: src exposed-modules: BinTree - build-depends: base == 4.17.* - -- , plugin0 - -- , plugin1 + build-depends: base , inline-c , binary , gibbon-plugin @@ -17,8 +15,6 @@ library default-language: Haskell2010 ghc-options: -Wall -Wcompat -O2 - -- -fplugin=Gibbon.Plugin0 - -- -fplugin=Gibbon.Plugin1 -fplugin=Gibbon.Plugin -- "-optl-Wl,--allow-multiple-definition" @@ -36,8 +32,8 @@ library -dcore-lint -ddump-simpl -dsuppress-all -ddump-to-file - include-dirs: "/home/ckoparka/chai/tree-velocity/gibbon-rts/build" - extra-lib-dirs: "/home/ckoparka/chai/tree-velocity/gibbon-rts/build" + include-dirs: "../../gibbon-rts/build" + extra-lib-dirs: "../../gibbon-rts/build" extra-libraries: gibbon_rts_ng @@ -48,8 +44,8 @@ executable run-gibbon-examples build-depends: base, gibbon-examples, binary, bytestring, deepseq, time ghc-options: -O2 -dcore-lint - include-dirs: "/home/ckoparka/chai/tree-velocity/gibbon-rts/build" - extra-lib-dirs: "/home/ckoparka/chai/tree-velocity/gibbon-rts/build" + include-dirs: "../../gibbon-rts/build" + extra-lib-dirs: "../../gibbon-rts/build" extra-libraries: gibbon_rts_ng -- ghc-options: "-optl-Wl,-I/home/ckoparka/chai/tree-velocity/gibbon-rts/build" -- "-optl-Wl,-L/home/ckoparka/chai/tree-velocity/gibbon-rts/build" diff --git a/gibbon-ghc-integration/gibbon-plugin/gibbon-plugin.cabal b/gibbon-ghc-integration/gibbon-plugin/gibbon-plugin.cabal index 88d29e686..0ee50d745 100644 --- a/gibbon-ghc-integration/gibbon-plugin/gibbon-plugin.cabal +++ b/gibbon-ghc-integration/gibbon-plugin/gibbon-plugin.cabal @@ -8,8 +8,8 @@ build-type: Simple library exposed-modules: Gibbon.Plugin hs-source-dirs: src - build-depends: base == 4.17.* - , ghc == 9.4.3 + build-depends: base + , ghc , gibbon , containers , filepath diff --git a/gibbon-ghc-integration/gibbon-plugin/src/Gibbon/Plugin.hs b/gibbon-ghc-integration/gibbon-plugin/src/Gibbon/Plugin.hs index f46a5de92..d5dc454aa 100644 --- a/gibbon-ghc-integration/gibbon-plugin/src/Gibbon/Plugin.hs +++ b/gibbon-ghc-integration/gibbon-plugin/src/Gibbon/Plugin.hs @@ -2,6 +2,7 @@ module Gibbon.Plugin where +import Data.String import qualified GHC.Types.TyThing as GHC import qualified GHC.Unit.External as GHC import qualified GHC.Utils.Trace as GHC @@ -78,7 +79,7 @@ gibbonPlugin mod_guts = do then do let name = GHC.idName f uniq <- GHC.getUniqueM - let name' = GHC.mkFCallName uniq ("c_" ++ nameToString name) + let name' = GHC.mkFCallName uniq (fromString $ "c_" ++ nameToString name) pure (GHC.setIdName f name',rhs) else pure (f,rhs)) closure @@ -133,7 +134,7 @@ generateObjectFile l0 = do let dflags' = Gib.gopt_set Gib.Opt_DisableGC $ Gib.gopt_set Gib.Opt_Packed (Gib.dynflags config) let config' = config { Gib.dynflags = dflags', Gib.optc = " -O3 " } uniq <- randomIO :: IO Word16 - let fp = "/home/ckoparka/chai/gibbon-ghc-integration-files/" ++ show uniq ++ ".hs" + let fp = "/tmp/gibbon-ghc-integration-file-" ++ show uniq ++ ".hs" Gib.compileFromL0 config' 0 fp l0 return fp