Skip to content

Commit 539c662

Browse files
committed
- Changes donated by Elemental Security to make it work on HP-UX 11 on
Itanium2 with HP's 64-bit compiler (SF patch #1225212).
1 parent 3fbf320 commit 539c662

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed

Include/pyport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ extern "C" {
297297
* This isn't reliable. See Py_OVERFLOWED comments.
298298
* X is evaluated more than once.
299299
*/
300-
#if defined(__FreeBSD__) || defined(__OpenBSD__)
300+
#if defined(__FreeBSD__) || defined(__OpenBSD__) || (defined(__hpux) && defined(__ia64))
301301
#define _Py_SET_EDOM_FOR_NAN(X) if (isnan(X)) errno = EDOM;
302302
#else
303303
#define _Py_SET_EDOM_FOR_NAN(X) ;

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ What's New in Python 2.5 alpha 1?
1212
Core and builtins
1313
-----------------
1414

15+
- Changes donated by Elemental Security to make it work on HP-UX 11 on
16+
Itanium2 with HP's 64-bit compiler (SF patch #1225212).
17+
1518
- Disallow keyword arguments for type constructors that don't use them
1619
(fixes bug #1119418).
1720

Python/thread.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@
4545
#define SUN_LWP
4646
#endif
4747

48+
/* Check if we're running on HP-UX and _SC_THREADS is defined. If so, then
49+
enough of the Posix threads package is implimented to support python
50+
threads.
51+
52+
This is valid for HP-UX 11.23 running on an ia64 system. If needed, add
53+
a check of __ia64 to verify that we're running on a ia64 system instead
54+
of a pa-risc system.
55+
*/
56+
#ifdef __hpux
57+
#ifdef _SC_THREADS
58+
#define _POSIX_THREADS
59+
#endif
60+
#endif
61+
4862
#endif /* _POSIX_THREADS */
4963

5064

README

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,25 @@ HP-UX ia64: When building on the ia64 (Itanium) platform using HP's
368368
compiler, some experience has shown that the compiler's
369369
optimiser produces a completely broken version of python
370370
(see http://www.python.org/sf/814976). To work around this,
371-
edit the Makefile and remove -O from the OPT line.
371+
edit the Makefile and remove -O from the OPT line. (This is
372+
old information; with the latest compiler this problem does
373+
not occur.)
374+
375+
To build a 64-bit executable on an Itanium 2 system using HP's
376+
compiler, use these environment variables:
377+
378+
CC=cc
379+
CXX=aCC
380+
BASECFLAGS="+DD64"
381+
LDFLAGS="+DD64 -lxnet"
382+
383+
and call configure as:
384+
385+
./configure --without-gcc
386+
387+
then *unset* the environment variables again before running
388+
make. (At least one of these flags causes the build to fail
389+
if it remains set.)
372390

373391
HP PA-RISC 2.0: A recent bug report (http://www.python.org/sf/546117)
374392
suggests that the C compiler in this 64-bit system has bugs

0 commit comments

Comments
 (0)