Skip to content

Commit 8adb7db

Browse files
committed
Remove support for HP-UX
HP-UX is discontinued system since 2026-01-01: https://userapps.support.sap.com/sap/support/knowledge/en/3629028 Recent compilers also don't work there anymore. Changes: - Non-standard '-threads' flag check removed. - ZEND_HRTIME_PLATFORM_HPUX preprocessor macro renamed to ZEND_HRTIME_PLATFORM_SUNOS as it is now related to only Solaris/illumos systems. - Check for HP-UX style reentrant time functions adjusted. This wasn't reproducible on any known system so far. - LOG_NEWS and LOG_UUCP conditions removed as all Unix-like systems should have them (Windows build have definitions provided in win32/syslog.h). - Check for <sys/pstat.h> header removed as it is relevant only on HP-UX. - The '.sl' file extension for shared PHP extensions is with this also removed, making extension either .so (Unix-like systems), or .dll (Windows).
1 parent 7158e63 commit 8adb7db

File tree

16 files changed

+20
-142
lines changed

16 files changed

+20
-142
lines changed

TSRM/threads.m4

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ AC_DEFUN([PTHREADS_FLAGS],[
4040
PTHREAD_FLAGS=-D_REENTRANT;;
4141
*aix*)
4242
PTHREAD_FLAGS=-D_THREAD_SAFE;;
43-
*hpux*)
44-
PTHREAD_FLAGS=-D_REENTRANT;;
4543
*sco*)
4644
PTHREAD_FLAGS=-D_REENTRANT;;
4745
esac
@@ -91,13 +89,12 @@ dnl -mthreads gcc (AIX)
9189
dnl -pthread gcc (Linux, FreeBSD, NetBSD, OpenBSD)
9290
dnl -pthreads gcc (Solaris)
9391
dnl -qthreaded AIX cc V5
94-
dnl -threads gcc (HP-UX)
9592
dnl
9693
AC_DEFUN([PTHREADS_CHECK],[
9794
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
9895
ac_cv_pthreads_cflags=
9996
if test "$pthreads_working" != "yes"; then
100-
for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
97+
for flag in -kthread -pthread -pthreads -mthreads -Kthread -mt -qthreaded; do
10198
ac_save=$CFLAGS
10299
CFLAGS="$CFLAGS $flag"
103100
PTHREADS_CHECK_COMPILE

UPGRADING.INTERNALS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES
9191
- Unix build system changes:
9292
. Symbol HAVE_ST_BLOCKS has been removed from php_config.h (use
9393
HAVE_STRUCT_STAT_ST_BLOCKS).
94+
. Support for HP-UX has been removed.
9495

9596
========================
9697
3. Module changes

Zend/zend_hrtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ZEND_API mach_timebase_info_data_t zend_hrtime_timerlib_info = {
4444
.denom = 1,
4545
};
4646

47-
#elif ZEND_HRTIME_PLATFORM_HPUX
47+
#elif ZEND_HRTIME_PLATFORM_SUNOS
4848

4949
# include <sys/time.h>
5050

Zend/zend_hrtime.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#define ZEND_HRTIME_PLATFORM_WINDOWS 0
3636
#define ZEND_HRTIME_PLATFORM_APPLE_MACH_ABSOLUTE 0
3737
#define ZEND_HRTIME_PLATFORM_APPLE_GETTIME_NSEC 0
38-
#define ZEND_HRTIME_PLATFORM_HPUX 0
38+
#define ZEND_HRTIME_PLATFORM_SUNOS 0
3939
#define ZEND_HRTIME_PLATFORM_AIX 0
4040

4141
#if defined(_POSIX_TIMERS) && ((_POSIX_TIMERS > 0) || defined(__OpenBSD__)) && defined(_POSIX_MONOTONIC_CLOCK) && defined(CLOCK_MONOTONIC)
@@ -50,15 +50,15 @@
5050
#elif defined(__APPLE__)
5151
# undef ZEND_HRTIME_PLATFORM_APPLE_MACH_ABSOLUTE
5252
# define ZEND_HRTIME_PLATFORM_APPLE_MACH_ABSOLUTE 1
53-
#elif (defined(__hpux) || defined(hpux)) || ((defined(__sun__) || defined(__sun) || defined(sun)) && (defined(__SVR4) || defined(__svr4__)))
54-
# undef ZEND_HRTIME_PLATFORM_HPUX
55-
# define ZEND_HRTIME_PLATFORM_HPUX 1
53+
#elif (defined(__sun__) || defined(__sun) || defined(sun)) && (defined(__SVR4) || defined(__svr4__))
54+
# undef ZEND_HRTIME_PLATFORM_SUNOS
55+
# define ZEND_HRTIME_PLATFORM_SUNOS 1
5656
#elif defined(_AIX)
5757
# undef ZEND_HRTIME_PLATFORM_AIX
5858
# define ZEND_HRTIME_PLATFORM_AIX 1
5959
#endif
6060

61-
#define ZEND_HRTIME_AVAILABLE (ZEND_HRTIME_PLATFORM_POSIX || ZEND_HRTIME_PLATFORM_WINDOWS || ZEND_HRTIME_PLATFORM_APPLE_MACH_ABSOLUTE || ZEND_HRTIME_PLATFORM_APPLE_GETTIME_NSEC || ZEND_HRTIME_PLATFORM_HPUX || ZEND_HRTIME_PLATFORM_AIX)
61+
#define ZEND_HRTIME_AVAILABLE (ZEND_HRTIME_PLATFORM_POSIX || ZEND_HRTIME_PLATFORM_WINDOWS || ZEND_HRTIME_PLATFORM_APPLE_MACH_ABSOLUTE || ZEND_HRTIME_PLATFORM_APPLE_GETTIME_NSEC || ZEND_HRTIME_PLATFORM_SUNOS || ZEND_HRTIME_PLATFORM_AIX)
6262

6363
BEGIN_EXTERN_C()
6464

@@ -98,7 +98,7 @@ static zend_always_inline zend_hrtime_t zend_hrtime(void)
9898
struct timespec ts = { .tv_sec = 0, .tv_nsec = 0 };
9999
clock_gettime(zend_hrtime_posix_clock_id, &ts);
100100
return ((zend_hrtime_t) ts.tv_sec * (zend_hrtime_t)ZEND_NANO_IN_SEC) + ts.tv_nsec;
101-
#elif ZEND_HRTIME_PLATFORM_HPUX
101+
#elif ZEND_HRTIME_PLATFORM_SUNOS
102102
return (zend_hrtime_t) gethrtime();
103103
#elif ZEND_HRTIME_PLATFORM_AIX
104104
timebasestruct_t t;

Zend/zend_portability.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ char *alloca();
229229
# endif
230230
#endif
231231

232-
#if !ZEND_DEBUG && (defined(HAVE_ALLOCA) || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(HPUX)) && !defined(__APPLE__)
232+
#if !ZEND_DEBUG && (defined(HAVE_ALLOCA) || (defined (__GNUC__) && __GNUC__ >= 2)) && !defined(__APPLE__)
233233
# define ZEND_ALLOCA_MAX_SIZE (32 * 1024)
234234
# define ALLOCA_FLAG(name) \
235235
bool name;
@@ -357,7 +357,7 @@ char *alloca();
357357
# endif
358358
#endif
359359

360-
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(__APPLE__) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn)
360+
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(__APPLE__) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn)
361361
# define HAVE_NORETURN
362362
# define ZEND_NORETURN __attribute__((noreturn))
363363
#elif defined(ZEND_WIN32)
@@ -373,7 +373,7 @@ char *alloca();
373373
# define ZEND_STACK_ALIGNED
374374
#endif
375375

