erlangpack / bcrypt

Erlang wrapper for OpenBSD's Blowfish password hashing code
https://hex.pm/packages/bcrypt
Other
16 stars 19 forks source link

Fix OSX compilation #17

Closed codeadict closed 3 years ago

codeadict commented 3 years ago

When compiling in OSX always use -flat_namespace -undefined suppress. If the user has some LDFLAGS which is almost always the case in OSX for other things like OpenSSL headers, it would suppress the above compiler options and always fail with:

Undefined symbols for architecture x86_64:
  "_enif_alloc", referenced from:
      _on_load in bcrypt_nif.o
      _bcrypt_hashpw in bcrypt_nif.o
      _bcrypt_rt_dtor in bcrypt_nif.o
      _async_queue_create in async_queue.o
      _async_queue_push in async_queue.o

Tested the fix on Mojave and Catalina but should be the same effect for older OSX versions.

mworrell commented 3 years ago

Thanks!