From 0fac488cca04a07224926e35be9c45ee2d0e1631 Mon Sep 17 00:00:00 2001 From: Francesco Mazzoli Date: Tue, 7 Mar 2017 23:39:51 -0500 Subject: Allow compilation of C/C++/ObjC/ObjC++ files with module from TH The main goal is to easily allow the inline-c project (and similar projects such as inline-java) to emit C/C++ files to be compiled and linked with the current module. Moreover, `addCStub` is removed, since it's quite fragile. Most notably, the C stubs end up in the file generated by `CodeOutput.outputForeignStubs`, which is tuned towards generating a file for stubs coming from `capi` and Haskell-to-C exports. Reviewers: simonmar, austin, goldfire, facundominguez, dfeuer, bgamari Reviewed By: dfeuer, bgamari Subscribers: snowleopard, rwbarton, dfeuer, thomie, duncan, mboes Differential Revision: https://phabricator.haskell.org/D3280 --- libraries/ghc-boot/GHC/ForeignSrcLang.hs | 12 ++++++++++++ libraries/ghc-boot/ghc-boot.cabal.in | 1 + 2 files changed, 13 insertions(+) create mode 100644 libraries/ghc-boot/GHC/ForeignSrcLang.hs (limited to 'libraries/ghc-boot') diff --git a/libraries/ghc-boot/GHC/ForeignSrcLang.hs b/libraries/ghc-boot/GHC/ForeignSrcLang.hs new file mode 100644 index 0000000000..9ca4f04cf7 --- /dev/null +++ b/libraries/ghc-boot/GHC/ForeignSrcLang.hs @@ -0,0 +1,12 @@ +{-# OPTIONS_GHC -fno-warn-orphans #-} + +-- | See @GHC.LanguageExtensions@ for an explanation +-- on why this is needed +module GHC.ForeignSrcLang + ( module GHC.ForeignSrcLang.Type + ) where + +import Data.Binary +import GHC.ForeignSrcLang.Type + +instance Binary ForeignSrcLang diff --git a/libraries/ghc-boot/ghc-boot.cabal.in b/libraries/ghc-boot/ghc-boot.cabal.in index 772b92ccdd..11febb4ac0 100644 --- a/libraries/ghc-boot/ghc-boot.cabal.in +++ b/libraries/ghc-boot/ghc-boot.cabal.in @@ -39,6 +39,7 @@ Library GHC.LanguageExtensions GHC.PackageDb GHC.Serialized + GHC.ForeignSrcLang build-depends: base >= 4.7 && < 4.11, binary == 0.8.*, -- cgit v1.2.1