You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[PATCH] python socket module fails to build on Solaris when -zignore is in LDFLAGS #68083
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=Noneclosed_at=Nonecreated_at=<Date2015-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=<Date2015-11-17.15:20:14.403>user='https://bugs.python.org/andyjs'
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.
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.
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
andyjs commented on May 28, 2015
andyjsmannequin
MannequinAuthor
More actions
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.
AlexanderPyhalov commented on May 28, 2015
AlexanderPyhalovmannequin
Mannequin
More actions
We have similar patch here in OpenIndiana. The patch is correct.
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
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.
Activity
andyjs commentedon Apr 9, 2015
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.
andyjs commentedon May 12, 2015
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.
bitdancer commentedon May 12, 2015
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.
[-]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[/+]andyjs commentedon May 28, 2015
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.
AlexanderPyhalov commentedon May 28, 2015
We have similar patch here in OpenIndiana. The patch is correct.
AlexanderPyhalov commentedon May 28, 2015
BTW, we use the following version for Python 3.4
andyjs commentedon Jun 15, 2015
Bump.
andyjs commentedon Nov 17, 2015
Bump.
[-]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[/+]kulikjak commentedon Dec 6, 2023
ATM, we are still using variants of this patch:
https://github.com/oracle/solaris-userland/blob/master/components/python/python311/patches/01-setup.patch
(and older variants):
https://github.com/oracle/solaris-userland/blob/master/components/python/python39/patches/01-setup.patch
https://github.com/oracle/solaris-userland/blob/master/components/python/python37/patches/01-setup.patch
and OpenIndiana does as well:
https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/python/python37/patches/01-setup.patch
That said, in current main, the code is very different so there will need to be some rebasing to make it work.
kulikjak commentedon Apr 29, 2025
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
-lresolvpart was resolved recently with #91963.And I am able to build current main without any additional patch and with
LDFLAGS=-zignorewithout issues.