Skip to content

Commit 1174e85

Browse files
committed
Build ghc-prim
1 parent 7dbb512 commit 1174e85

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ _build/stage1/bin/ghc: _build/stage0/bin/ghc
215215
--ghc-options='-this-unit-id=rts' \
216216
--builddir=_build/stage1/cabal/
217217

218+
# generate files related to primops
219+
220+
gcc -E -undef -traditional -P -x c _build/stage1/src/libraries/ghc/GHC/Builtin/primops.txt.pp > _build/stage1/src/libraries/ghc/GHC/Builtin/primops.txt
221+
_build/stage0/bin/genprimopcode --make-haskell-source < _build/stage1/src/libraries/ghc/GHC/Builtin/primops.txt > _build/stage1/src/libraries/ghc-prim/GHC/Prim.hs
222+
_build/stage0/bin/genprimopcode --make-haskell-wrappers < _build/stage1/src/libraries/ghc/GHC/Builtin/primops.txt > _build/stage1/src/libraries/ghc-prim/GHC/PrimopWrappers.hs
218223

219224

220225
HADRIAN_SETTINGS='$(HADRIAN_SETTINGS_STAGE1)' \

compiler/GHC/Unit/Finder.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,7 @@ findInstalledHomeModule fc fopts home_unit mod_name = do
466466
| finder_lookupHomeInterfaces fopts = (hi_dir_path, hi_exts)
467467
| otherwise = (home_path, source_exts)
468468
in
469-
470-
-- special case for GHC.Prim; we won't find it in the filesystem.
471-
-- This is important only when compiling the base package (where GHC.Prim
472-
-- is a home module).
473-
if mod `installedModuleEq` gHC_PRIM
474-
then return (InstalledFound (error "GHC.Prim ModLocation"))
475-
else searchPathExts search_dirs mod exts
469+
searchPathExts search_dirs mod exts
476470

477471
-- | Prepend the working directory to the search path.
478472
augmentImports :: OsPath -> [OsPath] -> [OsPath]

0 commit comments

Comments
 (0)