diff options
author | Ian Lynagh <igloo@earth.li> | 2009-07-14 16:56:31 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2009-07-14 16:56:31 +0000 |
commit | 269949584b7c124e95543c5c006822db4cec4d8b (patch) | |
tree | 6ce377a155da47f0ead03b8a6cbf85653bb87473 | |
parent | 380e4e40e2e6b7ccb18b7103acb075d80168e595 (diff) | |
download | haskell-269949584b7c124e95543c5c006822db4cec4d8b.tar.gz |
Add the -fno-shared-implib flag
Patch from
Max Bolingbroke <batterseapower@hotmail.com>
Rerecorded to avoid conflicts.
-rw-r--r-- | compiler/main/DriverPipeline.hs | 4 | ||||
-rw-r--r-- | compiler/main/DynFlags.hs | 4 | ||||
-rw-r--r-- | docs/users_guide/flags.xml | 6 | ||||
-rw-r--r-- | docs/users_guide/phases.xml | 22 |
4 files changed, 35 insertions, 1 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 1849c6b91e..c4ac65f7b6 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -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 ( diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index bebea761cd..37f1171eec 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -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 ) ] diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index bfffb096c4..0b22a396b7 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -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> diff --git a/docs/users_guide/phases.xml b/docs/users_guide/phases.xml index 2026a34f59..ec1436434f 100644 --- a/docs/users_guide/phases.xml +++ b/docs/users_guide/phases.xml @@ -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> |