Changeset View
Changeset View
Standalone View
Standalone View
docs/users_guide/packages.rst
Show First 20 Lines • Show All 1017 Lines • ▼ Show 20 Line(s) | 1010 | - Building a static library is done by using the :command:`ar` tool, like so: | |||
---|---|---|---|---|---|
1018 | differ slightly on your system, so check the documentation if you run | 1018 | differ slightly on your system, so check the documentation if you run | ||
1019 | into difficulties. | 1019 | into difficulties. | ||
1020 | 1020 | | |||
1021 | - To load a package ``foo``, GHCi can load its ``libHSfoo.a`` library | 1021 | - To load a package ``foo``, GHCi can load its ``libHSfoo.a`` library | ||
1022 | directly, but it can also load a package in the form of a single | 1022 | directly, but it can also load a package in the form of a single | ||
1023 | ``HSfoo.o`` file that has been pre-linked. Loading the ``.o`` file is | 1023 | ``HSfoo.o`` file that has been pre-linked. Loading the ``.o`` file is | ||
1024 | slightly quicker, but at the expense of having another copy of the | 1024 | slightly quicker, but at the expense of having another copy of the | ||
1025 | compiled package. The rule of thumb is that if the modules of the | 1025 | compiled package. The rule of thumb is that if the modules of the | ||
1026 | package were compiled with :ghc-flag:`-split-objs` then building the | 1026 | package were compiled with :ghc-flag:`-split-sections` then building the | ||
1027 | ``HSfoo.o`` is worthwhile because it saves time when loading the | 1027 | ``HSfoo.o`` is worthwhile because it saves time when loading the | ||
1028 | package into GHCi. Without :ghc-flag:`-split-objs`, there is not much | 1028 | package into GHCi. Without :ghc-flag:`-split-sections`, there is not much | ||
1029 | difference in load time between the ``.o`` and ``.a`` libraries, so | 1029 | difference in load time between the ``.o`` and ``.a`` libraries, so | ||
1030 | it is better to save the disk space and only keep the ``.a`` around. | 1030 | it is better to save the disk space and only keep the ``.a`` around. | ||
1031 | In a GHC distribution we provide ``.o`` files for most packages | 1031 | In a GHC distribution we provide ``.o`` files for most packages | ||
1032 | except the GHC package itself. | 1032 | except the GHC package itself. | ||
1033 | 1033 | | |||
1034 | The ``HSfoo.o`` file is built by Cabal automatically; use | 1034 | The ``HSfoo.o`` file is built by Cabal automatically; use | ||
1035 | ``--disable-library-for-ghci`` to disable it. To build one manually, | 1035 | ``--disable-library-for-ghci`` to disable it. To build one manually, | ||
1036 | the following GNU ``ld`` command can be used: | 1036 | the following GNU ``ld`` command can be used: | ||
▲ Show 20 Lines • Show All 409 Lines • Show Last 20 Lines |