Lua uses NSLINKMODULE_OPTION_PRIVATE flag on OS X for its "require", but this causes globals in a module required in two separate Lua states NOT to have common globals. I faced this today, and the only solution found was removing that flag from loadlib.c.
Has anyone else been affected by this, and would it be reason enough to question the use of the PRIVATE flag?
I did read the 8 hits given by the flag name. None of them touch this particular issue. Normally, globals and 'static' in C are common to the process. With the PRIVATE flag, it seems globals are kept separate if the same library is loaded twice.
I tried also gcc -undefined suppress -flat_namespace -bundle but that did not help.
What to do?