summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-07-22 07:26:47 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-09 15:11:58 -0400
commitd5de970dafd5876ef30601697576167f56b9c132 (patch)
treecb2ccf4bc4c13e39e211beb60915d7bb4ccc477d /utils
parentfc350dba63da7eefbaa2793fe9fe99f8571b75c0 (diff)
downloadhaskell-d5de970dafd5876ef30601697576167f56b9c132.tar.gz
Move `/includes` to `/rts/include`, sort per package better
In order to make the packages in this repo "reinstallable", we need to associate source code with a specific packages. Having a top level `/includes` dir that mixes concerns (which packages' includes?) gets in the way of this. To start, I have moved everything to `rts/`, which is mostly correct. There are a few things however that really don't belong in the rts (like the generated constants haskell type, `CodeGen.Platform.h`). Those needed to be manually adjusted. Things of note: - No symlinking for sake of windows, so we hard-link at configure time. - `CodeGen.Platform.h` no longer as `.hs` extension (in addition to being moved to `compiler/`) so as not to confuse anyone, since it is next to Haskell files. - Blanket `-Iincludes` is gone in both build systems, include paths now more strictly respect per-package dependencies. - `deriveConstants` has been taught to not require a `--target-os` flag when generating the platform-agnostic Haskell type. Make takes advantage of this, but Hadrian has yet to.
Diffstat (limited to 'utils')
-rw-r--r--utils/deriveConstants/Main.hs16
-rw-r--r--utils/deriveConstants/deriveConstants.cabal2
-rw-r--r--utils/genapply/Main.hs10
3 files changed, 14 insertions, 14 deletions
diff --git a/utils/deriveConstants/Main.hs b/utils/deriveConstants/Main.hs
index 5a227fb63f..8d3a6798c0 100644
--- a/utils/deriveConstants/Main.hs
+++ b/utils/deriveConstants/Main.hs
@@ -10,7 +10,7 @@ into non-C source containing this information.
We want to get information about code generated by the C compiler,
such as the sizes of types, and offsets of struct fields. We need
this because the layout of certain runtime objects is defined in C
-headers (e.g. includes/rts/storage/Closures.h), but we need access to
+headers (e.g. rts/include/rts/storage/Closures.h), but we need access to
the layout of these structures from a Haskell program (GHC).
One way to do this is to compile and run a C program that includes the
@@ -46,15 +46,15 @@ main = do opts <- parseArgs
Nothing -> die ("No " ++ descr ++ " given")
mode <- getOption "mode" o_mode
fn <- getOption "output filename" o_outputFilename
- os <- getOption "target os" o_targetOS
-
- let haskellWanteds = [ what | (wh, what) <- wanteds os
- , wh `elem` [Haskell, Both] ]
case mode of
- Gen_Haskell_Type -> writeHaskellType fn haskellWanteds
+ Gen_Haskell_Type ->
+ writeHaskellType fn
+ [ what | (wh, what) <- wanteds "OS must not matter"
+ , wh `elem` [Haskell, Both] ]
Gen_Computed cm ->
- do tmpdir <- getOption "tmpdir" o_tmpdir
+ do os <- getOption "target os" o_targetOS
+ tmpdir <- getOption "tmpdir" o_tmpdir
gccProg <- getOption "gcc program" o_gccProg
nmProg <- getOption "nm program" o_nmProg
let verbose = o_verbose opts
@@ -715,7 +715,7 @@ getWanted verbose os tmpdir gccProgram gccFlags nmProgram mobjdumpProgram
"#define PROFILING",
"#define THREADED_RTS",
"",
- "#include \"PosixSource.h\"",
+ "#include \"rts/PosixSource.h\"",
"#include \"Rts.h\"",
"#include \"StableName.h\"",
"#include \"Capability.h\"",
diff --git a/utils/deriveConstants/deriveConstants.cabal b/utils/deriveConstants/deriveConstants.cabal
index 36ba7ebe1f..503cae1f25 100644
--- a/utils/deriveConstants/deriveConstants.cabal
+++ b/utils/deriveConstants/deriveConstants.cabal
@@ -8,7 +8,7 @@ Maintainer: XXX
Synopsis: Derive header files containing various constants for the GHC build process
Description:
This utility is responsible for generating a number of C header files
- needed during the GHC build process. See @includes/ghc.mk@ in the GHC
+ needed during the GHC build process. See @rts/include/ghc.mk@ in the GHC
build system for details.
Category: Development
build-type: Simple
diff --git a/utils/genapply/Main.hs b/utils/genapply/Main.hs
index a6d944efa4..a0209966db 100644
--- a/utils/genapply/Main.hs
+++ b/utils/genapply/Main.hs
@@ -15,16 +15,16 @@ module Main(main) where
-- Note [Genapply target as host for RTS macros]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- We improperly include *HOST* macros for our target...
-#include "../../includes/ghcconfig.h"
+#include "../../rts/include/ghcconfig.h"
-- ...so that this header defines the right stuff. It is the RTS's host, but
-- our target, as we are generating code that uses that RTS.
-#include "../../includes/stg/MachRegsForHost.h"
+#include "../../rts/include/stg/MachRegsForHost.h"
-#include "../../includes/rts/Constants.h"
+#include "../../rts/include/rts/Constants.h"
-- Needed for TAG_BITS
-#include "../../includes/MachDeps.h"
+#include "../../rts/include/MachDeps.h"
import Prelude hiding ((<>))
@@ -1002,7 +1002,7 @@ applyTypes = [
-- changes, so we could share the apply/save code between lots of cases.
--
-- NOTE: other places to change if you change stackApplyTypes:
--- - includes/rts/storage/FunTypes.h
+-- - rts/include/rts/storage/FunTypes.h
-- - GHC.StgToCmm.Layout: stdPattern
stackApplyTypes = [
[],