[Python-bugs-list] [ python-Bugs-486099 ] socketmodule won't compile on BSDI 4.0
noreply@sourceforge.net
noreply@sourceforge.net
Sun, 02 Dec 2001 04:37:19 -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: 8
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-12-01 10:50
Message:
Logged In: YES
user_id=85984
Martin,
I appreciate your help with this, as the socket module is
a crucial one on this particular server, and I'd like to be
able to upgrade to 2.2 when it is released.
If you are finding it difficult to work on this problem by
taking guesses, I could make you a temporary account
on the server if you think it would help.
If so, attach/send me your SSH public key or some other
method of getting the account information to you securely
(GPG/PGP public key, etc.)
----------------------------------------------------------------------
Comment By: Jason R. Mastaler (jasonrm)
Date: 2001-12-01 10:46
Message:
Logged In: YES
user_id=85984
Still no luck after applying the patch unfortunately.
sclp3:~/temp/Python-2.2b2/Modules> patch < ../../gai.diff
patching file `addrinfo.h'
patching file `getaddrinfo.c'
sclp3:~/temp/Python-2.2b2> gmake
/bin/sh ./Modules/makesetup -c ./Modules/config.c.in \
-s Modules \
Modules/Setup.config \
Modules/Setup.local \
Modules/Setup
The Makefile was updated, you may need to re-run make.
gcc -D_HAVE_BSDI -c -g -O3 -Wall -Wstrict-prototypes -I.
-I./Include -DHAVE_CONFIG_H -o Modules/config.o
Modules/config.c
In file included from Include/pyport.h:93,
from Include/Python.h:60,
from Modules/config.c:19:
/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/config.c:19:
/usr/include/wchar.h:15: warning: function declaration isn't
a prototype
gcc -D_HAVE_BSDI -c -g -O3 -Wall -Wstrict-prototypes -I.
-I./Include -DHAVE_CONFIG_H
-DPYTHONPATH='":plat-bsdos4:lib-tk"' \
-DPREFIX='"/usr/local"' \
-DEXEC_PREFIX='"/usr/local"' \
-DVERSION='"2.2"' \
-DVPATH='""' \
-o Modules/getpath.o ./Modules/getpath.c
In file included from Include/pyport.h:93,
from Include/Python.h:60,
from ./Modules/getpath.c:3:
/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/getpath.c:3:
/usr/include/wchar.h:15: warning: function declaration isn't
a prototype
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
In file included from ./Modules/socketmodule.c:236:
Modules/getaddrinfo.c:203: conflicting types for
`gai_strerror'
/usr/include/netdb.h:172: previous declaration of
`gai_strerror'
./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-12-01 01:28
Message:
Logged In: YES
user_id=21627
Thanks, I'm now giving up on getting the C library
getaddrinfo to work on your system (I have no idea why it
would fail in this place).
Instead, I made the patch gai.diff, which should allow
compilation of getaddrinfo.c on your system. Please report
whether it works.
----------------------------------------------------------------------
Comment By: Jason R. Mastaler (jasonrm)
Date: 2001-11-30 08:24
Message:
Logged In: YES
user_id=85984
% gcc -o aicheck2 aicheck2.c
% ./aicheck2
fail 11
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2001-11-30 01:35
Message:
Logged In: YES
user_id=21627
Arrghh. I was trying to find out which of the tests fail,
but attached the wrong version of the file: I meant to put
printfs into each failure. Please try aicheck2.c instead.
Anyway, it seems that your system is indeed one of those
where the test should find out problems with the C library
(unless the test that fails is bogus, which we can
investigate once we know what it is that fails). I'll try to
come up with a patch that allows usage of the getaddrinfo
emulation even on systems where getaddrinfo is in the C library.
----------------------------------------------------------------------
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