Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue10201] Fix building of socket module under Solaris

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Oct 26, 2010, 9:22 AM

Post #1 of 8 (747 views)
Permalink
[issue10201] Fix building of socket module under Solaris

New submission from Antoine Pitrou <pitrou [at] free>:

Sun/Oracle uses the following patch to fix building of the socket module, since on Solaris "netpacket/packet.h" is incompatible with its Linux counterpart. Otherwise, it fails with the following messages:

/home/antoine/py3k/gcc/Modules/socketmodule.c: In function ‘makesockaddr’:
/home/antoine/py3k/gcc/Modules/socketmodule.c:1150: error: ‘struct ifreq’ has no member named ‘ifr_ifindex’
/home/antoine/py3k/gcc/Modules/socketmodule.c:1151: error: ‘SIOCGIFNAME’ undeclared (first use in this function)
/home/antoine/py3k/gcc/Modules/socketmodule.c:1151: error: (Each undeclared identifier is reported only once
/home/antoine/py3k/gcc/Modules/socketmodule.c:1151: error: for each function it appears in.)
/home/antoine/py3k/gcc/Modules/socketmodule.c: In function ‘getsockaddrarg’:
/home/antoine/py3k/gcc/Modules/socketmodule.c:1484: error: ‘SIOCGIFINDEX’ undeclared (first use in this function)
/home/antoine/py3k/gcc/Modules/socketmodule.c:1502: error: ‘struct ifreq’ has no member named ‘ifr_ifindex’
/home/antoine/py3k/gcc/Modules/socketmodule.c: In function ‘PyInit__socket’:
/home/antoine/py3k/gcc/Modules/socketmodule.c:4580: error: ‘PACKET_LOOPBACK’ undeclared (first use in this function)
/home/antoine/py3k/gcc/Modules/socketmodule.c:4581: error: ‘PACKET_FASTROUTE’ undeclared (first use in this function)



$ cat ~/spec-files/patches/Python26-17-netpacket-packet-h.diff
--- Python-2.6.2/Modules/socketmodule.c.packet 2009-04-01 07:20:48.000000000 +1300
+++ Python-2.6.2/Modules/socketmodule.c 2009-12-01 21:25:04.133257645 +1300
@@ -81,6 +81,14 @@

*/

+#ifdef HAVE_NETPACKET_PACKET_H
+#ifdef sun
+#define USE_NETPACKET_PACKET_H 0
+#else
+#define USE_NETPACKET_PACKET_H 1
+#endif
+#endif
+
#ifdef __APPLE__
/*
* inet_aton is not available on OSX 10.3, yet we want to use a binary
@@ -1092,7 +1100,7 @@
}
#endif

-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
case AF_PACKET:
{
struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
@@ -1382,7 +1390,7 @@
}
#endif

-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
case AF_PACKET:
{
struct sockaddr_ll* addr;
@@ -1559,7 +1567,7 @@
}
#endif

-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
case AF_PACKET:
{
*len_ret = sizeof (struct sockaddr_ll);
@@ -4575,7 +4583,7 @@
PyModule_AddStringConstant(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF");
#endif

-#ifdef HAVE_NETPACKET_PACKET_H
+#if USE_NETPACKET_PACKET_H
PyModule_AddIntConstant(m, "AF_PACKET", AF_PACKET);
PyModule_AddIntConstant(m, "PF_PACKET", PF_PACKET);
PyModule_AddIntConstant(m, "PACKET_HOST", PACKET_HOST);

----------
components: Build
messages: 119615
nosy: jcea, loewis, movement, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: Fix building of socket module under Solaris
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue10201>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2010, 9:46 AM

Post #2 of 8 (721 views)
Permalink
[issue10201] Fix building of socket module under Solaris [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Here is a working patch for py3k. Tested under OpenSolaris with both gcc and Sun C.

----------
keywords: +patch
nosy: +laca
Added file: http://bugs.python.org/file19371/buildsocket.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue10201>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2010, 3:48 PM

Post #3 of 8 (714 views)
Permalink
[issue10201] Fix building of socket module under Solaris [In reply to]

Jesús Cea Avión <jcea [at] jcea> added the comment:

This is not a problem under Solaris 10. I guess it is a problem with OpenSolaris/OpenIndiana/Illumos.

Can you confirm?.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue10201>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2010, 4:05 PM

Post #4 of 8 (719 views)
Permalink
[issue10201] Fix building of socket module under Solaris [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

> This is not a problem under Solaris 10. I guess it is a problem with
> OpenSolaris/OpenIndiana/Illumos.
>
> Can you confirm?.

It's with the most recent OpenSolaris development build (build 134).

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue10201>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2010, 5:39 PM

Post #5 of 8 (715 views)
Permalink
[issue10201] Fix building of socket module under Solaris [In reply to]

Jesús Cea Avión <jcea [at] jcea> added the comment:

Could this to be considered a bug in OpenSolaris?.

If not, I think this fix should be backported to 2.5/2.6/2.7/3.1.

Just for the record, I am asking for help to get a buildbot under OpenIndiana: http://openindiana.org/pipermail/openindiana-discuss/2010-October/000974.html . Hope somebody can help out. We need it.

----------
versions: +Python 2.5, Python 2.6

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue10201>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 27, 2010, 3:09 AM

Post #6 of 8 (714 views)
Permalink
[issue10201] Fix building of socket module under Solaris [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

> Jesús Cea Avión <jcea [at] jcea> added the comment:
>
> Could this to be considered a bug in OpenSolaris?.

That's a good question. Perhaps Laca (who wrote the original patch) can
chime in.

> If not, I think this fix should be backported to 2.5/2.6/2.7/3.1.

It's not a security fix, so I think 2.5 and 2.6 are not applicable.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue10201>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 27, 2010, 3:42 AM

Post #7 of 8 (715 views)
Permalink
[issue10201] Fix building of socket module under Solaris [In reply to]

John Levon <movement [at] users> added the comment:

This is not a bug in Solaris - the interfaces Python is trying to use are not standardized.

(It's a reasonable RFE for Solaris to fully support these, though - I'll follow up on that.)

WRT the patch, at least the PACKET_* defined would be better done via a specific guard (#ifdef PACKET_LOOPBACK ...).

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue10201>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 27, 2010, 4:46 AM

Post #8 of 8 (724 views)
Permalink
[issue10201] Fix building of socket module under Solaris [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Actually, there's a better patch in #8852.

----------
resolution: -> duplicate
status: open -> closed
superseder: -> _socket fails to build on OpenSolaris x64

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue10201>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.