Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1475

Allow erlang:load_nif in archives

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: erts
    • Labels:
      None

      Description

      We want to be able to load nif code from archives.

      The fallback approach to this would be to create a temp file that we dlopen and then unlink directly afterward.

      For most platforms, we should be able to load the memory directly by using some platform specific features/hacks:

      Linux: memfd_create + dlopen of /proc/self/fd/%d
      Windows: https://github.com/py2exe/py2exe/blob/master/source/MyLoadLibrary.c
      OS X: https://stackoverflow.com/questions/11821955/load-dynamic-library-from-memory
      FreeBSD/DragonFly: https://www.freebsd.org/cgi/man.cgi?query=fdlopen&sektion=3,
      Android: https://github.com/google/iree/issues/3845

      There is also a bit of discussion here: https://github.com/erlang/otp/pull/3002

        Attachments

          Activity

            People

            Assignee:
            otp_team_vm Team VM
            Reporter:
            lukas Lukas Larsson
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: