Commit 26994958 authored by Ian Lynagh's avatar Ian Lynagh

Add the -fno-shared-implib flag

Patch from
    Max Bolingbroke <batterseapower@hotmail.com>
Rerecorded to avoid conflicts.
parent 380e4e40
......@@ -1590,7 +1590,9 @@ linkDynLib dflags o_files dep_packages = do
, SysTools.Option "-o"
, SysTools.FileOption "" output_fn
, SysTools.Option "-shared"
, SysTools.FileOption "-Wl,--out-implib=" (output_fn ++ ".a")
] ++
[ SysTools.FileOption "-Wl,--out-implib=" (output_fn ++ ".a")
| dopt Opt_SharedImplib dflags
]
++ map (SysTools.FileOption "") o_files
++ map SysTools.Option (
......
......@@ -310,6 +310,7 @@ data DynFlag
| Opt_GenManifest
| Opt_EmbedManifest
| Opt_EmitExternalCore
| Opt_SharedImplib
-- temporary flags
| Opt_RunCPS
......@@ -694,6 +695,8 @@ defaultDynFlags =
Opt_DoAsmMangling,
Opt_SharedImplib,
Opt_GenManifest,
Opt_EmbedManifest,
Opt_PrintBindContents
......@@ -1742,6 +1745,7 @@ fFlags = [
( "gen-manifest", Opt_GenManifest, const Supported ),
( "embed-manifest", Opt_EmbedManifest, const Supported ),
( "ext-core", Opt_EmitExternalCore, const Supported ),
( "shared-implib", Opt_SharedImplib, const Supported ),
( "implicit-import-qualified", Opt_ImplicitImportQualified, const Supported )
]
......
......@@ -1833,6 +1833,12 @@
<entry>dynamic</entry>
<entry>-</entry>
</row>
<row>
<entry><option>-no-shared-implib</option></entry>
<entry>Don't generate an import library for a DLL (Windows only)</entry>
<entry>dynamic</entry>
<entry>-</entry>
</row>
</tbody>
</tgroup>
</informaltable>
......
......@@ -1052,6 +1052,28 @@ $ cat foo.hspp</screen>
/>).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-fno-shared-implib</option>
<indexterm><primary><option>-fno-shared-implib</option></primary>
</indexterm>
</term>
<listitem>
<para>DLLs on Windows are typically linked to by linking to a corresponding
<literal>.lib</literal> or <literal>.dll.a</literal> - the so-called import library.
GHC will typically generate such a file for every DLL you create by compiling in
<literal>-shared</literal> mode. However, sometimes you don't want to pay the
disk-space cost of creating this import library, which can be substantial - it
might require as much space as the code itself, as Haskell DLLs tend to export
lots of symbols.</para>
<para>As long as you are happy to only be able to link to the DLL using
<literal>GetProcAddress</literal> and friends, you can supply the
<option>-fno-shared-implib</option> flag to disable the creation of the import
library entirely.</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
......
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