Skip to content

Fails to export PyInit_MODULE when compiling with hidden visibility #169

Closed

Description

@xnox

It seems like BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY is gone in boost1.65.1 but is still referenced in module_init.hpp. This results in failure to export PyInit_mymodule when compiling with hidden visibility and g++.

I have worked around this by add -DBOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY=1 in my sources. But previous boost did the right thing here.

Maybe the condition path elif BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY can be dropped, adn the default fall through should be adjusted to become:

-extern "C" _BOOST_PYTHON_MODULE_INIT(name)
+extern "C" BOOST_SYMBOL_EXPORT _BOOST_PYTHON_MODULE_INIT(name)

As BOOST_SYMBOL_EXPORT defines the right thing for the right compiler, for g++ it adds __attribute__((__visibility__("default"))) no? or maybe use BOOST_SYMBOL_VISIBLE ?

I will provide a short sample and build logs.

Activity

  1. stefanseefeld commented on Oct 30, 2017

    @stefanseefeld
    Member

    Didn't #159 address this ? Can you please confirm whether the bug is still present on the current "develop" branch ?

  2. xnox commented on Oct 30, 2017

    @xnox
    Author

    It looks like it should. Let me verify that, and I guess I will have to cherrypick that patch into Debian and Ubuntu builds of boost1.65.1.

  3. xnox commented on Nov 3, 2017

    @xnox
    Author

    Yeap, that patch is awesome, staged to be uploaded into Debian & Ubuntu. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions