New syntax for GADT-style record declarations, and associated refactoring
[ghc-hetmet.git] / docs / users_guide / phases.xml
index a141352..467f6ad 100644 (file)
     <title>Forcing options to a particular phase</title>
     <indexterm><primary>forcing GHC-phase options</primary></indexterm>
 
-    <para>Options can be forced through to a particlar compilation
+    <para>Options can be forced through to a particular compilation
     phase, using the following flags:</para>
 
     <variablelist>
       </varlistentry>
       <varlistentry>
         <term>
-          <option>-optdep</option>  <replaceable>option</replaceable>
-          <indexterm><primary><option>-optdep</option></primary></indexterm>
-        </term>
-        <listitem>
-          <para>Pass <replaceable>option</replaceable> to the
-          dependency generator.</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
           <option>-optwindres</option>  <replaceable>option</replaceable>
           <indexterm><primary><option>-optwindres</option></primary></indexterm>
         </term>
@@ -412,7 +402,7 @@ $ cat foo.hspp</screen>
       <listitem>
         <para>This symbol is defined when pre-processing Haskell
           (input) and pre-processing C (GHC output).  Since GHC from
-          verion 4.00 now supports concurrent haskell by default,
+          version 4.00 now supports concurrent haskell by default,
           this symbol is always defined.</para>
         </listitem>
       </varlistentry>
@@ -668,10 +658,7 @@ $ cat foo.hspp</screen>
         <listitem>
           <para>When generating code, assume that entities imported from a
           different package will reside in a different shared library or
-          binary. This currently works on Mac OS X; it works on PowerPC Linux when
-          using the native code generator. As with <option>-fPIC</option>,
-          x86 Linux support is not quite ready yet. Windows is not supported,
-          and it is a no-op on PowerPC64 Linux.</para>
+          binary.</para>
           <para>Note that this option also causes GHC to use shared libraries
           when linking.</para>
         </listitem>
@@ -838,10 +825,10 @@ $ cat foo.hspp</screen>
           <indexterm><primary><option>-dynamic</option></primary></indexterm>
         </term>
         <listitem>
-          <para>Tell the linker to use shared Haskell libraries, if
-          available (this option is only supported on Mac OS X at the
-          moment, and also note that your distribution of GHC may
-          not have been supplied with shared libraries).</para>
+          <para>This flag switches to shared Haskell libraries for
+          linking. See <xref linkend="building-packages" /> on how to
+          create them.</para>
+
           <para>Note that this option also has an effect on
           code generation (see above).</para>
         </listitem>
@@ -849,6 +836,36 @@ $ cat foo.hspp</screen>
 
       <varlistentry>
         <term>
+          <option>-shared</option>
+          <indexterm><primary><option>-shared</option></primary></indexterm>
+        </term>
+        <listitem>
+          <para>Instead of creating an executable, GHC produces a
+          shared object with this linker flag. Depending on the
+          operating system target, this might be an ELF DSO, a Windows
+          DLL, or a Mac OS dylib. GHC hides the operating system
+          details beneath this uniform flag.</para>
+
+         <para>The flags <option>-dynamic</option>/<option>-static</option> control whether the
+         resulting shared object links statically or dynamically to
+         Haskell package libraries given as <option>-package</option> option. Non-Haskell
+         libraries are linked as gcc would regularly link it on your
+         system, e.g. on most ELF system the linker uses the dynamic
+         libraries when found.</para>
+
+         <para>Object files linked into shared objects must be
+         compiled with <option>-fPIC</option>, see <xref linkend="options-codegen" /></para>
+
+         <para>When creating shared objects for Haskell packages, the
+         shared object must be named properly, so that GHC recognizes
+         the shared object when linked against this package. See
+         shared object name mangling.</para>
+        </listitem>
+      </varlistentry>
+
+
+      <varlistentry>
+        <term>
           <option>-main-is <replaceable>thing</replaceable></option>
           <indexterm><primary><option>-main-is</option></primary></indexterm>
           <indexterm><primary>specifying your own main function</primary></indexterm>
@@ -949,23 +966,11 @@ $ cat foo.hspp</screen>
               machine.  See <xref linkend="using-smp" />.</para>
 
               <para>The ability to make a foreign call that does not
-              block all other Haskell threads.</para>
-
-              <para>The ability to invoke foreign exported Haskell
-              functions from multiple OS threads.</para>
+              block all other Haskell threads, and to invoke
+              foreign-exported Haskell functions from multiple OS
+              threads. See <xref linkend="ffi-threads" />.</para>
             </listitem>
           </itemizedlist>
-
-          <para>With <option>-threaded</option>, calls to foreign
-          functions are made using the same OS thread that created the
-          Haskell thread (if it was created by a call to a foreign
-          exported Haskell function), or an arbitrary OS thread
-          otherwise (if the Haskell thread was created by
-          <literal>forkIO</literal>).</para>
-
-          <para>More details on the use of "bound threads" in the
-          threaded runtime can be found in the <ulink
-          url="../libraries/base/Control.Concurrent.html"><literal>Control.Concurrent</literal></ulink> module.</para>
         </listitem>
       </varlistentry>