summaryrefslogtreecommitdiff
path: root/docs/users_guide/packages.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/users_guide/packages.rst')
-rw-r--r--docs/users_guide/packages.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/users_guide/packages.rst b/docs/users_guide/packages.rst
index fae18241ea..75774c8055 100644
--- a/docs/users_guide/packages.rst
+++ b/docs/users_guide/packages.rst
@@ -1061,6 +1061,14 @@ extra indirection).
its output in place of ⟨GHCVersion⟩. See also :ref:`options-codegen`
on how object files must be prepared for shared object linking.
+- When building a shared library, care must be taken to ensure that the
+ resulting object is named appropriately. In particular, GHC expects the
+ name of a shared object to have the form ``libHS<unit id>-ghc<ghc
+ version>.<ext>`` where *unit id* is the unit ID given during compilation via
+ the :ghc-flag:`-this-unit-id ⟨unit-id⟩` flag, *ghc version* is the version of
+ GHC that produced/consumes the object and *ext* is the host system's usual
+ file extension for shared objects.
+
To compile a module which is to be part of a new package, use the
``-package-name`` (to identify the name of the package) and
``-library-name`` (to identify the version and the version hashes of its