Implement function-sections for Haskell code, #8405
[ghc.git] / utils / mkUserGuidePart / Options / Linking.hs
1 module Options.Linking where
2
3 import Types
4
5 linkingOptions :: [Flag]
6 linkingOptions =
7 [ flag { flagName = "-shared"
8 , flagDescription =
9 "Generate a shared library (as opposed to an executable)"
10 , flagType = DynamicFlag
11 }
12 , flag { flagName = "-staticlib"
13 , flagDescription =
14 "On Darwin/OS X/iOS only, generate a standalone static library " ++
15 "(as opposed to an executable). This is the usual way to " ++
16 "compile for iOS."
17 , flagType = DynamicFlag
18 }
19 , flag { flagName = "-fPIC"
20 , flagDescription =
21 "Generate position-independent code (where available)"
22 , flagType = DynamicFlag
23 }
24 , flag { flagName = "-dynamic"
25 , flagDescription = "Use dynamic Haskell libraries (if available)"
26 , flagType = DynamicFlag
27 }
28 , flag { flagName = "-dynamic-too"
29 , flagDescription =
30 "Build dynamic object files *as well as* static object files " ++
31 "during compilation"
32 , flagType = DynamicFlag
33 }
34 , flag { flagName = "-dyno"
35 , flagDescription =
36 "Set the output path for the *dynamically* linked objects"
37 , flagType = DynamicFlag
38 }
39 , flag { flagName = "-dynosuf"
40 , flagDescription = "Set the output suffix for dynamic object files"
41 , flagType = DynamicFlag
42 }
43 , flag { flagName = "-dynload"
44 , flagDescription =
45 "Selects one of a number of modes for finding shared libraries at runtime."
46 , flagType = DynamicFlag
47 }
48 , flag { flagName = "-framework⟨name⟩"
49 , flagDescription =
50 "On Darwin/OS X/iOS only, link in the framework ⟨name⟩. This " ++
51 "option corresponds to the ``-framework`` option for Apple's Linker."
52 , flagType = DynamicFlag
53 }
54 , flag { flagName = "-framework-path⟨name⟩"
55 , flagDescription =
56 "On Darwin/OS X/iOS only, add ⟨dir⟩ to the list of directories " ++
57 "searched for frameworks. This option corresponds to the ``-F`` "++
58 "option for Apple's Linker."
59 , flagType = DynamicFlag
60 }
61 , flag { flagName = "-l⟨lib⟩"
62 , flagDescription = "Link in library ⟨lib⟩"
63 , flagType = DynamicFlag
64 }
65 , flag { flagName = "-L⟨dir⟩"
66 , flagDescription =
67 "Add ⟨dir⟩ to the list of directories searched for libraries"
68 , flagType = DynamicFlag
69 }
70 , flag { flagName = "-main-is"
71 , flagDescription = "Set main module and function"
72 , flagType = DynamicFlag
73 }
74 , flag { flagName = "--mk-dll"
75 , flagDescription = "DLL-creation mode (Windows only)"
76 , flagType = DynamicFlag
77 }
78 , flag { flagName = "-no-hs-main"
79 , flagDescription = "Don't assume this program contains ``main``"
80 , flagType = DynamicFlag
81 }
82 , flag { flagName = "-rtsopts,-rtsopts={none,some,all}"
83 , flagDescription =
84 "Control whether the RTS behaviour can be tweaked via command-line"++
85 "flags and the ``GHCRTS`` environment variable. Using ``none`` " ++
86 "means no RTS flags can be given; ``some`` means only a minimum " ++
87 "of safe options can be given (the default), and ``all`` (or no " ++
88 "argument at all) means that all RTS flags are permitted."
89 , flagType = DynamicFlag
90 }
91 , flag { flagName = "-with-rtsopts=opts"
92 , flagDescription = "Set the default RTS options to ⟨opts⟩."
93 , flagType = DynamicFlag
94 }
95 , flag { flagName = "-no-rtsopts-suggestions"
96 , flagDescription =
97 "Don't print RTS suggestions about linking with ``-rtsopts``."
98 , flagType = DynamicFlag
99 }
100 , flag { flagName = "-no-link"
101 , flagDescription = "Omit linking"
102 , flagType = DynamicFlag
103 }
104 , flag { flagName = "-split-objs"
105 , flagDescription = "Split objects (for libraries)"
106 , flagType = DynamicFlag
107 }
108 , flag { flagName = "-split-sections"
109 , flagDescription = "Split sections for link-time dead-code stripping"
110 , flagType = DynamicFlag
111 }
112 , flag { flagName = "-static"
113 , flagDescription = "Use static Haskell libraries"
114 , flagType = DynamicFlag
115 }
116 , flag { flagName = "-threaded"
117 , flagDescription = "Use the threaded runtime"
118 , flagType = DynamicFlag
119 }
120 , flag { flagName = "-debug"
121 , flagDescription = "Use the debugging runtime"
122 , flagType = DynamicFlag
123 }
124 , flag { flagName = "-ticky"
125 , flagDescription =
126 "For linking, this simply implies ``-debug``; "++
127 "see :ref:`ticky-ticky`."
128 , flagType = DynamicFlag
129 }
130 , flag { flagName = "-eventlog"
131 , flagDescription = "Enable runtime event tracing"
132 , flagType = DynamicFlag
133 }
134 , flag { flagName = "-fno-gen-manifest"
135 , flagDescription = "Do not generate a manifest file (Windows only)"
136 , flagType = DynamicFlag
137 }
138 , flag { flagName = "-fno-embed-manifest"
139 , flagDescription =
140 "Do not embed the manifest in the executable (Windows only)"
141 , flagType = DynamicFlag
142 }
143 , flag { flagName = "-fno-shared-implib"
144 , flagDescription =
145 "Don't generate an import library for a DLL (Windows only)"
146 , flagType = DynamicFlag
147 }
148 , flag { flagName = "-dylib-install-name ⟨path⟩"
149 , flagDescription =
150 "Set the install name (via ``-install_name`` passed to Apple's " ++
151 "linker), specifying the full install path of the library file. " ++
152 "Any libraries or executables that link with it later will pick " ++
153 "up that path as their runtime search location for it. " ++
154 "(Darwin/OS X only)"
155 , flagType = DynamicFlag
156 }
157 , flag { flagName = "-rdynamic"
158 , flagDescription =
159 "This instructs the linker to add all symbols, not only used " ++
160 "ones, to the dynamic symbol table. Currently Linux and " ++
161 "Windows/MinGW32 only. This is equivalent to using " ++
162 "``-optl -rdynamic`` on Linux, and ``-optl -export-all-symbols`` " ++
163 "on Windows."
164 , flagType = DynamicFlag
165 }
166 ]