[Git][ghc/ghc][wip/haskell-nix-patches/aarch64-multiplatform/5c80a27488acfe3610ddfcb99a1e961002e386d0] Allow stage1 compilers to load plugins with -fplugin-library
doyougnu (@doyougnu)
gitlab at gitlab.haskell.org
Mon Jul 8 15:31:21 UTC 2024
doyougnu pushed to branch wip/haskell-nix-patches/aarch64-multiplatform/5c80a27488acfe3610ddfcb99a1e961002e386d0 at Glasgow Haskell Compiler / GHC
Commits:
6dc885ca by doyougnu at 2024-07-08T11:29:23-04:00
Allow stage1 compilers to load plugins with -fplugin-library
part of the haskell.nix upstream patches project
This exposes the GHCi.ObjLink module even if no internal
interpreter is available. This may be unsafe.
- - - - -
2 changed files:
- compiler/GHC/Driver/Plugins.hs
- libraries/ghci/ghci.cabal.in
Changes:
=====================================
compiler/GHC/Driver/Plugins.hs
=====================================
@@ -1,7 +1,7 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE CPP #-}
-#if defined(HAVE_INTERNAL_INTERPRETER) && defined(CAN_LOAD_DLL)
+#if defined(CAN_LOAD_DLL)
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE UnboxedTuples #-}
@@ -109,7 +109,7 @@ import qualified Data.Semigroup
import Control.Monad
-#if defined(HAVE_INTERNAL_INTERPRETER) && defined(CAN_LOAD_DLL)
+#if defined(CAN_LOAD_DLL)
import GHCi.ObjLink
import GHC.Exts (addrToAny#, Ptr(..))
import GHC.Utils.Encoding
@@ -387,10 +387,7 @@ defaultFrontendPlugin = FrontendPlugin { frontend = \_ _ -> return () }
-- | Load external plugins
loadExternalPlugins :: [ExternalPluginSpec] -> IO [ExternalPlugin]
loadExternalPlugins [] = return []
-#if !defined(HAVE_INTERNAL_INTERPRETER)
-loadExternalPlugins _ = do
- panic "loadExternalPlugins: can't load external plugins with GHC built without internal interpreter"
-#elif !defined(CAN_LOAD_DLL)
+#if !defined(CAN_LOAD_DLL)
loadExternalPlugins _ = do
panic "loadExternalPlugins: loading shared libraries isn't supported by this compiler"
#else
=====================================
libraries/ghci/ghci.cabal.in
=====================================
@@ -61,7 +61,6 @@ library
exposed-modules:
GHCi.Run
GHCi.CreateBCO
- GHCi.ObjLink
GHCi.Signals
GHCi.StaticPtrTable
GHCi.TH
@@ -72,6 +71,7 @@ library
GHCi.InfoTable
exposed-modules:
+ GHCi.ObjLink
GHCi.BreakArray
GHCi.BinaryArray
GHCi.Message
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6dc885ca5a7078f5ad2e75d4ae08a21fe01f9797
--
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6dc885ca5a7078f5ad2e75d4ae08a21fe01f9797
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/20240708/71fb5ebc/attachment-0001.html>
More information about the ghc-commits
mailing list