[Python-bugs-list] [ python-Bugs-486099 ] socketmodule won't compile on BSDI 4.0

noreply@sourceforge.net noreply@sourceforge.net
Thu, 29 Nov 2001 18:18:53 -0800


Bugs item #486099, was opened at 2001-11-27 10:19
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=486099&group_id=5470

Category: Python Library
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Jason R. Mastaler (jasonrm)
Assigned to: Martin v. Löwis (loewis)
Summary: socketmodule won't compile on BSDI 4.0

Initial Comment:
Trying to build 2.2b2 on  BSDI BSD/OS 4.0 with gcc
2.7.2.1 and gcc 2.95.2, and the socket module won't
build.  No problems building socket for Python 2.1.1
on this same machine.

% ./configure  --with-threads=no

# for socket(2), without SSL support.
_socket socketmodule.c

% gmake
gcc -D_HAVE_BSDI -g -O3 -Wall -Wstrict-prototypes -I.
-I./Include -DHAVE_CONFIG_H   -c
./Modules/socketmodule.c -o Modules/socketmodule.o
In file included from ./Modules/socketmodule.c:187:
/usr/local/packages/gcc-2.95.2/lib/gcc-lib/i386-pc-bsdi4.0/2.95.2/include/stddef.h:280:
conflicting types for `wint_t'
/usr/include/wchar.h:7: previous declaration of
`wint_t'
In file included from ./Modules/socketmodule.c:236:
Modules/getaddrinfo.c: In function `gai_strerror':
Modules/getaddrinfo.c:205: `EAI_MAX' undeclared (first
use in this function)
Modules/getaddrinfo.c:205: (Each undeclared identifier
is reported only once
Modules/getaddrinfo.c:205: for each function it appears
in.)
Modules/getaddrinfo.c: In function `getaddrinfo':
Modules/getaddrinfo.c:285: `EAI_BADHINTS' undeclared
(first use in this function)
Modules/getaddrinfo.c:286: `AI_MASK' undeclared (first
use in this function)
Modules/getaddrinfo.c:376: `EAI_PROTOCOL' undeclared
(first use in this function)
Modules/getaddrinfo.c:464: `AI_NUMERICHOST' undeclared
(first use in this function)
./Modules/socketmodule.c: In function
`PySocketSock_init':
./Modules/socketmodule.c:1818: warning: function
declaration isn't a prototype
./Modules/socketmodule.c: In function
`PySocket_fromfd':
./Modules/socketmodule.c:2304: warning: function
declaration isn't a prototype
gmake: *** [Modules/socketmodule.o] Error 1


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

>Comment By: Jason R. Mastaler (jasonrm)
Date: 2001-11-29 18:18

Message:
Logged In: YES 
user_id=85984

aicheck.c compiled without problem on my system.

% gcc -o aicheck aicheck.c 
%

Running the resulting binary produces no output.  I'm
not exactly sure what kind of output you are looking for
(taking a guess):

% gdb /home/jason/temp/aicheck
GDB is free software and you are welcome to distribute
copies of it
 under certain conditions; type "show copying" to see the
conditions.
There is absolutely no warranty for GDB; type "show
warranty" for details.
GDB 4.16 (i386-unknown-bsdi4.0), Copyright 1996 Free
Software Foundation, Inc...(no debugging symbols found)...
(gdb) run
Starting program: /home/jason/temp/aicheck 
(no debugging symbols found)...(no debugging symbols
found)...(no debugging symbols found)...
Program exited with code 01.


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

Comment By: Martin v. Löwis (loewis)
Date: 2001-11-29 15:51

Message:
Logged In: YES 
user_id=21627

Thansk for the files. I now trying to figure out why Python
refuses to use the getaddrinfo implementation in your C
library. It may be that it is really broken, in which case
we must make getaddrinfo.c work correctly. Perhaps it ought
to work,and configure just fails to correctly see that.

So please compile the attached file aicheck.c on your
system, and report output and status code (looking at $?);
if it fails to compile, report the compile errors.

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

Comment By: Jason R. Mastaler (jasonrm)
Date: 2001-11-28 12:21

Message:
Logged In: YES 
user_id=85984

Attached are three files:

- pyconfig.h from a fresh gcc 2.7.2.1 build
- config.log from a fresh gcc 2.7.2.1 build
- /usr/include/netdb.h
- the getaddrinfo manual page from my system

Indeed, EAI_ADDRFAMILY is defined in /usr/include/netdb.h,
but EAI_MAX is not.  Let me know if I can provide any more 
information.  Thanks.


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

Comment By: Martin v. Löwis (loewis)
Date: 2001-11-28 01:30

Message:
Logged In: YES 
user_id=21627

Ok, then we need to investigate the configure results. Can
you please attach pyconfig.h and config.log to this report?
Also, can you please confirm that you build Python from
scratch with 2.7.2.1 (i.e untarring a fresh source tree, to
avoid using a config.cache left over from gcc 2.95.2)?

Furthermore, can you please report details of the
getaddrinfo implementation on your system? Does it provide
one? In the C library? If not, can you confirm that
EAI_ADDRFAMILY is defined in your system headers, but
EAI_MAX is not? If yes, can you speculate as to why
configure thinks your system does not have getaddrinfo?

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

Comment By: Jason R. Mastaler (jasonrm)
Date: 2001-11-27 15:21

Message:
Logged In: YES 
user_id=85984

I probably should have included the output from gcc 2.7.2.1
instead which I know is properly installed.  The results are
similar, although there is no mention of `wint_t':

