Ticket #3347: NoSharedImplib.patch

File NoSharedImplib.patch, 4.9 KB (added by batterseapower, 5 years ago)

Implementation of -fno-shared-implib

Line 
1Fri Jul  3 19:56:22 BST 2009  Max Bolingbroke <batterseapower@hotmail.com>
2  * Add the -fno-shared-implib flag
3
4New patches:
5
6[Add the -fno-shared-implib flag
7Max Bolingbroke <batterseapower@hotmail.com>**20090703185622
8 Ignore-this: cda043c830bc41ab76a26d53e65269b6
9] {
10hunk ./compiler/main/DriverPipeline.hs 1593
11          , SysTools.Option "-o"
12          , SysTools.FileOption "" output_fn
13          , SysTools.Option "-shared"
14-         , SysTools.FileOption "-Wl,--out-implib=" (output_fn ++ ".a")
15+         ] ++
16+         [ SysTools.FileOption "-Wl,--out-implib=" (output_fn ++ ".a")
17+         | dopt Opt_SharedImplib dflags
18          ]
19         ++ map (SysTools.FileOption "") o_files
20         ++ map SysTools.Option (
21hunk ./compiler/main/DynFlags.hs 310
22    | Opt_PrintBindContents
23    | Opt_GenManifest
24    | Opt_EmbedManifest
25+   | Opt_SharedImplib
26 
27        -- temporary flags
28    | Opt_RunCPS
29hunk ./compiler/main/DynFlags.hs 695
30 
31             Opt_DoAsmMangling,
32 
33+            Opt_SharedImplib,
34+
35             Opt_GenManifest,
36             Opt_EmbedManifest,
37             Opt_PrintBindContents
38hunk ./compiler/main/DynFlags.hs 1740
39     deprecatedForLanguage "IncoherentInstances" ),
40   ( "gen-manifest",                     Opt_GenManifest, const Supported ),
41   ( "embed-manifest",                   Opt_EmbedManifest, const Supported ),
42+  ( "shared-implib",                    Opt_SharedImplib, const Supported ),
43   ( "implicit-import-qualified",        Opt_ImplicitImportQualified, const Supported )
44   ]
45 
46hunk ./docs/users_guide/flags.xml 1809
47              <entry>dynamic</entry>
48              <entry>-</entry>
49            </row>
50+           <row>
51+             <entry><option>-no-shared-implib</option></entry>
52+             <entry>Don't generate an import library for a DLL (Windows only)</entry>
53+             <entry>dynamic</entry>
54+             <entry>-</entry>
55+           </row>
56          </tbody>
57        </tgroup>
58       </informaltable>
59hunk ./docs/users_guide/phases.xml 1042
60               />).</para>
61         </listitem>
62       </varlistentry>
63+         
64+      <varlistentry>
65+        <term>
66+          <option>-fno-shared-implib</option>
67+          <indexterm><primary><option>-fno-shared-implib</option></primary>
68+          </indexterm>
69+        </term>
70+        <listitem>
71+          <para>DLLs on Windows are typically linked to by linking to a corresponding
72+            <literal>.lib</literal> or <literal>.dll.a</literal> - the so-called import library.
73+            GHC will typically generate such a file for every DLL you create by compiling in
74+            <literal>-shared</literal> mode. However, sometimes you don't want to pay the
75+            disk-space cost of creating this import library, which can be substantial - it
76+            might require as much space as the code itself, as Haskell DLLs tend to export
77+            lots of symbols.</para>
78+           
79+          <para>As long as you are happy to only be able to link to the DLL using
80+            <literal>GetProcAddress</literal> and friends, you can supply the
81+            <option>-fno-shared-implib</option> flag to disable the creation of the import
82+            library entirely.</para>
83+        </listitem>
84+      </varlistentry>
85     </variablelist>
86   </sect2>
87 
88}
89
90Context:
91
92[Fix #2197 (properly this time)
93Simon Marlow <marlowsd@gmail.com>**20090701122354
94 Ignore-this: 39b6e4b0bcdd8c2f4660f976b7db768d
95 
96 $ ./inplace/bin/ghc-stage2 --interactive
97 GHCi, version 6.11.20090701: http://www.haskell.org/ghc/  :? for help
98 ghc-stage2: GHCi cannot be used when compiled with -prof
99 [1]    32473 exit 1     ./inplace/bin/ghc-stage2 --interactive
100]
101[make GhcProfiled work, and add a "prof" flavour to build.mk
102Simon Marlow <marlowsd@gmail.com>**20090701114211
103 Ignore-this: 386d347e4ad8b6c2bd40a2ba7da31ba6
104 
105 Building a profiled GHC is as simple as adding
106 
107 GhcLibWays += p
108 GhcProfiled = YES
109 
110 to your build.mk and saying 'make'.  Then you have a profiled
111 inplace/bin/ghc-stage2.
112]
113[remove unnecessary $(RM)s
114Simon Marlow <marlowsd@gmail.com>**20090701110609
115 Ignore-this: f326ec8931d0d484a66b67ce1270cc6e
116]
117['make html' in a library builds the Haddock docs
118Simon Marlow <marlowsd@gmail.com>**20090630111137
119 Ignore-this: 781bf10e2d4bca23b7f70c6f0465d120
120]
121[fix GC bug introduced with the C finalizer support
122Simon Marlow <marlowsd@gmail.com>**20090630080834
123 Ignore-this: 3567e3adb5ae4a5dcbce81733487f348
124]
125[Add a configure test for whether or not __mingw_vfprintf exists
126Ian Lynagh <igloo@earth.li>**20090627150501]
127[Fix #3319, and do various tidyups at the same time
128Simon Marlow <marlowsd@gmail.com>**20090626095421
129 Ignore-this: ea54175f6bd49e101d7b33392764f643
130  - converting a THSyn FFI declaration to HsDecl was broken; fixed
131  - pretty-printing of FFI declarations was variously bogus; fixed
132  - there was an unused "library" field in CImport; removed
133]
134[rename cache variable to keep recent autoconfs happy
135Ross Paterson <ross@soi.city.ac.uk>**20090626131410
136 Ignore-this: 187091bbe78f2b14402162acfb98180f
137]
138[TAG 2009-06-25
139Ian Lynagh <igloo@earth.li>**20090625155528]
140Patch bundle hash:
141cf833841f1e514852b7c5dd2378abbfdb7c26a12