Repository navigation
CC/370 v1.5.0
CC/370 (cc370) 1.5.0 is a minor release of the host-native MVS 3.8j toolchain. It adds -mrent, which makes the compiler report every writable variable a reentrant module would keep in itself, fixes file-scope compound literals, and tightens three corners of ld370. It is a drop-in for 1.4.x: the LIBC/370 (libc370) requirement is unchanged (>= 2.3.0; install.sh picks the newest that fits, 2.6.2 today), and code compiled without the new option is byte-identical to 1.4.0 apart from the version in the eyecatcher and the compound-literal fix below (measured over 824 sources at -O1 and 602 at -Os). The manuals now come with the release as PDFs.
Read this first: what a caller can see
ld370 --packrefuses what it used to drop. An input file named before--pack(a member as well as an object or archive),-lor-Lanywhere on the command, and a--packnaming no member now end with rc 2, naming the operand. Before, the operand was left out of the library without a word and the command ended rc 0. Put--packfirst:ld370 --pack A.iebcopy B.iebcopy -o lib -xmit.- The member name from
-ois the one that is checked. It is the base name up to the first period:-o app.v1.lmnow gives memberAPPinstead of being refused asAPP.V1. A name that is not a valid member name is still refused (rc 2) when a transport file or a load map needs it, never cut. -mrentis new and off by default. Pass it to every source of a module you link with--rent; each non-const definition then warns with-Wwritable-data(an error under-Werror,-Wno-writable-dataturns it off).
New: -mrent and -Wwritable-data
A reentrant load module is one copy shared by every task that runs it, and CC/370 keeps a C static or global in the module itself. Under -mrent the compiler warns for each such definition that is not const:
prog.c:3: warning: 'count' is writable data in a reentrant module [-Wwritable-data]
prog.c:5: warning: a compound literal is writable data in a reentrant module [-Wwritable-data]
const char *p is writable (the pointer is), char *const p is not; extern declarations and string literals are not reported, and __stklen is exempt. The check covers the sources compiled with the option; code taken from a library by automatic library call is not checked.
Fixed: before and now
| 1.4.0 | 1.5.0 | |
|---|---|---|
static int *p = (int[]){1, 2}; |
DC A(@V2) with no @V2; the assembler stops with rc 8 |
the literal is emitted |
ld370 X.iebcopy --pack Y.iebcopy -o lib -xmit |
rc 0, library holds Y only | rc 2, names X.iebcopy |
ld370 -o MAIN main.o -xmit --pack |
links MAIN instead of packing | rc 2 |
ld370 -o app.v1.lm … -xmit |
rc 2, "'APP.V1' is not a valid member name" | member APP |
ld370 --help on a bare member |
"packs at entry 0" | --entry NAME, else @@CRT0, from its CESD |
Install
curl -fsSL https://github.com/mvslovers/cc370/releases/latest/download/install.sh | shWith Homebrew (macOS, Linux):
brew trust mvslovers/tap # once
brew install mvslovers/tap/cc370 # cc370 and, as its dependency, libc370
brew upgrade mvslovers/tap/cc370 # an existing installOr the pieces, all listed in SHA256SUMS:
| file | what |
|---|---|
cc370-1.5.0-{darwin,linux}-{amd64,arm64}.tar.gz |
the toolchain for one host |
cc370_1.5.0_{amd64,arm64}.deb |
Debian/Ubuntu; depends on libc370-dev (>= 2.3.0) |
cc370-1.5.0.{x86_64,aarch64}.rpm |
Fedora/RHEL; requires libc370-devel the same way |
install.sh |
the installer above |
ml01-0001-0.pdf |
CC/370 User's Guide, Draft edition, for 1.5.0 |
ml01-0002-0.pdf |
CC/370 Command Reference, Draft edition, for 1.5.0 |
The manuals are built from the tagged sources. The Draft edition still lacks the figures whose output is captured on MVS, and some captured examples still show the version strings of 1.4.0.
Full changelog
Added
-mrentand-Wwritable-data: writable data in a reentrant module is
reported by the compiler (#885). A reentrant load module is one copy
shared by every task that LINKs it, and CC/370 keeps a Cstaticor a
non-const global in the module itself, so such a definition is shared,
unsynchronised state. Under-mrentevery definition that is notconst
warns -- globals,staticat file scope and inside functions, and
const volatileobjects;externdeclarations and string literals do
not, and-fwritable-stringswarns once.const char *pis writable (the
pointer is),char *const pis not.__stklenis exempt: the startup
reads it as the stack size. The warning is on by default under-mrent,
an error under-Werror, and-Wno-writable-dataswitches it off.
-mrentchanges no generated code. A build tool that marks a module
RENT passes-mrentto every translation unit of it; code that automatic
library call pulls from a library was compiled without it and is not
checked.- The manuals are attached to the release. ML01-0001 (User's Guide)
and ML01-0002 (Command Reference), Draft edition, are built from the
tagged sources and attached asml01-0001-0.pdfandml01-0002-0.pdf,
listed inSHA256SUMS(#893).
Fixed
- A compound literal at file scope is emitted (#890).
static int *p = (int[]){1, 2};compiled toDC A(@V2)with no@V2, and as370 stopped
with rc 8, at every optimization level. The literal is a deferred static
that is written only when a reference marks its name, and the back end
renamed static variables to@Vnwithout moving the name the reference
is checked against. It now does; the same mechanism had also dropped a
static table referenced only from a global pointer under
-funit-at-a-time. Under-mrenta writable compound literal warns as
"a compound literal", and aconstone, such as(const int[]){1, 2},
does not. Nothing else in the generated code changes: 824 sources across
the ecosystem compile to identical output. ld370 --helpno longer says a bare member packs at entry 0 (#896).
Since 1.3.0 (#850) a bare member's entry is--entry NAME, else@@CRT0,
looked up in its CESD; the manual page already said so.ld370checks the member name it writes (#895). The name from-o
is the base name up to the first period (-o upcase.lmisUPCASE), but
the validity check cut at the last one:-o app.v1.lm -xmitwas refused
asAPP.V1althoughAPPwould have been written. Both now use the same
name. A name longer than eight characters is still refused, not cut.ld370 --packrefuses a link input instead of dropping it (#894). An
object deck or archive named before--packwent into the link list,
which a pack ignores:ld370 A.iebcopy --pack B.iebcopy -o lib -xmit
ended with rc 0 and a library holding B alone.--packwith no member
linked the other operands instead, and-l/-Lwere searched for
nothing. Every operand after--packis a member; any input file named
before--pack(a member to pack included),-lor-Lon a--pack
command, and a--packnaming no member, are now refused with rc 2,
naming the operand, and nothing is written.install.shnames a failed GitHub API call instead of reporting "no
LIBC/370 release fits" (#879). When the API's rate limit (60 requests an
hour per address) was used up, the release list came back empty and the
script said that no LIBC/370 fitted, installed CC/370 alone and ended with
rc 0. Since 1.4.0 a link needs LIBC/370, so the result was a compiler that
could not link, with a message pointing at the wrong problem. Every API
call is now checked: a rate limit is named with the minutes until it
resets, any other HTTP status and a failed connection likewise, and the
script ends with rc 1. "No release fits" is kept for a list that was read
and had no match.GITHUB_TOKENis sent to the API when set, and a
release list on one line is read whole. Run by zsh (| zsh), the script
skipped LIBC/370 with the same message, because zsh does not split words;
it now turns that on. The 1.4.0 release'sinstall.shasset was replaced
with this version on 2026-10-05 (and itsSHA256SUMSline with it); the
toolchain archives and packages were not changed.