[Patches] [ python-Patches-636318 ] Build fixes for FreeBSD 5.0 (-current)

noreply@sourceforge.net noreply@sourceforge.net
Mon, 11 Nov 2002 10:33:42 -0800


Patches item #636318, was opened at 2002-11-10 20:56
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=636318&group_id=5470

Category: Build
Group: Python 2.3
Status: Open
Resolution: None
Priority: 4
Submitted By: Marc Recht (marc)
Assigned to: Martin v. Löwis (loewis)
Summary: Build fixes for FreeBSD 5.0 (-current)

Initial Comment:
The fixes the building problems on FreeBSD 5.0 (-current).

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

>Comment By: Marc Recht (marc)
Date: 2002-11-11 19:33

Message:
Logged In: YES 
user_id=205

I had a quick look at FreeBSD 4.x's includes (couldn't
resist..). If _THREAD_SAFE is set then feof(p), ferror(p),
clearerr(p), fileno(p) are not available there. And then a
thread-safe version of _FLOCKFILE(x).

fseeko, ftello, vsnprintf, ctermid_r, seteuid, setegid,
setgroups, u_char,
u_short, u_int, u_long, ushort, uint, .. (I've attached a
build log.)
The u_* typedefs are only defined if __BSD_VISIBLE is defined.

Raising _XOPEN_SOURCE to 600 isn't a real option, because
chroot and 
friends are only visible in the __BSD_VISIBLE or
_XOPEN_SOURCE <= 500 case.


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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-11 18:47

Message:
Logged In: YES 
user_id=21627

The usage in rpc/clnt.h is irrelevant. It only wraps
rpccreateerr (or some such), which is not used in Python.
Since this patch is for FreeBSD -current, configuration of
FreeBSD 4.x should not concern us at the moment; on the SF
compile farm, Python compiles fine on FreeBSD 4.7, so I
can't see a problem there, either.

Can you name a few function which Python seems to rely on,
along with the specific compiler error message that you get?

For ftello, I would suggest to raise _XOPEN_SOURCE to 600,
on all systems. Systems that only offer XPG/5 should not be
affected.

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

Comment By: Marc Recht (marc)
Date: 2002-11-11 18:24

Message:
Logged In: YES 
user_id=205

rpc/clnt.h is used by the nismodule so it should be set.
(And IIRC it's used more often in FreeBSD 4.x.)

The problem is that if _POSIX_SOURCE or _POSIX_C_SOURCE is set
__BSD_VISIBLE isn't defined. Because of that certain
functions and defines which Python seems to rely on aren't
defined. Another problem is that some functions like ftello
are defined at a higher POSIX level than python expects.
The cleanest way for FreeBSD to solve this issues for
FreeBSD is to
not define  _POSIX_SOURCE or _POSIX_C_SOURCE. This means
also _XOPEN_SOURCE can't be defined, because then
_POSIX_C_SOURCE
will be defined in cdefs.h.


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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-11 15:48

Message:
Logged In: YES 
user_id=21627

Can you please explain *why* _THREAD_SAFE is needed for
threaded programs on FreeBSD? Looking at the -CURRENT
sources, I find but a single occurrence of _THREAD_SAFE (in
rpc/clnt.h), which is not relevant to Python.

As for the build problems we talked on python-dev: Can you
please re-iterate what those problems are, if you take the
current Python CVS as a starting point?

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

Comment By: Marc Recht (marc)
Date: 2002-11-11 15:39

Message:
Logged In: YES 
user_id=205

The patches contain two parts. A work-around for the FreeBSD
5.0-current
build problems, we talked/talking about at python-dev@.
The second part is the addition of _THREAD_SAFE to the
CFLAGS, if Python is build with threads. _THREAD_SAFE is
needed for threaded programs on FreeBSD.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-11 15:24

Message:
Logged In: YES 
user_id=21627

Can you please list the problems that this patch fixes? They
might be fixed in the current CVS.

In particular, what is the effect of defining _THREAD_SAFE?

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-11-10 22:53

Message:
Logged In: YES 
user_id=21627

In this form, the patch likely won't be accepted. I see it
is not urgent, since the system it applies to has not been
released, yet. So I would like to resolve #635034 first, and
would propose that the _XOPEN_SOURCE issue then integrates
with the framework established there.

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

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