summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Kurtz <seankurtz75@gmail.com>2026-11-25 20:42:55 -0600
committerSean Kurtz <seankurtz75@gmail.com>2026-11-25 20:42:55 -0600
commit642fbc02fb2a8e74d1e6663118d55110a9e5dfd7 (patch)
treea192c6ba7ed3bee02eebfff84e4292f6d344cc6c
parent8f2578664a1420759f2a0e29e27d128a7d3e2567 (diff)
downloadztop-642fbc02fb2a8e74d1e6663118d55110a9e5dfd7.tar.gz
ztop: fix the assembler entry name and z/OS test compiler
HLASM upcases the CSECT name, so the C declaration needs the ZVSLIST asm label (the binder otherwise reports it unresolved). /bin/cc on z/OS is the old XL C compiler and rejects -std=c17; tests build with ibm-clang, and the README says to override TESTCC=cc on a Linux host. Also note the Makefile's own chtag step: after a git checkout it can be tagged UTF-8, and make spins reading it until it is ISO8859-1.
-rw-r--r--Makefile2
-rw-r--r--README.md5
-rw-r--r--src/ztop.c4
3 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index c1490a8..3aff2ca 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ CFLAGS = -std=c23 -O2 -m32 -Wall -Wextra -Wshadow -Wpedantic \
-D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200112L
# The parser and the TUI framework have no z/OS dependency; the test and
# demo targets build them on the host so a Linux tree can check them.
-TESTCC = cc
+TESTCC = ibm-clang
TESTFLAGS = -std=c17 -g -O1 -Wall -Wextra -Wshadow -Wpedantic \
-D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200112L
# AC(1) is half of what makes an executable APF-authorized, the other
diff --git a/README.md b/README.md
index d90cccc..4ff5a13 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,7 @@ the terminal layer and `src/ztop.c` is the command.
z/OS only for the real binary, with IBM Open XL and HLASM in the path:
```sh
+chtag -t -c ISO8859-1 Makefile # after a checkout: make reads it as text
make # ibm-clang -std=c23 -m32, plus `as` for src/zvslist.s
make apf # then give the executable the APF bit
```
@@ -28,8 +29,8 @@ The parser and the TUI framework have no z/OS dependency, so on any host
with a C compiler and a terminal:
```sh
-make test # synthetic VSMLIST data areas, no z/OS needed
-make demo # a small exercise of the TUI framework
+make test TESTCC=cc # synthetic VSMLIST data areas, no z/OS needed
+make demo TESTCC=cc # a small exercise of the TUI framework
```
## Use
diff --git a/src/ztop.c b/src/ztop.c
index 8aa84e4..11b553f 100644
--- a/src/ztop.c
+++ b/src/ztop.c
@@ -18,8 +18,10 @@
#define WORK_SIZE (1024u * 1024u)
#if defined(__MVS__)
+/* HLASM upcases the ESD name of the CSECT, so the assembler side is
+ * exported as ZVSLIST whatever case the source is written in. */
+extern int zvslist(void *) __asm__("ZVSLIST");
#pragma linkage(zvslist, OS)
-extern int zvslist(void *);
/* The 31-bit request block. R13 is saved by the stub, so the save area has
* to live in storage the C compiler gives us, not in the read-only CSECT. */