% gmake
gcc -D_HAVE_BSDI -g -O3 -Wall -Wstrict-prototypes -I.
-I./Include -DHAVE_CONFIG_H   -c ./Modules/socketmodule.c -o
Modules/socketmodule.o
In file included from Include/pyport.h:93,
                 from Include/Python.h:60,
                 from ./Modules/socketmodule.c:78:
/usr/include/math.h:177: warning: function declaration isn't
a prototype
/usr/include/math.h:257: warning: function declaration isn't
a prototype
In file included from Include/unicodeobject.h:118,
                 from Include/Python.h:69,
                 from ./Modules/socketmodule.c:78:
/usr/include/wchar.h:15: warning: function declaration isn't
a prototype
In file included from /usr/include/signal.h:46,
                 from ./Modules/socketmodule.c:140:
/usr/include/sys/signal.h:121: warning: function declaration
isn't a prototype
/usr/include/sys/signal.h:164: warning: function declaration
isn't a prototype
Modules/getaddrinfo.c: In function `gai_strerror':
In file included from ./Modules/socketmodule.c:236:
Modules/getaddrinfo.c:205: `EAI_MAX' undeclared (first use
this function)
Modules/getaddrinfo.c:205: (Each undeclared identifier is
reported only once
Modules/getaddrinfo.c:205: for each function it appears in.)
Modules/getaddrinfo.c: In function `getaddrinfo':
Modules/getaddrinfo.c:285: `EAI_BADHINTS' undeclared (first
use this function)
Modules/getaddrinfo.c:286: `AI_MASK' undeclared (first use
this function)
Modules/getaddrinfo.c:376: `EAI_PROTOCOL' undeclared (first
use this function)
Modules/getaddrinfo.c:464: `AI_NUMERICHOST' undeclared
(first use this function)
./Modules/socketmodule.c: In function `PySocketSock_init':
./Modules/socketmodule.c:1818: warning: function declaration
isn't a prototype
./Modules/socketmodule.c: In function `PySocket_fromfd':
./Modules/socketmodule.c:2304: warning: function declaration
isn't a prototype
gmake: *** [Modules/socketmodule.o] Error 1


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

Comment By: Martin v. Löwis (loewis)
Date: 2001-11-27 15:08

Message:
Logged In: YES 
user_id=21627

Are you sure the compiler is properly installed? That you
have wint_t definition both in wchar.h and stddef.h (as
fixincluded by gcc) is not Python's doing; either the header
files of your operating system are corrupt, or the compiler
is broken.

If you cannot figure out the details, please attach both
header files to this report.

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

Comment By: Tim Peters (tim_one)
Date: 2001-11-27 12:07

Message:
Logged In: YES 
user_id=31435

Assigned to Martin.

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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=486099&group_id=5470