Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild build/link system to avoid RTLD_GLOBAL #8

Open
mikeboers opened this issue Feb 20, 2013 · 1 comment
Open

Rebuild build/link system to avoid RTLD_GLOBAL #8

mikeboers opened this issue Feb 20, 2013 · 1 comment

Comments

@mikeboers
Copy link
Owner

Currently, LibTomCrypt is compiled into tomcrypt/_core.so. In order for those functions to be accessible to the other Cython modules, we force the .so to be loaded in RTLD_GLOBAL mode.

Unfortunately, this pollutes the global namespace.

Potential options are:

  • compile LibTomCrypt into its own _tomcrypt.so, which is still loaded with RTLD_GLOBAL, hoping to polute less;
  • rebuild everything using ctypes;
  • merge everything into a single tomcrypt.so which is all Cython;
  • wrap every C function in a Cython function so it can be exported via the Cython capi;
  • hack every C function into the Cython capi export table.
@mikeboers
Copy link
Owner Author

Try redefining mode as RTLD_GLOBAL after import:

import ctypes
from . import _core
ctypes.PyDLL(_core.__file__, mode=ctypes.RTLD_GLOBAL)

mikeboers pushed a commit that referenced this issue Feb 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant