Use -fvisibility=hidden for some C bits
Use `-fvisibility=hidden` to prevent potential surprises on MacOS. This is the
same fix applied to `jiffy` in [1].
The reason this is a MacOS-only issue is that `dlopen()` on MacOS defaults to
`RTLD_GLOBAL`, and on Linux it defaults to `RTLD_LOCAL`. Since Erlang/OTP NIF
`dlopen()` doesn't explicitly set this flag, the defaults take effect.
`RTLD_GLOBAL` flag makes the symbols from the newly `dlopen()`-ed module
available for the global symbol resolution. So, if some library in MacOS starts
using xxhash, our exxhash NIF symbols may start to collide with their version.
This PR should hopefully prevent such surprises.
[1] https://github.com/davisp/jiffy/pull/245.
4 files changed