Commit a30dbc64 authored by Simon Marlow's avatar Simon Marlow

comment about why this program exists

parent feab4e27
{- ------------------------------------------------------------------------
(c) The GHC Team, 1992-2012
......@@ -8,6 +7,22 @@ declarations in the header files (primarily struct field offsets)
and generates various files, such as a header file that can be #included
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
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
header files and prints out the sizes and offsets. However, when we
are cross-compiling, we can't run a C program compiled for the target
So, this program works as follows: we generate a C program that when
compiled to an object file, has the information we need encoded as
symbol sizes. This means that we can extract the information without
needing to run the program, by inspecting the object file using 'nm'.
------------------------------------------------------------------------ -}
import Control.Monad (when, unless)
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