Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: fixes for AIX support
- X-seq: zsh-workers 54019
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: fixes for AIX support
- Date: Sat, 01 Nov 2025 01:08:54 +0100
- Archived-at: <https://zsh.org/workers/54019>
- List-id: <zsh-workers.zsh.org>
I was able to get access to an AIX system thanks to the project at
portal.cfarm.net and the following patch fixes the zsh build for that.
There's a resource limit we didn't handle for maximum number of threads
per-process. Other systems have a similar limit but with different
naming for the C macro.
The make command prints: Target ".NOTPARALLEL" is up to date.
This is because we put .NOTPARALLEL: before the all: target. This
actually affects make on some other systems such as OpenBSD but as that
exits silently, the cause wasn't obvious. Moving defs.mk below the
all: target fixes this and shouldn't break anything.
Switching from a gcc to IBM compiler build, resulted in a failure
because it went from ncurses to curses and the generated curses_keys.h
file was then invalid. make clean needs to remove this file.
Like Solaris, the native diff command lacks a -a option. Even with this,
the tests don't run cleanly.
Finally, there's a further mod_export correction following the recent
nameref patches.
What I haven't done is look at the signal list which isn't right.
They've got additional signals after the realtime signals.
Oliver
diff --git a/Makefile.in b/Makefile.in
index d8568294b..67a62ede4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -36,8 +36,6 @@ sdir = @srcdir@
sdir_top = @top_srcdir@
INSTALL = @INSTALL@
-@DEFS_MK@
-
# ========== DEPENDENCIES FOR BUILDING ==========
# default target
@@ -46,6 +44,8 @@ all: config.h config.modules
(cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
done
+@DEFS_MK@
+
# prepare module configuration
prep:
@cd Src && $(MAKE) $(MAKEDEFS) $@
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c
index 65226dc9a..e76c2118d 100644
--- a/Src/Builtins/rlimits.c
+++ b/Src/Builtins/rlimits.c
@@ -157,9 +157,13 @@ static const resinfo_T known_resources[] = {
# if defined(HAVE_RLIMIT_NTHR) && !defined(HAVE_RLIMIT_RTPRIO) /* Net/OpenBSD */
{RLIMIT_NTHR, "maxpthreads", ZLIMTYPE_NUMBER, 1,
'r', "threads"},
+# endif
+# if defined(HAVE_RLIMIT_THREADS) && !defined(HAVE_RLIMIT_RTPRIO) && !defined(HAVE_RLIMIT_NTHR) /* AIX */
+ {RLIMIT_THREADS, "threads", ZLIMTYPE_NUMBER, 1,
+ 'r', "threads (per process)"},
# endif
/* others */
-# if defined(HAVE_RLIMIT_PTHREAD) && !defined(HAVE_RLIMIT_NTHR) /* IRIX ? */
+# if defined(HAVE_RLIMIT_PTHREAD) && !defined(HAVE_RLIMIT_NTHR) && !defined(HAVE_RLIMIT_THREADS) /* IRIX ? */
{RLIMIT_PTHREAD, "maxpthreads", ZLIMTYPE_NUMBER, 1,
'T', "threads per process"},
# endif
diff --git a/Src/Modules/curses.mdd b/Src/Modules/curses.mdd
index 80c8f867b..75da29a6d 100644
--- a/Src/Modules/curses.mdd
+++ b/Src/Modules/curses.mdd
@@ -11,4 +11,8 @@ curses.o curses..o: curses_keys.h
curses_keys.h: curses_keys.awk @CURSES_KEYS_H@
$(AWK) -f $(sdir)/curses_keys.awk @CURSES_KEYS_H@ /dev/null >curses_keys.h
+
+clean-here: clean.curses
+clean.curses:
+ rm -f curses_keys.h
Make
diff --git a/Src/params.c b/Src/params.c
index 654c30794..5a0434e40 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -4005,7 +4005,7 @@ strsetfn(Param pm, char *x)
static char *nullarray = NULL;
/**/
-char **
+mod_export char **
arrgetfn(Param pm)
{
return pm->u.arr ? pm->u.arr : &nullarray;
@@ -6455,7 +6455,7 @@ upscope(Param pm, int reflevel)
}
/**/
-mod_export Param
+static Param
upscope_upper(Param pm, int reflevel)
{
while (pm && pm->level > reflevel)
diff --git a/Test/ztst.zsh b/Test/ztst.zsh
index 1d05baddf..aeb02cd54 100755
--- a/Test/ztst.zsh
+++ b/Test/ztst.zsh
@@ -343,7 +343,7 @@ ZTST_diff() {
;;
esac
shift
- [[ $OSTYPE != solaris* ]] && diff_arg=( -a )
+ [[ $OSTYPE != (aix|solaris)* ]] && diff_arg=( -a )
if (( diff_pat )); then
local -a diff_lines1 diff_lines2
diff --git a/configure.ac b/configure.ac
index 1f035bc0d..3913ce9fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1863,6 +1863,7 @@ zsh_LIMIT_PRESENT(RLIMIT_NPROC)
zsh_LIMIT_PRESENT(RLIMIT_NTHR)
zsh_LIMIT_PRESENT(RLIMIT_NOFILE)
zsh_LIMIT_PRESENT(RLIMIT_PTHREAD)
+zsh_LIMIT_PRESENT(RLIMIT_THREADS)
zsh_LIMIT_PRESENT(RLIMIT_RSS)
zsh_LIMIT_PRESENT(RLIMIT_SBSIZE)
zsh_LIMIT_PRESENT(RLIMIT_TCACHE)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author