Skip to content

Commit

Permalink
Ensure that we use vanilla rts
Browse files Browse the repository at this point in the history
Also ensure that GHC properly fails when using -threaded or -debug
  • Loading branch information
hsyl20 committed Feb 21, 2025
1 parent b6a2d46 commit ab56989
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Build.hs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ buildGhcStage booting opts cabal ghc0 dst = do
, " executable-static: True"
, ""
, "package ghc-bin"
, " flags: +internal-interpreter"
-- FIXME: we don't support the threaded rts way yet
, " flags: +internal-interpreter -threaded"
, ""
, "package hsc2hs"
, " flags: +in-ghc-tree" -- allow finding template-hsc.h in GHC's /lib
Expand Down Expand Up @@ -459,7 +460,7 @@ buildBootLibraries cabal ghc ghcpkg derive_constants genapply genprimop opts dst
let rts_options =
[ "package rts"
, def_string "ProjectVersion" (Text.unpack (gboVersionInt opts))
, def_string "RtsWay" "FIXME"
, def_string "RtsWay" "v" -- FIXME
, def_string "HostPlatform" "x86_64-unknown-linux" -- FIXME
, def_string "HostArch" "x86_64" -- FIXME: appropriate value required for the tests
, def_string "HostOS" "linux" -- FIXME: appropriate value required for the tests
Expand Down Expand Up @@ -1030,5 +1031,6 @@ generateSettings ghc_toolchain Settings{..} dst = do
kvs <- (Map.fromList . read) <$> readFile gen_settings_path :: IO (Map String String)
let kvs' = Map.insert "Relative Global Package DB" "../pkgs"
$ Map.insert "Support SMP" "NO" -- FIXME: this depends on the different ways used to build the RTS!
$ Map.insert "RTS ways" "v" -- FIXME: this depends on the different ways used to build the RTS!
$ kvs
writeFile (dst </> "lib/settings") (show $ Map.toList kvs')
9 changes: 6 additions & 3 deletions compiler/GHC/Unit/Info.hs
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,12 @@ unitHsLibs namever ways0 p = map (mkDynName . addSuffix . ST.unpack) (unitLibrar
--
-- This change elevates the need to add custom hooks
-- and handling specifically for the `rts` package.
addSuffix rts@"HSrts" = rts ++ (expandTag rts_tag)
addSuffix rts@"HSrts-1.0.3" = rts ++ (expandTag rts_tag)
addSuffix other_lib = other_lib ++ (expandTag tag)
is_rts x = (x == "HSrts" || "HSrts-" `isPrefixOf` x)
-- ensure we don't consider packages with names like "rts-foo"
&& unitPackageName p == PackageName (fsLit "rts")
addSuffix x
| is_rts x = x ++ (expandTag rts_tag)
| otherwise = x ++ (expandTag tag)

expandTag t | null t = ""
| otherwise = '_':t

0 comments on commit ab56989

Please sign in to comment.