[Python-bugs-list] [ python-Bugs-733781 ] fcntl fails to build on old RH Linux

SourceForge.net noreply@sourceforge.net
Fri, 09 May 2003 03:46:13 -0700


Bugs item #733781, was opened at 2003-05-07 11:24
Message generated for change (Comment added) made by mwh
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=733781&group_id=5470

Category: Build
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Yitzchak Gale (llxyitz)
Assigned to: Michael Hudson (mwh)
Summary: fcntl fails to build on old RH Linux

Initial Comment:
Python 2.3b1 built from source on an old RH Linux:
kernel 2.2.12-20, libc 2.1.2.

building 'fcntl' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I.
-I/<snip>/Python-2.3b1/./Include -I/usr/local/include
-I/<snip>/Python-2.3b1/Include -I/<snip>/Python-2.3b1
-c /<snip>/Python-2.3b1/Modules/fcntlmodule.c -o
build/temp.linux-i586-2.3/fcntlmodule.o
/<snip>/Python-2.3b1/Modules/fcntlmodule.c: In function
`all_ins':
/<snip>/Python-2.3b1/Modules/fcntlmodule.c:555:
`I_GWROPT' undeclared (first use in this function)
/<snip>/Python-2.3b1/Modules/fcntlmodule.c:555: (Each
undeclared identifier is reported only once
/<snip>/Python-2.3b1/Modules/fcntlmodule.c:555: for
each function it appears in.)
/<snip>/Python-2.3b1/Modules/fcntlmodule.c:564:
`I_GETCLTIME' undeclared (first use in this function)


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

>Comment By: Michael Hudson (mwh)
Date: 2003-05-09 11:46

Message:
Logged In: YES 
user_id=6656

Done:

Modules/fcntlmodule.c revision 2.40

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

Comment By: Yitz Gale (yitzg)
Date: 2003-05-09 09:52

Message:
Logged In: YES 
user_id=576391

Sounds good. Thanks much to you, Mike and Martin!

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

Comment By: Martin v. Löwis (loewis)
Date: 2003-05-09 08:52

Message:
Logged In: YES 
user_id=21627

The patch is fine. If you want to look up the standardese
that does or does not guarantee that these are defines, feel
free to do so, but Michael doesn't need to waste its time
with that. These things always have been defines on Unix,
and tons of code relies on that, precisely so that you can
test with an #ifdef for their presence. Some vendor may
chose to break that tradition, but I would then investigate
whether Python should support this vendor's systems.

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

Comment By: Yitzchak Gale (llxyitz)
Date: 2003-05-08 14:19

Message:
Logged In: YES 
user_id=773482

Yep, works for me. It sure is simpler.

Only thing is - do you know 100% that for every
stropts.h out there, and for every one that will arise
in the future, these are #defines and not actual
symbols? If so, then use it (and someone should
QA that on all platforms). If not - those symbols
will silently vanish on some platform someday and
go figure out why.

Even if so, in light of PEP 11 I would at least add
a comment at the appropriate point in configure.in.
The comment should mention Red Hat 6.1 and
glibc-2.1.2. That way, when this platform gets
de-supported someday, people will be able to
clean up our mess.

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

Comment By: Michael Hudson (mwh)
Date: 2003-05-08 12:38

Message:
Logged In: YES 
user_id=6656

I think the attached patch is all that is required.  Can you
try it?

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

Comment By: Yitzchak Gale (llxyitz)
Date: 2003-05-08 09:30

Message:
Logged In: YES 
user_id=773482

I checked a clean copy of glib-2.1.2 from gnu.org -
it indeed is missing those two symbols.

Here is how to fix this bug:

1. To configure.in add the line:

AC_CHECK_DECLS([I_GWROPT, I_GETCLTIME],,,[#include
<stropts.h>]) 

2. In fcntlmodule.c, surround each of the two lines that use
these symbols with an #if, like so:

#if defined(HAVE_DECL_I_GWROPT) && HAVE_DECL_I_GWROPT
    ...
#endif
    ...
#if defined(HAVE_DECL_I_GETCLTIME) && HAVE_DECL_I_GETCLTIME
    ...
#endif

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

Comment By: Yitzchak Gale (llxyitz)
Date: 2003-05-08 08:03

Message:
Logged In: YES 
user_id=773482

I did a little historical research on this machine.
It seems to have been a vanilla Red Hat 6.1
install. So I think we're going to want to support
this.

I worked around the problem by manually
commenting out those two symbols in
fcntmodule.c. I think configure needs to detect
this problem and do that automatically.

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

Comment By: Yitzchak Gale (llxyitz)
Date: 2003-05-07 19:14

Message:
Logged In: YES 
user_id=773482

fcntlmodule.c states:

 /* Unix 98 guarantees that these are in stropts.h. */

Those two symbols are missing in mine.

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

Comment By: Yitzchak Gale (llxyitz)
Date: 2003-05-07 19:07

Message:
Logged In: YES 
user_id=773482

fcntlmodule.c states:

 /* Unix 98 guarantees that these are in stropts.h. */

Those two symbols are missing in mine.

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

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