From ffda21b7ba451b8fd874e9c8c2162c55053caa1e Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 18 Jan 2022 09:01:03 -0500 Subject: [PATCH] [Feature #18491] Drop support for HP-UX IA64 support was dropped in ticket #15894, so we can drop support for HP-UX. --- configure.ac | 23 -------------- dln.c | 31 ------------------- ext/-test-/file/fs.c | 2 +- ext/digest/sha2/sha2.c | 2 +- ext/pty/pty.c | 9 +----- ext/socket/socket.c | 5 ++- .../ruby/internal/intern/select/largesize.h | 3 -- process.c | 1 - ruby.c | 4 --- template/Makefile.in | 1 - thread.c | 2 -- vsnprintf.c | 13 -------- 12 files changed, 5 insertions(+), 91 deletions(-) diff --git a/configure.ac b/configure.ac index b870896b5d..7b8552e4f0 100644 --- a/configure.ac +++ b/configure.ac @@ -579,7 +579,6 @@ RUBY_WERROR_FLAG([ rpathflag='' AS_IF([test x"${RPATHFLAG}" = x], [ AS_CASE(["$target_os"], - [hpux*], [AS_IF([test "$rb_cv_prog_gnu_ld" = no], [rpathflag='+b '])], [aix*], [rpathflag='-blibpath:'], [for rpathflag in -R "-rpath "; do AS_CASE("$rpathflag", @@ -1068,8 +1067,6 @@ main() ]) cleanlibs='$(TARGET_SO).dSYM' ], -[hpux*], [ LIBS="-lm $LIBS" - ac_cv_c_inline=no], [solaris*], [ LIBS="-lm $LIBS" ac_cv_func_vfork=no AC_MSG_CHECKING(whether _XOPEN_SOURCE is already given) @@ -1241,7 +1238,6 @@ AS_IF([test -n "${rb_there_is_in_fact_no_gplusplus_but_autoconf_is_cheating_us}" AC_CHECK_LIB(crypt, crypt) # glibc (GNU/Linux, GNU/Hurd, GNU/kFreeBSD) AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV -AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX AC_CHECK_LIB(socket, shutdown) # SunOS/Solaris if pkg-config --exists capstone; then @@ -1939,7 +1935,6 @@ AC_DEFINE(HAVE_ISFINITE) # C99; backward compatibility # for missing/setproctitle.c AS_CASE(["$target_os"], [aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)], -[hpux*], [AC_DEFINE(SPT_TYPE,SPT_PSTAT) ], []) AC_CHECK_HEADERS(sys/pstat.h) @@ -2918,7 +2913,6 @@ STATIC= RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)]) ], [ AS_CASE(["$target_os"], - [hpux*], [CCDLFLAGS="$CCDLFLAGS +Z"], [solaris*|irix*], [CCDLFLAGS="$CCDLFLAGS -KPIC"], [sunos*], [CCDLFLAGS="$CCDLFLAGS -PIC"], [esix*|uxpds*], [CCDLFLAGS="$CCDLFLAGS -KPIC"], @@ -2933,11 +2927,6 @@ STATIC= [enable_rpath=$enableval], [enable_rpath="$rb_cv_binary_elf"]) AS_CASE(["$target_os"], - [hpux*], [ DLDFLAGS="$DLDFLAGS -E" - : ${LDSHARED='$(LD) -b'} - XLDFLAGS="$XLDFLAGS -Wl,-E" - : ${LIBPATHENV=SHLIB_PATH} - rb_cv_dlopen=yes], [solaris*], [ AS_IF([test "$GCC" = yes], [ : ${LDSHARED='$(CC) -shared'} AS_IF([test "$rb_cv_prog_gnu_ld" = yes], [ @@ -3185,8 +3174,6 @@ AS_IF([test x$with_valgrind != xno], : "dlext & soext" && { AS_CASE(["$target_os"], - [hpux*], [ - DLEXT=sl], [darwin*], [ SOEXT=dylib DLEXT=bundle], @@ -3494,10 +3481,6 @@ AS_CASE("$enable_shared", [yes], [ LIBRUBY_RPATHFLAGS='-R${libdir}' ]) ], - [hpux*], [ - XLDFLAGS="$XLDFLAGS "'-Wl,+s,+b,$(libdir)' - LIBRUBY_ALIASES='$(LIBRUBY_SONAME) lib$(RUBY_SO_NAME).$(SOEXT)' - ], [aix*], [ RUBY_APPEND_OPTIONS(LIBRUBY_DLDFLAGS, ["${linker_flag}-bnoentry" "$XLDFLAGS" "$LDFLAGS_OPTDIR"]) LIBRUBYARG_SHARED='-L${libdir} -l${RUBY_SO_NAME}' @@ -3803,12 +3786,6 @@ AS_CASE(["$target_os"], LIBRUBY='lib$(RUBY_SO_NAME).a' LIBRUBYARG='-l$(RUBY_SO_NAME)' ]) - ], - [hpux*], [ - AS_CASE(["$YACC"],[*yacc*], [ - XCFLAGS="$XCFLAGS -DYYMAXDEPTH=300" - YACC="$YACC -Nl40000 -Nm40000" - ]) ]) MINIOBJS="$MINIDLNOBJ" diff --git a/dln.c b/dln.c index e40c3740c8..d3d5e38c3a 100644 --- a/dln.c +++ b/dln.c @@ -139,11 +139,6 @@ static const char funcname_prefix[sizeof(FUNCNAME_PREFIX) - 1] = FUNCNAME_PREFIX # include #endif -#ifdef __hpux -#include -#include "dl.h" -#endif - #if defined(_AIX) #include /* for isdigit() */ #include /* for global errno */ @@ -393,32 +388,6 @@ dln_load(const char *file) } #endif /* USE_DLN_DLOPEN */ -#ifdef __hpux -#define DLN_DEFINED - { - shl_t lib = NULL; - int flags; - void (*init_fct)(void); - - flags = BIND_DEFERRED; - lib = shl_load(file, flags, 0); - if (lib == NULL) { - extern int errno; - dln_loaderror("%s - %s", strerror(errno), file); - } - shl_findsym(&lib, buf, TYPE_PROCEDURE, (void*)&init_fct); - if (init_fct == NULL) { - shl_findsym(&lib, buf, TYPE_UNDEFINED, (void*)&init_fct); - if (init_fct == NULL) { - errno = ENOSYM; - dln_loaderror("%s - %s", strerror(ENOSYM), file); - } - } - (*init_fct)(); - return (void*)lib; - } -#endif /* hpux */ - #if defined(_AIX) #define DLN_DEFINED { diff --git a/ext/-test-/file/fs.c b/ext/-test-/file/fs.c index 63d2356d76..1a6c3d06dc 100644 --- a/ext/-test-/file/fs.c +++ b/ext/-test-/file/fs.c @@ -28,7 +28,7 @@ typedef struct statvfs statfs_t; # if defined HAVE_STRUCT_STATVFS_F_TYPE # define HAVE_STRUCT_STATFS_T_F_TYPE 1 # endif -#elif defined(HAVE_STRUCT_STATVFS_F_BASETYPE) /* AIX, HP-UX, Solaris */ +#elif defined(HAVE_STRUCT_STATVFS_F_BASETYPE) /* AIX, Solaris */ typedef struct statvfs statfs_t; # define STATFS(f, s) statvfs((f), (s)) # define HAVE_STRUCT_STATFS_T_F_FSTYPENAME 1 diff --git a/ext/digest/sha2/sha2.c b/ext/digest/sha2/sha2.c index e7d7b15c5b..21d5acbe96 100644 --- a/ext/digest/sha2/sha2.c +++ b/ext/digest/sha2/sha2.c @@ -128,7 +128,7 @@ typedef u_int64_t sha2_word64; /* Exactly 8 bytes */ #define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16) -#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || defined(__GNUC__) || defined(_HPUX_SOURCE) || defined(__IBMC__) +#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || defined(__GNUC__) || defined(__IBMC__) #define ULL(number) number##ULL #else #define ULL(number) (uint64_t)(number) diff --git a/ext/pty/pty.c b/ext/pty/pty.c index 72074f7421..cb663ab2de 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -389,14 +389,7 @@ get_device_once(int *master, int *slave, char SlaveName[DEVICELEN], int nomesg, c"0",c"1",c"2",c"3",c"4",c"5",c"6",c"7", \ c"8",c"9",c"a",c"b",c"c",c"d",c"e",c"f" -#if defined(__hpux) - static const char MasterDevice[] = "/dev/ptym/pty%s"; - static const char SlaveDevice[] = "/dev/pty/tty%s"; - static const char deviceNo[][3] = { - HEX1("p"), HEX1("q"), HEX1("r"), HEX1("s"), - HEX1("t"), HEX1("u"), HEX1("v"), HEX1("w"), - }; -#elif defined(_IBMESA) /* AIX/ESA */ +#if defined(_IBMESA) /* AIX/ESA */ static const char MasterDevice[] = "/dev/ptyp%s"; static const char SlaveDevice[] = "/dev/ttyp%s"; static const char deviceNo[][3] = { diff --git a/ext/socket/socket.c b/ext/socket/socket.c index ccf990d11f..4ba1c6cd61 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -1529,7 +1529,7 @@ rsock_sockaddr_obj(struct sockaddr *addr, socklen_t len) #endif -#if defined(HAVE_GETIFADDRS) || (defined(SIOCGLIFCONF) && defined(SIOCGLIFNUM) && !defined(__hpux)) || defined(SIOCGIFCONF) || defined(_WIN32) +#if defined(HAVE_GETIFADDRS) || (defined(SIOCGLIFCONF) && defined(SIOCGLIFNUM)) || defined(SIOCGIFCONF) || defined(_WIN32) /* * call-seq: * Socket.ip_address_list => array @@ -1590,9 +1590,8 @@ socket_s_ip_address_list(VALUE self) freeifaddrs(ifp); return list; -#elif defined(SIOCGLIFCONF) && defined(SIOCGLIFNUM) && !defined(__hpux) +#elif defined(SIOCGLIFCONF) && defined(SIOCGLIFNUM) /* Solaris if_tcp(7P) */ - /* HP-UX has SIOCGLIFCONF too. But it uses different struct */ int fd = -1; int ret; struct lifnum ln; diff --git a/include/ruby/internal/intern/select/largesize.h b/include/ruby/internal/intern/select/largesize.h index d156f62034..d65f088c06 100644 --- a/include/ruby/internal/intern/select/largesize.h +++ b/include/ruby/internal/intern/select/largesize.h @@ -35,9 +35,6 @@ * `select(2)` documents how to allocate fd_set dynamically. * http://www.openbsd.org/cgi-bin/man.cgi?query=select&manpath=OpenBSD+4.4 * - * - HP-UX documents how to allocate fd_set dynamically. - * http://docs.hp.com/en/B2355-60105/select.2.html - * * - Solaris 8 has `select_large_fdset` * * - Mac OS X 10.7 (Lion) diff --git a/process.c b/process.c index 11031d2c7d..672c2df9a9 100644 --- a/process.c +++ b/process.c @@ -6806,7 +6806,6 @@ proc_setgid(VALUE obj, VALUE id) * Darwin (Mac OS X) 16 * Sun Solaris 7,8,9,10 16 * Sun Solaris 11 / OpenSolaris 1024 - * HP-UX 20 * Windows 1015 */ static int _maxgroups = -1; diff --git a/ruby.c b/ruby.c index 747934e6d1..b300526017 100644 --- a/ruby.c +++ b/ruby.c @@ -22,10 +22,6 @@ # include #endif -#ifdef __hpux -# include -#endif - #if defined(LOAD_RELATIVE) && defined(HAVE_DLADDR) # include #endif diff --git a/template/Makefile.in b/template/Makefile.in index 9e6d6fe0e3..892add75cb 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -392,7 +392,6 @@ all-incs: probes.h # * with gperf v.s. without gperf # * committers may have various versions of gperf # * ./configure v.s. ../ruby/configure -# * GNU make v.s. HP-UX make # HP-UX make invokes the action if lex.c and keywords has same mtime. # * svn checkout generate a file with mtime as current time # * ext4 and XFS has a mtime with fractional part lex.c: defs/keywords diff --git a/thread.c b/thread.c index cf6e89327e..7b4ed2a7ab 100644 --- a/thread.c +++ b/thread.c @@ -3945,8 +3945,6 @@ rb_thread_priority_set(VALUE thread, VALUE prio) * - OpenBSD 2.0 (src/sys/kern/sys_generic.c:1.4) * select(2) documents how to allocate fd_set dynamically. * http://www.openbsd.org/cgi-bin/man.cgi?query=select&manpath=OpenBSD+4.4 - * - HP-UX documents how to allocate fd_set dynamically. - * http://docs.hp.com/en/B2355-60105/select.2.html * - Solaris 8 has select_large_fdset * - Mac OS X 10.7 (Lion) * select(2) returns EINVAL if nfds is greater than FD_SET_SIZE and diff --git a/vsnprintf.c b/vsnprintf.c index 8bfa0c1656..cfb8365caa 100644 --- a/vsnprintf.c +++ b/vsnprintf.c @@ -101,23 +101,12 @@ # endif #endif -#if defined(__hpux) && !defined(__GNUC__) && !defined(__STDC__) -#define const -#endif - #if defined(sgi) #undef __const #define __const #endif /* People who don't like const sys_error */ #include -#if defined(__hpux) && !defined(__GNUC__) || defined(__DECC) -#include -#endif - -#if !defined(__CYGWIN32__) && defined(__hpux) && !defined(__GNUC__) -#include -#endif #ifndef NULL #define NULL 0 @@ -251,9 +240,7 @@ BSD__sfvwrite(register FILE *fp, register struct __suio *uio) if ((len = uio->uio_resid) == 0) return (0); -#ifndef __hpux #define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif #define COPY(n) (void)memcpy((void *)fp->_p, (void *)p, (size_t)(n)) iov = uio->uio_iov;