@@ -376,8 +376,7 @@ buildBootLibraries cabal ghc ghcpkg derive_constants genapply genprimop opts = d
376
376
-- platform constants in the package db and fails. The flag is already
377
377
-- set in rts.cabal but for some reason it isn't always passed :shrug:
378
378
, " --ghc-options=-this-unit-id=rts"
379
- , " --ghc-options=-DProjectVersion=913"
380
- , " --ghc-options=\" -optc=-DProjectVersion=\\\" 913\\\"\" "
379
+ , " --ghc-options=\" -optc=-DProjectVersion=\\\" " ++ Text. unpack (gboVersionInt opts) ++ " \\\"\" "
381
380
, " --ghc-options=\" -optc=-DRtsWay=\\\" FIXME\\\"\" "
382
381
, " --ghc-options=\" -optc=-DHostPlatform=\\\" FIXME\\\"\" "
383
382
, " --ghc-options=\" -optc=-DHostArch=\\\" FIXME\\\"\" "
@@ -431,7 +430,11 @@ buildBootLibraries cabal ghc ghcpkg derive_constants genapply genprimop opts = d
431
430
run_genapply [derived_constants, " -V32" ] (src_rts </> " AutoApply_V32.cmm" )
432
431
run_genapply [derived_constants, " -V64" ] (src_rts </> " AutoApply_V64.cmm" )
433
432
434
- -- Generate genprimopcode
433
+ -- Generate primop code for ghc-prim
434
+ --
435
+ -- Note that this can't be done in a Setup.hs for ghc-prim because
436
+ -- cabal-install can't build it because t depends on base, Cabal, etc.
437
+ -- libraries that aren't built yet.
435
438
let primops_txt = src </> " libraries/ghc/GHC/Builtin/primops.txt"
436
439
let primops_txt_pp = primops_txt <.> " .pp"
437
440
primops <- readCreateProcess (shell $ " gcc -E -undef -traditional -P -x c " ++ primops_txt_pp) " "
@@ -478,11 +481,20 @@ buildBootLibraries cabal ghc ghcpkg derive_constants genapply genprimop opts = d
478
481
let build_boot_cmd = runCabal cabal
479
482
[ " build"
480
483
, " --project-file=cabal.project-stage1" -- TODO: replace with command-line args
481
- , " ghc-prim" , " ghc-internal" , " base"
482
484
, " --with-compiler=" ++ ghcPath ghc -- FIXME: escape path
483
485
, " --with-hc-pkg=" ++ ghcPkgPath ghcpkg -- FIXME: escape path
484
486
, " --ghc-options=\" -ghcversion-file=" ++ ghcversionh ++ " \" "
485
487
, " --builddir=" ++ build_dir
488
+ -- never reinstall the RTS during this step: we should use the one
489
+ -- installed at the previous step. Otherwise we risk using invalid
490
+ -- generated files.
491
+ -- FIXME: but it doesn't work because the rts isn't really installed
492
+ -- , "--constraint=rts installed"
493
+
494
+ -- targets
495
+ , " ghc-prim"
496
+ , " ghc-internal"
497
+ , " base"
486
498
]
487
499
488
500
msg " - Building boot libraries..."
0 commit comments