376-
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(__APPLE__) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__))
376+
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(__APPLE__) && !defined(_AIX) && !defined(__osf__))
377377
# define HAVE_NORETURN_ALIAS
378378
# define HAVE_ATTRIBUTE_WEAK
379379
#endif

build/php.m4

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,30 +1079,13 @@ AC_DEFUN([PHP_CHECK_SIZEOF], [
10791079
dnl
10801080
dnl PHP_TIME_R_TYPE
10811081
dnl
1082-
dnl Check type of reentrant time-related functions. Type can be: irix, hpux or
1083-
dnl POSIX.
1082+
dnl Check type of reentrant time-related functions. Type can be: irix or POSIX.
10841083
dnl
10851084
AC_DEFUN([PHP_TIME_R_TYPE],
10861085
[AC_CACHE_CHECK([for type of reentrant time-related functions],
10871086
[php_cv_time_r_type],
10881087
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
10891088
#include <time.h>
1090-
1091-
int main(void) {
1092-
char buf[27];
1093-
struct tm t;
1094-
time_t old = 0;
1095-
int r, s;
1096-
1097-
s = gmtime_r(&old, &t);
1098-
r = (int) asctime_r(&t, buf, 26);
1099-
if (r == s && s == 0) return (0);
1100-
return (1);
1101-
}
1102-
]])],
1103-
[php_cv_time_r_type=hpux],
1104-
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
1105-
#include <time.h>
11061089
int main(void) {
11071090
struct tm t, *s;
11081091
time_t old = 0;
@@ -1116,12 +1099,9 @@ int main(void) {
11161099
]])],
11171100
[php_cv_time_r_type=irix],
11181101
[php_cv_time_r_type=POSIX],
1119-
[php_cv_time_r_type=POSIX])],
11201102
[php_cv_time_r_type=POSIX])
11211103
])
11221104
AS_CASE([$php_cv_time_r_type],
1123-
[hpux], [AC_DEFINE([PHP_HPUX_TIME_R], [1],
1124-
[Define to 1 if you have HP-UX 10.x.-style reentrant time functions.])],
11251105
[irix], [AC_DEFINE([PHP_IRIX_TIME_R], [1],
11261106
[Define to 1 you have IRIX-style reentrant time functions.])])
11271107
])
@@ -1507,19 +1487,14 @@ dnl ----------------------------------------------------------------------------
15071487
dnl
15081488
dnl PHP_SHLIB_SUFFIX_NAMES
15091489
dnl
1510-
dnl Determines link library suffix SHLIB_SUFFIX_NAME which can be: .so, .sl or
1490+
dnl Determines link library suffix SHLIB_SUFFIX_NAME which can be: .so, or
15111491
dnl .dylib
15121492
dnl
1513-
dnl Determines shared library suffix SHLIB_DL_SUFFIX_NAME suffix can be: .so or
1514-
dnl .sl
1493+
dnl Determines shared library suffix SHLIB_DL_SUFFIX_NAME suffix can be: .so.
15151494
dnl
15161495
AC_DEFUN([PHP_SHLIB_SUFFIX_NAMES], [
15171496
AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl
15181497
AS_CASE([$host_alias],
1519-
[*hpux*], [
1520-
SHLIB_SUFFIX_NAME=sl
1521-
SHLIB_DL_SUFFIX_NAME=sl
1522-
],
15231498
[*darwin*], [
15241499
SHLIB_SUFFIX_NAME=dylib
15251500
SHLIB_DL_SUFFIX_NAME=so

configure.ac

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,6 @@ case $host_alias in
226226
*solaris*)
227227
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
228228
;;
229-
*hpux*)
230-
if test "$GCC" = "yes"; then
231-
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
232-
fi
233-
;;
234229
esac
235230

236231
dnl Disable PIC mode by default where it is known to be safe to do so, to avoid

ext/fileinfo/php_libmagic.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@
4343
#define FINFO_READ_FUNC read
4444
#endif
4545

46-
#if defined(__hpux) && !defined(HAVE_STRTOULL)
47-
#if SIZEOF_LONG == 8
48-
# define strtoull strtoul
49-
#else
50-
# define strtoull __strtoull
51-
#endif
52-
#endif
53-
5446
#ifndef offsetof
5547
#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
5648
#endif

ext/standard/basic_functions.stub.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -816,23 +816,17 @@
816816
* @cvalue LOG_LPR
817817
*/
818818
const LOG_LPR = UNKNOWN;
819-
#ifdef LOG_NEWS
820-
/* No LOG_NEWS on HP-UX */
821819
/**
822820
* usenet new
823821
* @var int
824822
* @cvalue LOG_NEWS
825823
*/
826824
const LOG_NEWS = UNKNOWN;
827-
#endif
828-
#ifdef LOG_UUCP
829-
/* No LOG_UUCP on HP-UX */
830825
/**
831826
* @var int
832827
* @cvalue LOG_UUCP
833828
*/
834829
const LOG_UUCP = UNKNOWN;
835-
#endif
836830
#ifdef LOG_CRON
837831
/* apparently some systems don't have this one */
838832
/**

ext/standard/basic_functions_arginfo.h

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)