New submission from David Kirkby <david.kir...@onetel.net>:

Using Python 2.6.5, the module _socket is failing to build on OpenSolaris. The 
problem can be worked around with a hack, but I've not verified if the hack 
actually results in working code - but at least it compiles. See below. 

The problem seems to be that HAVE_NETPACKET_PACKET_H gets defined, despite the 
fact there is no file called netpacket.h

running build
running build_ext
building '_socket' extension
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -I. -I/export/home/drkirkby/Python-2.6.5/./Include -I. 
-IInclude -I./Include -I/usr/local/include 
-I/export/home/drkirkby/Python-2.6.5/Include 
-I/export/home/drkirkby/Python-2.6.5 -c 
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c -o 
build/temp.solaris-2.11-i86pc-2.6/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.o
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c: In function 
‘makesockaddr’:
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c:1107: error: ‘struct 
ifreq’ has no member named ‘ifr_ifindex’
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c:1108: error: 
‘SIOCGIFNAME’ undeclared (first use in this function)
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c:1108: error: (Each 
undeclared identifier is reported only once
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c:1108: error: for each 
function it appears in.)
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c: In function 
‘getsockaddrarg’:
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c:1415: error: 
‘SIOCGIFINDEX’ undeclared (first use in this function)
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c:1427: error: ‘struct 
ifreq’ has no member named ‘ifr_ifindex’
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c: In function 
‘init_socket’:
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c:4596: error: 
‘PACKET_LOOPBACK’ undeclared (first use in this function)
/export/home/drkirkby/Python-2.6.5/Modules/socketmodule.c:4597: error: 
‘PACKET_FASTROUTE’ undeclared (first use in this function)
building '_curses' extension
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -I. -I/export/home/drkirkby/Python-2.6.5/./Include -I. 
-IInclude -I./Include -I/usr/local/include 
-I/export/home/drkirkby/Python-2.6.5/Include 
-I/export/home/drkirkby/Python-2.6.5 -c 
/export/home/drkirkby/Python-2.6.5/Modules/_cursesmodule.c -o 
build/temp.solaris-2.11-i86pc-2.6/export/home/drkirkby/Python-2.6.5/Modules/_cursesmodule.o
/export/home/drkirkby/Python-2.6.5/Modules/_cursesmodule.c: In function 
‘PyCursesWindow_ChgAt’:
/export/home/drkirkby/Python-2.6.5/Modules/_cursesmodule.c:708: warning: 
implicit declaration of function ‘mvwchgat’
/export/home/drkirkby/Python-2.6.5/Modules/_cursesmodule.c:712: warning: 
implicit declaration of function ‘wchgat’
gcc -shared 
build/temp.solaris-2.11-i86pc-2.6/export/home/drkirkby/Python-2.6.5/Modules/_cursesmodule.o
 -L/usr/local/lib -lcurses -ltermcap -o 
build/lib.solaris-2.11-i86pc-2.6/_curses.so
*** WARNING: renaming "_curses" since importing it failed: ld.so.1: python: 
fatal: relocation error: file build/lib.solaris-2.11-i86pc-2.6/_curses.so: 
symbol mvwchgat: referenced symbol not found
building '_curses_panel' extension
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -I. -I/export/home/drkirkby/Python-2.6.5/./Include -I. 
-IInclude -I./Include -I/usr/local/include 
-I/export/home/drkirkby/Python-2.6.5/Include 
-I/export/home/drkirkby/Python-2.6.5 -c 
/export/home/drkirkby/Python-2.6.5/Modules/_curses_panel.c -o 
build/temp.solaris-2.11-i86pc-2.6/export/home/drkirkby/Python-2.6.5/Modules/_curses_panel.o
gcc -shared 
build/temp.solaris-2.11-i86pc-2.6/export/home/drkirkby/Python-2.6.5/Modules/_curses_panel.o
 -L/usr/local/lib -lpanel -lcurses -ltermcap -o 
build/lib.solaris-2.11-i86pc-2.6/_curses_panel.so
*** WARNING: renaming "_curses_panel" since importing it failed: No module 
named _curses
building 'sunaudiodev' extension
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -I. -I/export/home/drkirkby/Python-2.6.5/./Include -I. 
-IInclude -I.

A patch (which is a hack, rather than a real solution), is below. 

drkir...@hawk:~/Python-2.6.5/Modules$ diff -U 10  socketmodule.c.orig 
socketmodule.c
--- socketmodule.c.orig Sat May 29 14:58:17 2010
+++ socketmodule.c      Sat May 29 15:26:08 2010
@@ -1089,20 +1089,21 @@
                }
 #endif
 
                default:
                        PyErr_SetString(PyExc_ValueError,
                                        "Unknown Bluetooth protocol");
                        return NULL;
                }
 #endif
 
+#undef HAVE_NETPACKET_PACKET_H /* Hack to build on OpenSolaris x64 */
 #ifdef HAVE_NETPACKET_PACKET_H
        case AF_PACKET:
        {
                struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
                char *ifname = "";
                struct ifreq ifr;
                /* need to look up interface name give index */
                if (a->sll_ifindex) {
                        ifr.ifr_ifindex = a->sll_ifindex;
                        if (ioctl(sockfd, SIOCGIFNAME, &ifr) == 0)

----------
messages: 106719
nosy: drkirkby
priority: normal
severity: normal
status: open
title: _socket fails to build on OpenSolaris x64
type: compile error
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8852>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to