Commit bb06e2a8 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Make 'ghc' a wired in package.

Previously, the GHC API was "semi" wired-in: it was installed with a
version number, but that version number was hard-coded into the compiler
and it wasn't really possible to install other copies of the GHC API.
This patch makes the GHC API more similar to existing wired-in packages
such as ghc-prim, and will be helpful when we start extending the amount
of information passed to -package-name.
Signed-off-by: default avatarEdward Z. Yang <>

Test Plan: validate

Reviewers: simonmar, simonpj, hvr, austin

Subscribers: simonmar, relrod, carter

Differential Revision:
parent 4dd7ae62
......@@ -367,7 +367,7 @@ rtsPackageId = fsToPackageId (fsLit "rts")
thPackageId = fsToPackageId (fsLit "template-haskell")
dphSeqPackageId = fsToPackageId (fsLit "dph-seq")
dphParPackageId = fsToPackageId (fsLit "dph-par")
thisGhcPackageId = fsToPackageId (fsLit ("ghc-" ++ cProjectVersion))
thisGhcPackageId = fsToPackageId (fsLit "ghc")
interactivePackageId = fsToPackageId (fsLit "interactive")
-- | This is the package Id for the current program. It is the default
......@@ -104,6 +104,13 @@ Library
Include-Dirs: . parser utils
if impl( ghc >= 7.9 )
-- We need to set the package name to ghc (without a version number)
-- as it's magic. But we can't set it for old versions of GHC (e.g.
-- when bootstrapping) because those versions of GHC don't understand
-- that GHC is wired-in.
GHC-Options: -package-name ghc
if flag(stage1)
Include-Dirs: stage1
......@@ -481,6 +481,7 @@ findWiredInPackages dflags pkgs = do
dphParPackageId ]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment