Skip to content

[PATCH] python socket module fails to build on Solaris when -zignore is in LDFLAGS #68083

Closed

Description

@andyjs
mannequin
BPO 23895
Nosy @jcea, @bitdancer
Files
  • solaris-socket-zignore.diff: Patch which pulls in libsocket and libnsl when building on Solaris
  • socket.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2015-04-09.13:43:05.613>
    labels = ['build']
    title = '[PATCH] python socket module fails to build on Solaris when -zignore is in LDFLAGS'
    updated_at = <Date 2015-11-17.15:20:14.403>
    user = 'https://bugs.python.org/andyjs'

    bugs.python.org fields:

    activity = <Date 2015-11-17.15:20:14.403>
    actor = 'andy_js'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Build']
    creation = <Date 2015-04-09.13:43:05.613>
    creator = 'andy_js'
    dependencies = []
    files = ['38877', '39539']
    hgrepos = []
    issue_num = 23895
    keywords = ['patch']
    message_count = 8.0
    messages = ['240325', '242950', '242969', '244318', '244324', '244325', '245380', '254801']
    nosy_count = 4.0
    nosy_names = ['jcea', 'r.david.murray', 'andy_js', 'Alexander.Pyhalov']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'languishing'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue23895'
    versions = ['Python 2.7']

    Activity

    1. andyjs commented on Apr 9, 2015

      andyjsmannequin
      MannequinAuthor

      The socket module fails to build when -zignore is in LDFLAGS. This option changes the linker behaviour so it will only resolve against the libraries linked in explicitly instead of doing resolution recursively against their dependencies too.

    2. added
      buildThe build process and cross-build
      on Apr 9, 2015
    3. andyjs commented on May 12, 2015

      andyjsmannequin
      MannequinAuthor

      Bump.

      Would be nice to get this included in python 2.7.11.

      I also have a similar fix for the multiprocessing module but I won't bother submitting it if it will get ignored.

    4. added
      staleStale PR or inactive for long period of time.
      on May 12, 2015
    5. removed
      staleStale PR or inactive for long period of time.
      on May 12, 2015
    6. bitdancer commented on May 12, 2015

      @bitdancer
      Member

      Do you know anyone else using solaris who could do a review (ie: confirm that your patch makes sense and works for them)? It looks like jcea, who is our only current committer who uses Solaris as far as I know (well, OpenIndiana), hasn't had time to look at this.

      On the other hand, it isn't 100% clear to me that this is appropriate. I'm not (yet) experienced enough with the internals of our build system to be the one to make the call, but it seems to me that you can support -z ignore by modifying your Modules/Setup file, so it may not be appropriate to inject solaris specific support in setup.py for an option that isn't normally used.

    7. changed the title [-]PATCH: python socket module fails to build on Solaris when -zignore is in LDFLAGS[/-] [+]python socket module fails to build on Solaris when -zignore is in LDFLAGS[/+] on May 12, 2015
    8. andyjs commented on May 28, 2015

      andyjsmannequin
      MannequinAuthor

      The -z ignore option is actually exposing issues that could cause a problem at runtime. If the socket module were imported and libsocket/libnsl hadn't already been loaded (i.e pulled in by the loader as a dependency of another module) the loader would fail due to unresolved symbols.

      This problem would not effect Linux because all of the socket stuff is in libc, which is not the case on Solaris. Today it doesn't cause a problem because most other things are already pulling in libsocket and libnsl before the socket module is loaded, but there's no guarantee that will always be the case.

      For the sake of correctness it should be fixed, and I would suggest later making -z ignore the default on Solaris.

      I will see if I can find somebody else to review the patch.

    9. AlexanderPyhalov commented on May 28, 2015

      AlexanderPyhalovmannequin
      Mannequin

      We have similar patch here in OpenIndiana. The patch is correct.

    10. AlexanderPyhalov commented on May 28, 2015

      AlexanderPyhalovmannequin
      Mannequin

      BTW, we use the following version for Python 3.4

    11. andyjs commented on Jun 15, 2015

      andyjsmannequin
      MannequinAuthor

      Bump.

    12. andyjs commented on Nov 17, 2015

      andyjsmannequin
      MannequinAuthor

      Bump.

    13. added
      staleStale PR or inactive for long period of time.
      on Nov 17, 2015
    14. changed the title [-]python socket module fails to build on Solaris when -zignore is in LDFLAGS[/-] [+][PATCH] python socket module fails to build on Solaris when -zignore is in LDFLAGS[/+] on Nov 17, 2015
    15. transferred this issue fromon Apr 10, 2022
    16. kulikjak commented on Apr 29, 2025

      @kulikjak
      Contributor

      I think this might no longer be a problem. For some time now, we no longer need to add 'nsl' and 'socket' libraries for socketmodule build (I am speaking for Oracle Solaris, though the same sems to be the case for OpenIndiana as well: 3.9 compared to 3.7), and the -lresolv part was resolved recently with #91963.

      And I am able to build current main without any additional patch and with LDFLAGS=-zignore without issues.

    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

      buildThe build process and cross-build

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions