erlang / otp

Erlang/OTP
http://erlang.org
Apache License 2.0
11.29k stars 2.94k forks source link

ERL-571: relax undefined symbol checks for nifs on dlopen #3569

Open OTP-Maintainer opened 6 years ago

OTP-Maintainer commented 6 years ago

Original reporter: vans163 Affected version: Not Specified Component: erts Migrated from: https://bugs.erlang.org/browse/ERL-571


https://stackoverflow.com/questions/27868890/undefined-symbols-on-erlang-nif-shared-library

Some libraries we use ship with undefined symbols by nature. And they are so huge it will cost significant resources to fix all the undefined symbols.

Is it possible to add an option to determine how dlopen gets called RTLD_NOW | RTLD_GLOBAL vs RTLD_LAZY?

OTP-Maintainer commented 6 years ago

sverker said:

This is not a high priority for us right now, but it seems like a reasonable feature so a PR is welcome.

I think such option should be passed as a third argument to erlang:load_nif. What would the option be called, maybe {symbols, now | lazy}? What would happen if not supported (Windows)?