From 28f97ba85c83fa5f755996110cf3bf1f6dd6ea92 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Wed, 27 Jan 2021 00:44:26 +0000 Subject: [PATCH] Allow building on AIX This makes ksh build at least on AIX 7.1 on RISC (PowerPC). There are 4 regression test failures: leaks.sh[159]: memory leak on PATH reset before PATH search (leaked approx 220 KiB after 16384 iterations) pty.sh[351]: POSIX sh 104(C): line 364: expected "^done\r?\n$", got EOF signal.sh[280]: subshell ignoring signal does not send signal to parent (expected 'SIGUSR1', got 'done') signal.sh[282]: parent does not wait for child to complete before handling signal src/cmd/INIT/iffe.sh: - Unset LIBPATH on AIX. The features/pty output{ ... }end will fail to link to libiconv otherwise, causing a build failure. See: https://www.ibm.com/support/pages/member-libiconvso2-not-found-archive src/cmd/builtin/pty.c: - CMIN is not defined on AIX, so set it to 1 if it's not defined. src/cmd/ksh93/README: - Update list of tested OSs. --- TODO | 2 +- src/cmd/INIT/iffe.sh | 3 +++ src/cmd/builtin/pty.c | 4 ++++ src/cmd/ksh93/README | 26 ++++++++++++++------------ 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/TODO b/TODO index a604db1c6..aa6c8e839 100644 --- a/TODO +++ b/TODO @@ -11,7 +11,7 @@ Fix regression test failures: ______ Fix build system: -- ksh does not currently build on AIX or QNX. +- ksh does not currently build on QNX. ______ Fix currently known bugs affecting shell scripting. These are identified by diff --git a/src/cmd/INIT/iffe.sh b/src/cmd/INIT/iffe.sh index a802f9497..bfd29ab83 100644 --- a/src/cmd/INIT/iffe.sh +++ b/src/cmd/INIT/iffe.sh @@ -26,6 +26,9 @@ # NOTE: .exe a.out suffix and [\\/] in path patterns for dos/nt (command set -o posix) 2>/dev/null && set -o posix +case `uname -s` in +AIX) unset LIBPATH ;; +esac command=iffe version=2012-07-17 # update in USAGE too # diff --git a/src/cmd/builtin/pty.c b/src/cmd/builtin/pty.c index 9bfe44a37..72e586dcf 100644 --- a/src/cmd/builtin/pty.c +++ b/src/cmd/builtin/pty.c @@ -116,6 +116,10 @@ USAGE_LICENSE #define MODE_666 (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) #define MAXNAME 64 +#ifndef CMIN +#define CMIN 1 +#endif + #if !_lib_openpty && !_lib__getpty && !defined(_pty_clone) # if !_lib_grantpt || !_lib_unlock # if !_lib_ptsname diff --git a/src/cmd/ksh93/README b/src/cmd/ksh93/README index 279387283..45be42c0c 100644 --- a/src/cmd/ksh93/README +++ b/src/cmd/ksh93/README @@ -167,22 +167,24 @@ things amiss), two asterisks signify moderate regression test failures (some functionality does not work), and three asterisks signify serious failures (crashes, and/or essential functionality does not work). -* DragonFly BSD on x86_64 - FreeBSD on x86_64 - GNU/Linux: CentOS on x86_64 - GNU/Linux: Debian on x86_64 - GNU/Linux: Gentoo on i386 - GNU/Linux: NixOS on x86_64 - GNU/Linux: Slackware on x86_64 - GNU/Linux: Ubuntu on x86_64 -*** HP-UX 11 on pa-risc +* AIX 7.1 on RISC (PowerPC) +* DragonFly BSD 5.8 on x86_64 + FreeBSD 12.2 on x86_64 + FreeBSD 12.2 on arm64 (thanks to hyenias for donating access to a Pi) + GNU/Linux: CentOS 8.2 on x86_64 + GNU/Linux: Debian 10.7 on x86_64 + GNU/Linux: Gentoo 2.7 on i386 + GNU/Linux: NixOS 19.09 on x86_64 + GNU/Linux: Slackware 14.2 on x86_64 + GNU/Linux: Ubuntu 16.04 on x86_64 +*** HP-UX B.11.11 on pa-risc * illumos: OmniOS 2020-08-19 (gcc) on x86_64 macOS 10.14.6 (Mojave) on x86_64 -*** NetBSD on x86_64 -** OpenBSD on x86_64 +*** NetBSD 8.1 and 9.0 on x86_64 +* OpenBSD 6.8 on x86_64 * Solaris 11.4 (gcc) on x86_64 Solaris 11.4 (Solaris Studio 12.5 cc) on x86_64 -*** UnixWare 7.1.4 on x86 +* UnixWare 7.1.4 on x86 *** Windows 7 using Cygwin on x86 Good luck!!