summaryrefslogtreecommitdiff
path: root/HOWTO
diff options
context:
space:
mode:
authorSverker Eriksson <sverker@erlang.org>2021-11-30 18:10:56 +0100
committerSverker Eriksson <sverker@erlang.org>2022-01-13 21:25:50 +0100
commit27775b501f272f69af2e40809a2c83a0bc25a722 (patch)
tree099a734f3cb3ebeea14b006c5fd0e69ee744e61a /HOWTO
parent4b94d7001205336b42641c651c37f2a1ec10dbf1 (diff)
downloaderlang-27775b501f272f69af2e40809a2c83a0bc25a722.tar.gz
erts: Add support for static Elixir NIF modules
or any modules with "exotic" characters in the name (like '.'). * Add STATIC_ERLANG_NIF_LIBNAME macro which is used both to identify the archive name and create a unique C identifier for the _nif_init function. * Run all static *_nif_init functions unconditionally at VM boot to get the corresponding module names. erlang:load_nif/2 can then match only against module names and does not have to care about archive filenames for static nifs.
Diffstat (limited to 'HOWTO')
-rw-r--r--HOWTO/INSTALL.md9
1 files changed, 4 insertions, 5 deletions
diff --git a/HOWTO/INSTALL.md b/HOWTO/INSTALL.md
index dd06828e91..2b983497f0 100644
--- a/HOWTO/INSTALL.md
+++ b/HOWTO/INSTALL.md
@@ -396,11 +396,10 @@ Some of the available `configure` options are:
that do not support dynamic linking of libraries it is possible to statically
link nifs and drivers with the main Erlang VM binary. This is done by passing
a comma separated list to the archives that you want to statically link. e.g.
- `--enable-static-nifs=/home/$USER/my_nif.a`. The path has to be absolute and the
- name of the archive has to be the same as the module, i.e. `my_nif` in the
- example above. This is also true for drivers, but then it is the driver name
- that has to be the same as the filename. You also have to define
- `STATIC_ERLANG_{NIF,DRIVER}` when compiling the .o files for the nif/driver.
+ `--enable-static-nifs=/home/$USER/my_nif.a`. The paths have to be absolute.
+ For drivers, the driver name has to be the same as the filename. You also
+ have to define `STATIC_ERLANG_NIF_LIBNAME` (see `erl_nif` documentation) or
+ `STATIC_ERLANG_DRIVER` when compiling the .o files for the nif/driver.
If your nif/driver depends on some other dynamic library, you now have to link
that to the Erlang VM binary. This is easily achieved by passing `LIBS=-llibname`
to configure.