Bugs item #1086642, was opened at 2004-12-16 19:21
Message generated for change (Comment added) made by akosprime
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1086642&group_id=5470

Category: Extension Modules
Group: Python 2.4
Status: Open
Resolution: None
Priority: 6
Submitted By: A. Stocker (akosprime)
Assigned to: Nobody/Anonymous (nobody)
Summary: Compile of _socket fails on 2.4

Initial Comment:
I'm attempting to install Python 2.4 on an SGI Origin
2400 running Irix 6.5.22.  I'm using gcc (3.3) to
compile, and I've tried using three different make
programs (make, smake, and gmake[3.80]) but get the
same error during compilation during the building of
_socket.  There was not a problem building 2.2.1 on
this machine before, we never built 2.3 so I do not
know if the same problem existed.  Here is the relevant
entry from the make:

building '_socket' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -shared
-fno-strict-aliasing -I.
-I/usr/local/src/Python-2.4/./Include -I/us
r/local/include -I/usr/local/src/Python-2.4/Include
-I/usr/local/src/Python-2.4 -c
/usr/local/src/Python-2.4/Modules/socke
tmodule.c -o build/temp.irix64-6.5-2.4/socketmodule.o
In file included from
/usr/local/src/Python-2.4/Modules/socketmodule.c:280:
/usr/local/src/Python-2.4/Modules/addrinfo.h:145:1:
warning: "_SS_ALIGNSIZE" redefined
In file included from
/usr/local/src/Python-2.4/Modules/socketmodule.h:8,
                 from
/usr/local/src/Python-2.4/Modules/socketmodule.c:223:
/usr/include/sys/socket.h:246:1: warning: this is the
location of the previous definition
/usr/local/src/Python-2.4/Modules/socketmodule.c: In
function `makeipaddr':
/usr/local/src/Python-2.4/Modules/socketmodule.c:853:
warning: implicit declaration of function `getnameinfo'
/usr/local/src/Python-2.4/Modules/socketmodule.c:854:
error: `NI_NUMERICHOST' undeclared (first use in this
function)
/usr/local/src/Python-2.4/Modules/socketmodule.c:854:
error: (Each undeclared identifier is reported only once
/usr/local/src/Python-2.4/Modules/socketmodule.c:854:
error: for each function it appears in.)
/usr/local/src/Python-2.4/Modules/socketmodule.c: In
function `socket_gethostbyname_ex':
/usr/local/src/Python-2.4/Modules/socketmodule.c:2785:
warning: implicit declaration of function `gethostbyname_r'
/usr/local/src/Python-2.4/Modules/socketmodule.c:2785:
warning: assignment makes pointer from integer without
a cast
/usr/local/src/Python-2.4/Modules/socketmodule.c: In
function `socket_gethostbyaddr':
/usr/local/src/Python-2.4/Modules/socketmodule.c:2880:
warning: implicit declaration of function `gethostbyaddr_r'
/usr/local/src/Python-2.4/Modules/socketmodule.c:2881:
warning: assignment makes pointer from integer without
a cast
building '_ssl' extension


----------------------------------------------------------------------

>Comment By: A. Stocker (akosprime)
Date: 2005-01-11 15:48

Message:
Logged In: YES 
user_id=1179755

Okay, I tried compiling using the Irix Mips compilers.  To
do this I did a ./configure --without-gcc.  However when
attempting to make it errored out.  Here is the last section
of the make output:

        ar cr libpython2.4.a Modules/config.o 
Modules/getpath.o  Modules/main.o  Modules/gcmodule.o 
        ar cr libpython2.4.a Modules/threadmodule.o 
Modules/signalmodule.o  Modules/posixmodule.o 
Modules/errnomodule.o  Modules/_sre.o 
Modules/_codecsmodule.o  Modules/zipimport.o 
Modules/symtablemodule.o  Modules/xxsubtype.o
        : libpython2.4.a
         c++   -o python                         Modules/python.o               
          libpython2.4.a -lsocket -lnsl -ldl 
-lpthread -lmpc   -lm  
ld32: WARNING 84 : /usr/lib32/libsocket.so is not used for
resolving any symbol.
ld32: WARNING 84 : /usr/lib32/libnsl.so is not used for
resolving any symbol.
ld32: WARNING 84 : /usr/lib32/libdl.so is not used for
resolving any symbol.
ld32: FATAL   9  : I/O error (-lmpc): No such file or directory
collect2: ld returned 32 exit status
*** Error code 1 (bu21)

The patch is relatively the same as the hack I tried
earlier, and noted in a follow-up.  But as pointed out
test_socketserver doesn't work ("Use of the `network'
resource not enabled") and _locale doesn't work ("***
WARNING: renaming "_locale" since importing it failed:
1774654:./python: rld: Fatal Error: unresolvable symbol in
build/lib.irix64-6.5-2.4/_locale.so: libintl_dcgettext")

I'm not sure what else to try in order to get this working.

----------------------------------------------------------------------

Comment By: Ralf W. Grosse-Kunstleve (rwgk)
Date: 2004-12-30 16:44

Message:
Logged In: YES 
user_id=71407

Some additional observations:

socketmodule.c compiles with gcc 3.3 under IRIX 6.5.21 after 
applying this simple-minded patch (relative to Python 2.4):

--- socketmodule.c.orig 2004-11-07 06:24:25.000000000 -
0800
+++ socketmodule.c      2004-12-30 08:06:01.896160200 -
0800
@@ -280,6 +280,10 @@
 #  include "addrinfo.h"
 #endif
 
+#if defined(__sgi) && defined(__GNUC__) && !defined
(NI_NUMERICHOST)
+#  define NI_NUMERICHOST 0x00000002
+#endif
+
 #ifndef HAVE_INET_PTON
 int inet_pton(int af, const char *src, void *dst);
 const char *inet_ntop(int af, const void *src, char *dst, 
socklen_t size);


This test works OK:

./python Lib/test/test_socket.py

But this one doesn't:

./python Lib/test/test_socketserver.py


----------------------------------------------------------------------

Comment By: Ralf W. Grosse-Kunstleve (rwgk)
Date: 2004-12-30 16:38

Message:
Logged In: YES 
user_id=71407

FWIW: socketmodule.c included in Python 2.3.4 also fails to 
compile with gcc. Platform: IRIX 6.5.21, gcc 3.3 from SGI's 
freeware distribution.


----------------------------------------------------------------------

Comment By: Ralf W. Grosse-Kunstleve (rwgk)
Date: 2004-12-30 15:28

Message:
Logged In: YES 
user_id=71407

Martin v. Loewis asked me to take a look (because of my 
involvement in http://python.org/sf/728330).

I never use gcc under IRIX. Python 2.4 works just fine with 
the native IRIX compilers.

Suggestion to A. Stocker: try to modify the ifdef's in 
socketmodule.c to do the right thing for gcc 3.3. I can test 
your patch on our machines to make sure compilation with the 
native compilers is still OK.


----------------------------------------------------------------------

Comment By: A. Stocker (akosprime)
Date: 2004-12-22 14:19

Message:
Logged In: YES 
user_id=1179755

All,

I decided to force the issue a bit.  Looking through
socketmodule.c I noticed that there was an SGI specific
check that basically disabled loading the addrinfo.h file,
which is where NI_NUMERICHOST is defined.  So I put the
#define statement from the addrinfo.h file directly in the
socketmodule.c file and the compilation with _socket worked.
 However this seems to be a clunky way to deal with the
situation.  Plus I don't know if there's anything else like
this biting me in the butt (for instance '_locale' doesn't
compile either.)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1086642&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to