summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2017-11-17 19:29:25 +0800
committerMoritz Angermann <moritz.angermann@gmail.com>2017-11-18 11:00:11 +0800
commit12a7444463184e9eddbe7b7251a0ee1e976f4d75 (patch)
treea7c9e04baae103166f7d12d77676294ad50cb6c8 /docs
parentc7297342a4797ea36df8767d9c208cfb45de2d09 (diff)
downloadhaskell-12a7444463184e9eddbe7b7251a0ee1e976f4d75.tar.gz
Adds -ghc-version flag to ghc.
Summary: When building the rts with ghc (e.g. using ghc as a c compiler), ghc's "Value Add"[1] is, it includes adding `-include /path/to/ghcversion.h`. For this it looksup the rts package in the package database, which--if empty--fails. Thus to allow compiling C files with GHC, we add the `-ghc-version` flag, which takes the path to the `ghcversion.h` file. A `-no-ghc-version` flag was omitted, as at that point it becomes questionable why one would use ghc to compile c if one doesn't any of the added value. -- [1] from `compiler/main/DriverPipeline.hs` > -- add package include paths even if we're just compiling .c > -- files; this is the Value Add(TM) that using ghc instead of > -- gcc gives you :) Reviewers: bgamari, geekosaur, austin Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4135
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/using.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst
index a963ead8f1..e3fa74127e 100644
--- a/docs/users_guide/using.rst
+++ b/docs/users_guide/using.rst
@@ -1064,3 +1064,26 @@ Some flags only make sense for particular target platforms.
and later). The :ref:`LLVM backend <llvm-code-gen>` will also use
SSE4.2 if your processor supports it but detects this automatically
so no flag is required.
+
+Miscellaneous flags
+-------------------
+
+.. index::
+ single: miscellaneous flags
+
+Some flags only make sense for a particular use case.
+
+.. ghc-flag:: -ghc-version ⟨path to ghcversion.h⟩
+ :shortdesc: (GHC as a C compiler only) Use this ``ghcversion.h`` file
+ :type: dynamic
+ :category: misc
+
+ When GHC is used to compile C files, GHC adds package include paths and
+ includes ``ghcversion.h`` directly. The compiler will lookup the path for
+ the ``ghcversion.h`` file from the ``rts`` package in the package database.
+ In some cases, the compiler's package database does not contain the ``rts``
+ package, or one wants to specify a specific ``ghcversions.h`` to be
+ included. This option can be used to specify the path to the
+ ``ghcversions.h`` file to be included. This is primarily intended to be
+ used by GHC's build system.
+